cloud-ide-core 2.0.3 → 2.0.4
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.
- package/fesm2022/cloud-ide-core.mjs +206 -105
- package/fesm2022/cloud-ide-core.mjs.map +1 -1
- package/index.d.ts +19 -8
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { authGuard } from 'cloud-ide-auth';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
3
|
import { Injectable, Component, inject, DestroyRef, viewChild, signal, computed, ViewChild } from '@angular/core';
|
|
3
4
|
import * as i1$1 from '@angular/common';
|
|
@@ -19,6 +20,7 @@ const coreRoutes = [
|
|
|
19
20
|
path: 'menu-management',
|
|
20
21
|
loadComponent: () => Promise.resolve().then(function () { return menuList_component; }).then(c => c.CideCoreMenuListComponent),
|
|
21
22
|
title: 'Menu Management',
|
|
23
|
+
canActivate: [authGuard],
|
|
22
24
|
data: {
|
|
23
25
|
reuseTab: true,
|
|
24
26
|
sypg_page_code: "core_menu_list"
|
|
@@ -27,6 +29,7 @@ const coreRoutes = [
|
|
|
27
29
|
path: 'department',
|
|
28
30
|
loadComponent: () => Promise.resolve().then(function () { return departmentList_component; }).then(c => c.CideCoreDepartmentListComponent),
|
|
29
31
|
title: 'Department Management',
|
|
32
|
+
canActivate: [authGuard],
|
|
30
33
|
data: {
|
|
31
34
|
reuseTab: true,
|
|
32
35
|
sypg_page_code: "core_department_list"
|
|
@@ -36,6 +39,7 @@ const coreRoutes = [
|
|
|
36
39
|
path: 'designation',
|
|
37
40
|
loadComponent: () => Promise.resolve().then(function () { return designationList_component; }).then(c => c.CideCoreDesignationListComponent),
|
|
38
41
|
title: 'Designation Management',
|
|
42
|
+
canActivate: [authGuard],
|
|
39
43
|
data: {
|
|
40
44
|
reuseTab: true,
|
|
41
45
|
sypg_page_code: "core_designation_list"
|
|
@@ -45,6 +49,7 @@ const coreRoutes = [
|
|
|
45
49
|
path: 'grade-level',
|
|
46
50
|
loadComponent: () => Promise.resolve().then(function () { return gradeLevelList_component; }).then(c => c.CideCoreGradeLevelListComponent),
|
|
47
51
|
title: 'Grade Level Management',
|
|
52
|
+
canActivate: [authGuard],
|
|
48
53
|
data: {
|
|
49
54
|
reuseTab: true,
|
|
50
55
|
sypg_page_code: "core_grade_level_list"
|
|
@@ -54,6 +59,7 @@ const coreRoutes = [
|
|
|
54
59
|
path: 'page',
|
|
55
60
|
loadComponent: () => Promise.resolve().then(function () { return pageList_component; }).then(c => c.CideCorePageListComponent),
|
|
56
61
|
title: 'Page Management',
|
|
62
|
+
canActivate: [authGuard],
|
|
57
63
|
data: {
|
|
58
64
|
reuseTab: true,
|
|
59
65
|
sypg_page_code: "core_page_management"
|
|
@@ -63,6 +69,7 @@ const coreRoutes = [
|
|
|
63
69
|
path: 'page-form',
|
|
64
70
|
loadComponent: () => import('./cloud-ide-core-page-form.component-DzBvQ1kV.mjs').then(c => c.CideCorePageFormComponent),
|
|
65
71
|
title: 'Page Form',
|
|
72
|
+
canActivate: [authGuard],
|
|
66
73
|
data: {
|
|
67
74
|
reuseTab: true,
|
|
68
75
|
sypg_page_code: "core_page_management"
|
|
@@ -72,6 +79,7 @@ const coreRoutes = [
|
|
|
72
79
|
path: 'page-form/:query',
|
|
73
80
|
loadComponent: () => import('./cloud-ide-core-page-form.component-DzBvQ1kV.mjs').then(c => c.CideCorePageFormComponent),
|
|
74
81
|
title: 'Page Form',
|
|
82
|
+
canActivate: [authGuard],
|
|
75
83
|
data: {
|
|
76
84
|
reuseTab: true,
|
|
77
85
|
sypg_page_code: "core_page_management"
|
|
@@ -81,6 +89,7 @@ const coreRoutes = [
|
|
|
81
89
|
path: 'page-theme',
|
|
82
90
|
loadComponent: () => Promise.resolve().then(function () { return pageTheme_component; }).then(c => c.CideCorePageThemeComponent),
|
|
83
91
|
title: 'Page Theme Management',
|
|
92
|
+
canActivate: [authGuard],
|
|
84
93
|
data: {
|
|
85
94
|
reuseTab: true,
|
|
86
95
|
sypg_page_code: "core_page_theme"
|
|
@@ -90,6 +99,7 @@ const coreRoutes = [
|
|
|
90
99
|
path: 'page-theme/:query',
|
|
91
100
|
loadComponent: () => Promise.resolve().then(function () { return pageTheme_component; }).then(c => c.CideCorePageThemeComponent),
|
|
92
101
|
title: 'Page Theme Management',
|
|
102
|
+
canActivate: [authGuard],
|
|
93
103
|
data: {
|
|
94
104
|
reuseTab: true,
|
|
95
105
|
sypg_page_code: "core_page_theme"
|
|
@@ -99,6 +109,7 @@ const coreRoutes = [
|
|
|
99
109
|
path: 'page-controls',
|
|
100
110
|
loadComponent: () => Promise.resolve().then(function () { return pageControls_component; }).then(c => c.CideCorePageControlsComponent),
|
|
101
111
|
title: 'Page Controls Management',
|
|
112
|
+
canActivate: [authGuard],
|
|
102
113
|
data: {
|
|
103
114
|
reuseTab: true,
|
|
104
115
|
sypg_page_code: "core_page_controls"
|
|
@@ -108,6 +119,7 @@ const coreRoutes = [
|
|
|
108
119
|
path: 'page-controls/:query',
|
|
109
120
|
loadComponent: () => Promise.resolve().then(function () { return pageControls_component; }).then(c => c.CideCorePageControlsComponent),
|
|
110
121
|
title: 'Page Controls Management',
|
|
122
|
+
canActivate: [authGuard],
|
|
111
123
|
data: {
|
|
112
124
|
reuseTab: true,
|
|
113
125
|
sypg_page_code: "core_page_controls"
|
|
@@ -117,6 +129,7 @@ const coreRoutes = [
|
|
|
117
129
|
path: 'general_master_entry',
|
|
118
130
|
loadComponent: () => Promise.resolve().then(function () { return generalMaster_component; }).then(c => c.CideCoreGeneralMasterComponent),
|
|
119
131
|
title: 'General Master Entry',
|
|
132
|
+
canActivate: [authGuard],
|
|
120
133
|
data: {
|
|
121
134
|
reuseTab: true,
|
|
122
135
|
sypg_page_code: "core_general_master"
|
|
@@ -126,6 +139,7 @@ const coreRoutes = [
|
|
|
126
139
|
path: 'general_master_entry/:query',
|
|
127
140
|
loadComponent: () => Promise.resolve().then(function () { return generalMaster_component; }).then(c => c.CideCoreGeneralMasterComponent),
|
|
128
141
|
title: 'General Master Entry',
|
|
142
|
+
canActivate: [authGuard],
|
|
129
143
|
data: {
|
|
130
144
|
reuseTab: true,
|
|
131
145
|
sypg_page_code: "core_general_master"
|
|
@@ -135,6 +149,7 @@ const coreRoutes = [
|
|
|
135
149
|
path: 'general_type_entry',
|
|
136
150
|
loadComponent: () => Promise.resolve().then(function () { return generalMasterType_component; }).then(c => c.CideCoreGeneralMasterTypeComponent),
|
|
137
151
|
title: 'General Type Entry',
|
|
152
|
+
canActivate: [authGuard],
|
|
138
153
|
data: {
|
|
139
154
|
reuseTab: true,
|
|
140
155
|
sypg_page_code: "core_general_master_type"
|
|
@@ -144,6 +159,7 @@ const coreRoutes = [
|
|
|
144
159
|
path: 'general_type_entry/:query',
|
|
145
160
|
loadComponent: () => Promise.resolve().then(function () { return generalMasterType_component; }).then(c => c.CideCoreGeneralMasterTypeComponent),
|
|
146
161
|
title: 'General Type Entry',
|
|
162
|
+
canActivate: [authGuard],
|
|
147
163
|
data: {
|
|
148
164
|
reuseTab: true,
|
|
149
165
|
sypg_page_code: "core_general_master_type"
|
|
@@ -154,6 +170,7 @@ const coreRoutes = [
|
|
|
154
170
|
path: 'user-master',
|
|
155
171
|
loadComponent: () => Promise.resolve().then(function () { return userList_component; }).then(c => c.CideCoreUserListComponent),
|
|
156
172
|
title: 'User Management',
|
|
173
|
+
canActivate: [authGuard],
|
|
157
174
|
data: {
|
|
158
175
|
reuseTab: true,
|
|
159
176
|
sypg_page_code: "auth_user_mst"
|
|
@@ -163,6 +180,7 @@ const coreRoutes = [
|
|
|
163
180
|
path: 'user-master/create',
|
|
164
181
|
loadComponent: () => Promise.resolve().then(function () { return userCreate_component; }).then(c => c.CideCoreUserCreateComponent),
|
|
165
182
|
title: 'Create User',
|
|
183
|
+
canActivate: [authGuard],
|
|
166
184
|
data: {
|
|
167
185
|
reuseTab: true,
|
|
168
186
|
sypg_page_code: "core_user_management_create"
|
|
@@ -172,6 +190,7 @@ const coreRoutes = [
|
|
|
172
190
|
path: 'user-master/edit/:query',
|
|
173
191
|
loadComponent: () => Promise.resolve().then(function () { return userCreate_component; }).then(c => c.CideCoreUserCreateComponent),
|
|
174
192
|
title: 'Edit User',
|
|
193
|
+
canActivate: [authGuard],
|
|
175
194
|
data: {
|
|
176
195
|
reuseTab: true,
|
|
177
196
|
sypg_page_code: "core_user_management_create"
|
|
@@ -181,6 +200,7 @@ const coreRoutes = [
|
|
|
181
200
|
path: 'user-master/view/:query',
|
|
182
201
|
loadComponent: () => Promise.resolve().then(function () { return userCreate_component; }).then(c => c.CideCoreUserCreateComponent),
|
|
183
202
|
title: 'View User',
|
|
203
|
+
canActivate: [authGuard],
|
|
184
204
|
data: {
|
|
185
205
|
reuseTab: true,
|
|
186
206
|
sypg_page_code: "core_user_management_create"
|
|
@@ -189,7 +209,7 @@ const coreRoutes = [
|
|
|
189
209
|
{
|
|
190
210
|
path: "entity-list",
|
|
191
211
|
loadComponent: () => Promise.resolve().then(function () { return entityList_component; }).then(c => c.CideCoreEntityListComponent),
|
|
192
|
-
|
|
212
|
+
canActivate: [authGuard],
|
|
193
213
|
data: {
|
|
194
214
|
reuseTab: true,
|
|
195
215
|
sypg_page_code: "admin_entity_list"
|
|
@@ -198,7 +218,7 @@ const coreRoutes = [
|
|
|
198
218
|
{
|
|
199
219
|
path: "entity-create",
|
|
200
220
|
loadComponent: () => Promise.resolve().then(function () { return entityCreate_component; }).then(c => c.CideCoreEntityCreateComponent),
|
|
201
|
-
|
|
221
|
+
canActivate: [authGuard],
|
|
202
222
|
data: {
|
|
203
223
|
reuseTab: true,
|
|
204
224
|
sypg_page_code: "core_entity_form"
|
|
@@ -207,7 +227,7 @@ const coreRoutes = [
|
|
|
207
227
|
{
|
|
208
228
|
path: "entity-create/:query",
|
|
209
229
|
loadComponent: () => Promise.resolve().then(function () { return entityCreate_component; }).then(c => c.CideCoreEntityCreateComponent),
|
|
210
|
-
|
|
230
|
+
canActivate: [authGuard],
|
|
211
231
|
data: {
|
|
212
232
|
reuseTab: true,
|
|
213
233
|
sypg_page_code: "core_entity_form"
|
|
@@ -7769,7 +7789,7 @@ class CideCoreGeneralMasterTypeComponent {
|
|
|
7769
7789
|
document.dispatchEvent(event);
|
|
7770
7790
|
}
|
|
7771
7791
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CideCoreGeneralMasterTypeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7772
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: CideCoreGeneralMasterTypeComponent, isStandalone: true, selector: "cide-core-general-master-type", viewQueries: [{ propertyName: "typeDetailsRendererTemplate", first: true, predicate: ["typeDetailsRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "typeStatusRendererTemplate", first: true, predicate: ["typeStatusRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "actionsDropdownRendererTemplate", first: true, predicate: ["actionsDropdownRendererTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- General Master Type Container -->\n<div class=\"tw-table tw-w-full tw-h-full\">\n\n <!-- Quick Add Form Section -->\n <div class=\"tw-table-row tw-h-0\">\n <div class=\"tw-table-cell tw-px-4 tw-py-3 tw-border-b tw-border-gray-200 tw-bg-white\">\n <div class=\"tw-flex tw-items-center tw-justify-between tw-mb-0\">\n <div class=\"tw-flex tw-items-center tw-space-x-3 tw-mb-3\">\n <cide-ele-icon class=\"tw-text-blue-600 tw-w-4 tw-h-4\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n <h6 class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-m-0\">{{ isEditMode() ? 'Edit Type' : 'Quick Add Type' }}</h6>\n </div>\n \n <!-- Parent Type Info (shown when adding child) -->\n @if (typeForm.get('sygmt_id_sygmt')?.value) {\n <div class=\"tw-flex tw-items-center tw-space-x-3 tw-bg-blue-50 tw-border tw-border-blue-200 tw-px-4 tw-py-1 tw-rounded-lg\">\n <cide-ele-icon class=\"tw-text-blue-600 tw-w-4 tw-h-4\">account_tree</cide-ele-icon>\n <div class=\"tw-flex tw-items-center tw-space-x-2\">\n <span class=\"tw-text-sm tw-text-blue-600 tw-font-medium\">{{ isEditMode() ? 'Parent:' : 'Creating child under:' }}</span>\n <span class=\"tw-text-sm tw-text-blue-800 tw-font-semibold\">{{ getParentTypeDisplay() }}</span>\n </div>\n <button \n cideEleButton \n variant=\"ghost\" \n size=\"xs\" \n type=\"button\" \n (click)=\"clearParentType()\" \n class=\"tw-text-blue-400 hover:tw-text-blue-600\">\n <svg class=\"tw-w-4 tw-h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\"/>\n </svg>\n </button>\n </div>\n }\n </div>\n\n <form [formGroup]=\"typeForm\" (ngSubmit)=\"onSubmit($event)\" class=\"tw-space-y-2 tw-relative\">\n <!-- Hidden field for parent type ID -->\n <input type=\"hidden\" formControlName=\"sygmt_id_sygmt\">\n \n <!-- First Row - Basic fields -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-6 tw-gap-2\">\n <!-- Type Code -->\n <div class=\"lg:tw-col-span-1\">\n <cide-ele-input \n formControlName=\"sygmt_code\" \n label=\"Type Code*\" \n placeholder=\"Enter type code\"\n size=\"sm\"\n [maxlength]=\"40\">\n </cide-ele-input>\n </div>\n \n <!-- Type Title -->\n <div class=\"lg:tw-col-span-2\">\n <cide-ele-input \n formControlName=\"sygmt_title\" \n label=\"Type Title*\" \n placeholder=\"Enter type title\"\n size=\"sm\"\n [maxlength]=\"100\">\n </cide-ele-input>\n </div>\n \n <!-- Active Status -->\n <div class=\"lg:tw-col-span-1 tw-flex tw-items-center tw-pt-0\">\n <cide-ele-input \n formControlName=\"sygmt_isactive\"\n type=\"checkbox\"\n label=\"Active\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n </div>\n <!-- Second Row - JSON Configuration and Description/Save side by side -->\n <div class=\"tw-flex tw-gap-4\">\n <!-- JSON Configuration (60% width) -->\n <div class=\"tw-w-3/5\">\n <cide-ele-json-editor \n formControlName=\"sygmt_configuration\" \n label=\"Configuration*\" \n size=\"sm\">\n </cide-ele-json-editor>\n </div>\n \n <!-- Description and Save Button (40% width) -->\n <div class=\"tw-w-2/5 tw-flex tw-flex-col tw-space-y-4\">\n <!-- Description -->\n <div class=\"tw-flex-1\">\n <cide-ele-textarea \n formControlName=\"sygmt_desc\" \n label=\"Description\" \n placeholder=\"Enter description\"\n size=\"sm\"\n [maxlength]=\"255\" \n [rows]=\"4\">\n </cide-ele-textarea>\n </div>\n \n <!-- Action Buttons -->\n <div class=\"tw-flex tw-justify-end tw-space-x-2\">\n <button \n cideEleButton \n variant=\"outline\" \n size=\"sm\" \n type=\"button\" \n (click)=\"cancelForm()\"\n [disabled]=\"loading()\"\n class=\"tw-px-4 tw-py-2\">\n Cancel\n </button>\n <button \n cideEleButton \n variant=\"primary\" \n size=\"sm\" \n type=\"submit\"\n [disabled]=\"loading()\"\n class=\"tw-px-4 tw-py-2\" [leftIcon]=\"isEditMode() ? 'edit' : 'add'\">\n {{ isEditMode() ? 'Update' : 'Save' }}\n </button>\n </div>\n </div>\n </div>\n </form>\n </div>\n </div>\n\n <!-- Header Section with Filters -->\n <div class=\"tw-table-row tw-h-0\">\n <div class=\"tw-table-cell tw-px-4 tw-py-2 tw-border-b tw-border-gray-200 tw-bg-gray-50\">\n <div class=\"tw-flex tw-flex-col sm:tw-flex-row tw-justify-between tw-items-start sm:tw-items-center tw-space-y-2 sm:tw-space-y-0\">\n \n <!-- Title -->\n <div class=\"tw-flex tw-items-center tw-space-x-2\">\n <cide-ele-icon class=\"tw-text-blue-600 tw-w-4 tw-h-4\">category</cide-ele-icon>\n <h5 class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-m-0\">General Master Type Management</h5>\n </div>\n\n <!-- Actions -->\n <div class=\"tw-flex tw-flex-col sm:tw-flex-row tw-items-start sm:tw-items-center tw-space-y-2 sm:tw-space-y-0 sm:tw-space-x-3\">\n\n </div>\n </div>\n\n <!-- Error Message -->\n @if (error()) {\n <div class=\"tw-mt-3 tw-p-3 tw-bg-red-50 tw-border tw-border-red-200 tw-rounded-md\">\n <div class=\"tw-flex tw-items-start\">\n <cide-ele-icon name=\"error\" class=\"tw-text-red-400 tw-w-4 tw-h-4 tw-mt-0.5 tw-flex-shrink-0\"></cide-ele-icon>\n <div class=\"tw-ml-2\">\n <h3 class=\"tw-text-xs tw-font-medium tw-text-red-800 tw-m-0\">Error</h3>\n <p class=\"tw-text-xs tw-text-red-700 tw-mt-1 tw-m-0\">{{ error() }}</p>\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n\n <!-- Main Content Area -->\n <div class=\"tw-table-row\">\n <div class=\"tw-table-cell tw-h-full tw-relative\">\n \n <!-- Data Grid Component -->\n <div class=\"tw-h-full tw-overflow-auto\">\n <cide-ele-data-grid \n [config]=\"gridConfig()\" \n [templateRenderers]=\"templateRenderers()\"\n (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n </div>\n\n </div>\n </div>\n\n</div>\n\n<!-- Template Renderers -->\n<ng-template #typeDetailsRendererTemplate let-row=\"row\">\n <div class=\"tw-flex tw-flex-col\">\n <div class=\"tw-font-medium tw-text-gray-900\">{{ row.sygmt_title || 'N/A' }}</div>\n <div class=\"tw-text-sm tw-text-gray-500 tw-truncate tw-max-w-xs\" title=\"{{ row.sygmt_desc || 'No description' }}\">{{ row.sygmt_desc || 'No description' }}</div>\n </div>\n</ng-template>\n\n<ng-template #typeStatusRendererTemplate let-row=\"row\">\n <span class=\"tw-inline-flex tw-items-center tw-px-2.5 tw-py-0.5 tw-rounded-full tw-text-xs tw-font-medium\"\n [class.tw-bg-green-100]=\"row.sygmt_isactive\"\n [class.tw-text-green-800]=\"row.sygmt_isactive\"\n [class.tw-bg-red-100]=\"!row.sygmt_isactive\"\n [class.tw-text-red-800]=\"!row.sygmt_isactive\">\n {{ row.sygmt_isactive ? 'Active' : 'Inactive' }}\n </span>\n</ng-template>\n\n\n\n<ng-template #actionsDropdownRendererTemplate let-row=\"row\">\n <cide-ele-dropdown\n [items]=\"getActionDropdownItems(row)\"\n [config]=\"getDropdownConfig()\"\n (itemClick)=\"onDropdownItemClick($event, row)\">\n </cide-ele-dropdown>\n</ng-template>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: CideEleDataGridComponent, selector: "cide-ele-data-grid", inputs: ["config", "templateRenderers", "customFormatters", "actionHandlers", "serverSidePagination", "totalServerItems", "currentServerPage", "currentServerPageSize", "dragDropEnabled"], outputs: ["gridEvent"] }, { kind: "component", type: CideEleButtonComponent, selector: "button[cideEleButton], a[cideEleButton]", inputs: ["label", "variant", "size", "type", "shape", "elevation", "disabled", "id", "loading", "fullWidth", "leftIcon", "rightIcon", "customClass", "tooltip", "ariaLabel", "testId", "routerLink", "routerExtras", "preventDoubleClick", "animated"], outputs: ["btnClick", "doubleClick"] }, { kind: "component", type: CideInputComponent, selector: "cide-ele-input", inputs: ["fill", "label", "labelHide", "disabled", "clearInput", "labelPlacement", "labelDir", "placeholder", "leadingIcon", "trailingIcon", "helperText", "helperTextCollapse", "hideHelperAndErrorText", "errorText", "maxlength", "minlength", "required", "autocapitalize", "autocomplete", "type", "width", "id", "ngModel", "option", "min", "max", "size"], outputs: ["ngModelChange"] }, { kind: "component", type: CideTextareaComponent, selector: "cide-ele-textarea", inputs: ["label", "labelHide", "placeholder", "helperText", "errorText", "required", "disabled", "minlength", "maxlength", "rows", "id", "ngModel", "size", "fill", "labelPlacement", "labelDir", "leadingIcon", "trailingIcon", "clearInput"], outputs: ["ngModelChange"] }, { kind: "component", type: CideIconComponent, selector: "cide-ele-icon", inputs: ["size", "type", "toolTip"] }, { kind: "component", type: CideEleDropdownComponent, selector: "cide-ele-dropdown", inputs: ["items", "config", "triggerTemplate", "menuTemplate"], outputs: ["itemClick", "dropdownToggle"] }, { kind: "component", type: CideEleJsonEditorComponent, selector: "cide-ele-json-editor", inputs: ["label", "helperText", "required", "disabled", "showCharacterCount", "config"], outputs: ["valueChange", "objectChange", "errorsChange", "validChange"] }] });
|
|
7792
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: CideCoreGeneralMasterTypeComponent, isStandalone: true, selector: "cide-core-general-master-type", viewQueries: [{ propertyName: "typeDetailsRendererTemplate", first: true, predicate: ["typeDetailsRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "typeStatusRendererTemplate", first: true, predicate: ["typeStatusRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "actionsDropdownRendererTemplate", first: true, predicate: ["actionsDropdownRendererTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- General Master Type Container -->\n<div class=\"tw-table tw-w-full tw-h-full\">\n\n <!-- Quick Add Form Section -->\n <div class=\"tw-table-row tw-h-0\">\n <div class=\"tw-table-cell tw-px-4 tw-py-3 tw-border-b tw-border-gray-200 tw-bg-white\">\n <div class=\"tw-flex tw-items-center tw-justify-between tw-mb-0\">\n <div class=\"tw-flex tw-items-center tw-space-x-3 tw-mb-3\">\n <cide-ele-icon class=\"tw-text-blue-600 tw-w-4 tw-h-4\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n <h6 class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-m-0\">{{ isEditMode() ? 'Edit Type' : 'General Master\n Type Management' }}</h6>\n </div>\n\n <!-- Parent Type Info (shown when adding child) -->\n @if (typeForm.get('sygmt_id_sygmt')?.value) {\n <div\n class=\"tw-flex tw-items-center tw-space-x-3 tw-bg-blue-50 tw-border tw-border-blue-200 tw-px-4 tw-py-1 tw-rounded-lg\">\n <cide-ele-icon class=\"tw-text-blue-600 tw-w-4 tw-h-4\">account_tree</cide-ele-icon>\n <div class=\"tw-flex tw-items-center tw-space-x-2\">\n <span class=\"tw-text-sm tw-text-blue-600 tw-font-medium\">{{ isEditMode() ? 'Parent:' : 'Creating child\n under:' }}</span>\n <span class=\"tw-text-sm tw-text-blue-800 tw-font-semibold\">{{ getParentTypeDisplay() }}</span>\n </div>\n <button cideEleButton variant=\"ghost\" size=\"xs\" type=\"button\" (click)=\"clearParentType()\"\n class=\"tw-text-blue-400 hover:tw-text-blue-600\">\n <svg class=\"tw-w-4 tw-h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n </div>\n }\n </div>\n\n <form [formGroup]=\"typeForm\" (ngSubmit)=\"onSubmit($event)\" class=\"tw-space-y-2 tw-relative\">\n <!-- Hidden field for parent type ID -->\n <input type=\"hidden\" formControlName=\"sygmt_id_sygmt\">\n\n <!-- First Row - Basic fields -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-6 tw-gap-2\">\n <!-- Type Code -->\n <div class=\"lg:tw-col-span-1\">\n <cide-ele-input formControlName=\"sygmt_code\" label=\"Type Code*\" placeholder=\"Enter type code\" size=\"sm\"\n [maxlength]=\"40\">\n </cide-ele-input>\n </div>\n\n <!-- Type Title -->\n <div class=\"lg:tw-col-span-2\">\n <cide-ele-input formControlName=\"sygmt_title\" label=\"Type Title*\" placeholder=\"Enter type title\" size=\"sm\"\n [maxlength]=\"100\">\n </cide-ele-input>\n </div>\n\n <!-- Active Status -->\n <div class=\"lg:tw-col-span-1 tw-flex tw-items-center tw-pt-0\">\n <cide-ele-input formControlName=\"sygmt_isactive\" type=\"checkbox\" label=\"Active\" size=\"sm\">\n </cide-ele-input>\n </div>\n </div>\n <!-- Second Row - JSON Configuration and Description/Save side by side -->\n <div class=\"tw-flex tw-gap-4\">\n <!-- JSON Configuration (60% width) -->\n <div class=\"tw-w-3/5\">\n <cide-ele-json-editor formControlName=\"sygmt_configuration\" label=\"Configuration*\" size=\"sm\">\n </cide-ele-json-editor>\n </div>\n\n <!-- Description and Save Button (40% width) -->\n <div class=\"tw-w-2/5 tw-flex tw-flex-col tw-space-y-4\">\n <!-- Description -->\n <div class=\"tw-flex-1\">\n <cide-ele-textarea formControlName=\"sygmt_desc\" label=\"Description\" placeholder=\"Enter description\"\n size=\"sm\" [maxlength]=\"255\" [rows]=\"4\">\n </cide-ele-textarea>\n </div>\n\n <!-- Action Buttons -->\n <div class=\"tw-flex tw-justify-end tw-space-x-2\">\n <button cideEleButton variant=\"outline\" size=\"sm\" type=\"button\" (click)=\"cancelForm()\"\n [disabled]=\"loading()\" class=\"tw-px-4 tw-py-2\">\n Cancel\n </button>\n <button cideEleButton variant=\"primary\" size=\"sm\" type=\"submit\" [disabled]=\"loading()\"\n class=\"tw-px-4 tw-py-2\" [leftIcon]=\"isEditMode() ? 'edit' : 'add'\">\n {{ isEditMode() ? 'Update' : 'Save' }}\n </button>\n </div>\n </div>\n </div>\n </form>\n </div>\n </div>\n\n <!-- Header Section with Filters -->\n <div class=\"tw-table-row tw-h-0\">\n <div class=\"tw-table-cell tw-px-4 tw-border-b tw-border-gray-200 tw-bg-gray-50\">\n\n <!-- Error Message -->\n @if (error()) {\n <div class=\"tw-mt-3 tw-p-3 tw-bg-red-50 tw-border tw-border-red-200 tw-rounded-md\">\n <div class=\"tw-flex tw-items-start\">\n <cide-ele-icon name=\"error\" class=\"tw-text-red-400 tw-w-4 tw-h-4 tw-mt-0.5 tw-flex-shrink-0\"></cide-ele-icon>\n <div class=\"tw-ml-2\">\n <h3 class=\"tw-text-xs tw-font-medium tw-text-red-800 tw-m-0\">Error</h3>\n <p class=\"tw-text-xs tw-text-red-700 tw-mt-1 tw-m-0\">{{ error() }}</p>\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n\n <!-- Main Content Area -->\n <div class=\"tw-table-row\">\n <div class=\"tw-table-cell tw-h-full tw-relative\">\n\n <!-- Data Grid Component -->\n <div class=\"tw-h-full tw-overflow-auto\">\n <cide-ele-data-grid [config]=\"gridConfig()\" [templateRenderers]=\"templateRenderers()\"\n (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n </div>\n\n </div>\n </div>\n\n</div>\n\n<!-- Template Renderers -->\n<ng-template #typeDetailsRendererTemplate let-row=\"row\">\n <div class=\"tw-flex tw-flex-col\">\n <div class=\"tw-font-medium tw-text-gray-900\">{{ row.sygmt_title || 'N/A' }}</div>\n <div class=\"tw-text-sm tw-text-gray-500 tw-truncate tw-max-w-xs\" title=\"{{ row.sygmt_desc || 'No description' }}\">{{\n row.sygmt_desc || 'No description' }}</div>\n </div>\n</ng-template>\n\n<ng-template #typeStatusRendererTemplate let-row=\"row\">\n <span class=\"tw-inline-flex tw-items-center tw-px-2.5 tw-py-0.5 tw-rounded-full tw-text-xs tw-font-medium\"\n [class.tw-bg-green-100]=\"row.sygmt_isactive\" [class.tw-text-green-800]=\"row.sygmt_isactive\"\n [class.tw-bg-red-100]=\"!row.sygmt_isactive\" [class.tw-text-red-800]=\"!row.sygmt_isactive\">\n {{ row.sygmt_isactive ? 'Active' : 'Inactive' }}\n </span>\n</ng-template>\n\n\n\n<ng-template #actionsDropdownRendererTemplate let-row=\"row\">\n <cide-ele-dropdown [items]=\"getActionDropdownItems(row)\" [config]=\"getDropdownConfig()\"\n (itemClick)=\"onDropdownItemClick($event, row)\">\n </cide-ele-dropdown>\n</ng-template>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: CideEleDataGridComponent, selector: "cide-ele-data-grid", inputs: ["config", "templateRenderers", "customFormatters", "actionHandlers", "serverSidePagination", "totalServerItems", "currentServerPage", "currentServerPageSize", "dragDropEnabled"], outputs: ["gridEvent"] }, { kind: "component", type: CideEleButtonComponent, selector: "button[cideEleButton], a[cideEleButton]", inputs: ["label", "variant", "size", "type", "shape", "elevation", "disabled", "id", "loading", "fullWidth", "leftIcon", "rightIcon", "customClass", "tooltip", "ariaLabel", "testId", "routerLink", "routerExtras", "preventDoubleClick", "animated"], outputs: ["btnClick", "doubleClick"] }, { kind: "component", type: CideInputComponent, selector: "cide-ele-input", inputs: ["fill", "label", "labelHide", "disabled", "clearInput", "labelPlacement", "labelDir", "placeholder", "leadingIcon", "trailingIcon", "helperText", "helperTextCollapse", "hideHelperAndErrorText", "errorText", "maxlength", "minlength", "required", "autocapitalize", "autocomplete", "type", "width", "id", "ngModel", "option", "min", "max", "size"], outputs: ["ngModelChange"] }, { kind: "component", type: CideTextareaComponent, selector: "cide-ele-textarea", inputs: ["label", "labelHide", "placeholder", "helperText", "errorText", "required", "disabled", "minlength", "maxlength", "rows", "id", "ngModel", "size", "fill", "labelPlacement", "labelDir", "leadingIcon", "trailingIcon", "clearInput"], outputs: ["ngModelChange"] }, { kind: "component", type: CideIconComponent, selector: "cide-ele-icon", inputs: ["size", "type", "toolTip"] }, { kind: "component", type: CideEleDropdownComponent, selector: "cide-ele-dropdown", inputs: ["items", "config", "triggerTemplate", "menuTemplate"], outputs: ["itemClick", "dropdownToggle"] }, { kind: "component", type: CideEleJsonEditorComponent, selector: "cide-ele-json-editor", inputs: ["label", "helperText", "required", "disabled", "showCharacterCount", "config"], outputs: ["valueChange", "objectChange", "errorsChange", "validChange"] }] });
|
|
7773
7793
|
}
|
|
7774
7794
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CideCoreGeneralMasterTypeComponent, decorators: [{
|
|
7775
7795
|
type: Component,
|
|
@@ -7784,7 +7804,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImpor
|
|
|
7784
7804
|
CideIconComponent,
|
|
7785
7805
|
CideEleDropdownComponent,
|
|
7786
7806
|
CideEleJsonEditorComponent
|
|
7787
|
-
], template: "<!-- General Master Type Container -->\n<div class=\"tw-table tw-w-full tw-h-full\">\n\n <!-- Quick Add Form Section -->\n <div class=\"tw-table-row tw-h-0\">\n <div class=\"tw-table-cell tw-px-4 tw-py-3 tw-border-b tw-border-gray-200 tw-bg-white\">\n <div class=\"tw-flex tw-items-center tw-justify-between tw-mb-0\">\n <div class=\"tw-flex tw-items-center tw-space-x-3 tw-mb-3\">\n <cide-ele-icon class=\"tw-text-blue-600 tw-w-4 tw-h-4\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n <h6 class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-m-0\">{{ isEditMode() ? 'Edit Type' : '
|
|
7807
|
+
], template: "<!-- General Master Type Container -->\n<div class=\"tw-table tw-w-full tw-h-full\">\n\n <!-- Quick Add Form Section -->\n <div class=\"tw-table-row tw-h-0\">\n <div class=\"tw-table-cell tw-px-4 tw-py-3 tw-border-b tw-border-gray-200 tw-bg-white\">\n <div class=\"tw-flex tw-items-center tw-justify-between tw-mb-0\">\n <div class=\"tw-flex tw-items-center tw-space-x-3 tw-mb-3\">\n <cide-ele-icon class=\"tw-text-blue-600 tw-w-4 tw-h-4\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n <h6 class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-m-0\">{{ isEditMode() ? 'Edit Type' : 'General Master\n Type Management' }}</h6>\n </div>\n\n <!-- Parent Type Info (shown when adding child) -->\n @if (typeForm.get('sygmt_id_sygmt')?.value) {\n <div\n class=\"tw-flex tw-items-center tw-space-x-3 tw-bg-blue-50 tw-border tw-border-blue-200 tw-px-4 tw-py-1 tw-rounded-lg\">\n <cide-ele-icon class=\"tw-text-blue-600 tw-w-4 tw-h-4\">account_tree</cide-ele-icon>\n <div class=\"tw-flex tw-items-center tw-space-x-2\">\n <span class=\"tw-text-sm tw-text-blue-600 tw-font-medium\">{{ isEditMode() ? 'Parent:' : 'Creating child\n under:' }}</span>\n <span class=\"tw-text-sm tw-text-blue-800 tw-font-semibold\">{{ getParentTypeDisplay() }}</span>\n </div>\n <button cideEleButton variant=\"ghost\" size=\"xs\" type=\"button\" (click)=\"clearParentType()\"\n class=\"tw-text-blue-400 hover:tw-text-blue-600\">\n <svg class=\"tw-w-4 tw-h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n </div>\n }\n </div>\n\n <form [formGroup]=\"typeForm\" (ngSubmit)=\"onSubmit($event)\" class=\"tw-space-y-2 tw-relative\">\n <!-- Hidden field for parent type ID -->\n <input type=\"hidden\" formControlName=\"sygmt_id_sygmt\">\n\n <!-- First Row - Basic fields -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-6 tw-gap-2\">\n <!-- Type Code -->\n <div class=\"lg:tw-col-span-1\">\n <cide-ele-input formControlName=\"sygmt_code\" label=\"Type Code*\" placeholder=\"Enter type code\" size=\"sm\"\n [maxlength]=\"40\">\n </cide-ele-input>\n </div>\n\n <!-- Type Title -->\n <div class=\"lg:tw-col-span-2\">\n <cide-ele-input formControlName=\"sygmt_title\" label=\"Type Title*\" placeholder=\"Enter type title\" size=\"sm\"\n [maxlength]=\"100\">\n </cide-ele-input>\n </div>\n\n <!-- Active Status -->\n <div class=\"lg:tw-col-span-1 tw-flex tw-items-center tw-pt-0\">\n <cide-ele-input formControlName=\"sygmt_isactive\" type=\"checkbox\" label=\"Active\" size=\"sm\">\n </cide-ele-input>\n </div>\n </div>\n <!-- Second Row - JSON Configuration and Description/Save side by side -->\n <div class=\"tw-flex tw-gap-4\">\n <!-- JSON Configuration (60% width) -->\n <div class=\"tw-w-3/5\">\n <cide-ele-json-editor formControlName=\"sygmt_configuration\" label=\"Configuration*\" size=\"sm\">\n </cide-ele-json-editor>\n </div>\n\n <!-- Description and Save Button (40% width) -->\n <div class=\"tw-w-2/5 tw-flex tw-flex-col tw-space-y-4\">\n <!-- Description -->\n <div class=\"tw-flex-1\">\n <cide-ele-textarea formControlName=\"sygmt_desc\" label=\"Description\" placeholder=\"Enter description\"\n size=\"sm\" [maxlength]=\"255\" [rows]=\"4\">\n </cide-ele-textarea>\n </div>\n\n <!-- Action Buttons -->\n <div class=\"tw-flex tw-justify-end tw-space-x-2\">\n <button cideEleButton variant=\"outline\" size=\"sm\" type=\"button\" (click)=\"cancelForm()\"\n [disabled]=\"loading()\" class=\"tw-px-4 tw-py-2\">\n Cancel\n </button>\n <button cideEleButton variant=\"primary\" size=\"sm\" type=\"submit\" [disabled]=\"loading()\"\n class=\"tw-px-4 tw-py-2\" [leftIcon]=\"isEditMode() ? 'edit' : 'add'\">\n {{ isEditMode() ? 'Update' : 'Save' }}\n </button>\n </div>\n </div>\n </div>\n </form>\n </div>\n </div>\n\n <!-- Header Section with Filters -->\n <div class=\"tw-table-row tw-h-0\">\n <div class=\"tw-table-cell tw-px-4 tw-border-b tw-border-gray-200 tw-bg-gray-50\">\n\n <!-- Error Message -->\n @if (error()) {\n <div class=\"tw-mt-3 tw-p-3 tw-bg-red-50 tw-border tw-border-red-200 tw-rounded-md\">\n <div class=\"tw-flex tw-items-start\">\n <cide-ele-icon name=\"error\" class=\"tw-text-red-400 tw-w-4 tw-h-4 tw-mt-0.5 tw-flex-shrink-0\"></cide-ele-icon>\n <div class=\"tw-ml-2\">\n <h3 class=\"tw-text-xs tw-font-medium tw-text-red-800 tw-m-0\">Error</h3>\n <p class=\"tw-text-xs tw-text-red-700 tw-mt-1 tw-m-0\">{{ error() }}</p>\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n\n <!-- Main Content Area -->\n <div class=\"tw-table-row\">\n <div class=\"tw-table-cell tw-h-full tw-relative\">\n\n <!-- Data Grid Component -->\n <div class=\"tw-h-full tw-overflow-auto\">\n <cide-ele-data-grid [config]=\"gridConfig()\" [templateRenderers]=\"templateRenderers()\"\n (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n </div>\n\n </div>\n </div>\n\n</div>\n\n<!-- Template Renderers -->\n<ng-template #typeDetailsRendererTemplate let-row=\"row\">\n <div class=\"tw-flex tw-flex-col\">\n <div class=\"tw-font-medium tw-text-gray-900\">{{ row.sygmt_title || 'N/A' }}</div>\n <div class=\"tw-text-sm tw-text-gray-500 tw-truncate tw-max-w-xs\" title=\"{{ row.sygmt_desc || 'No description' }}\">{{\n row.sygmt_desc || 'No description' }}</div>\n </div>\n</ng-template>\n\n<ng-template #typeStatusRendererTemplate let-row=\"row\">\n <span class=\"tw-inline-flex tw-items-center tw-px-2.5 tw-py-0.5 tw-rounded-full tw-text-xs tw-font-medium\"\n [class.tw-bg-green-100]=\"row.sygmt_isactive\" [class.tw-text-green-800]=\"row.sygmt_isactive\"\n [class.tw-bg-red-100]=\"!row.sygmt_isactive\" [class.tw-text-red-800]=\"!row.sygmt_isactive\">\n {{ row.sygmt_isactive ? 'Active' : 'Inactive' }}\n </span>\n</ng-template>\n\n\n\n<ng-template #actionsDropdownRendererTemplate let-row=\"row\">\n <cide-ele-dropdown [items]=\"getActionDropdownItems(row)\" [config]=\"getDropdownConfig()\"\n (itemClick)=\"onDropdownItemClick($event, row)\">\n </cide-ele-dropdown>\n</ng-template>" }]
|
|
7788
7808
|
}] });
|
|
7789
7809
|
|
|
7790
7810
|
var generalMasterType_component = /*#__PURE__*/Object.freeze({
|
|
@@ -10278,7 +10298,6 @@ class CideCoreUserCreateComponent {
|
|
|
10278
10298
|
fb = inject(FormBuilder);
|
|
10279
10299
|
userMasterService = inject(CideCoreUserMasterService);
|
|
10280
10300
|
entityService = inject(CideCoreEntityManagementService);
|
|
10281
|
-
CideCoreRoleSelectService = inject(CideCoreRoleSelectService);
|
|
10282
10301
|
designationService = inject(CideCoreDesignationManagementService);
|
|
10283
10302
|
departmentService = inject(CideCoreDepartmentManagementService);
|
|
10284
10303
|
CideCoreGeneralMasterService = inject(CideCoreGeneralMasterService);
|
|
@@ -10341,6 +10360,11 @@ class CideCoreUserCreateComponent {
|
|
|
10341
10360
|
get familyDetailsFormArray() {
|
|
10342
10361
|
return this.userMasterForm.get('core_user_family_details');
|
|
10343
10362
|
}
|
|
10363
|
+
// User search functionality for family member selection
|
|
10364
|
+
userSearchResults = signal({}, ...(ngDevMode ? [{ debugName: "userSearchResults" }] : []));
|
|
10365
|
+
userSearchLoading = signal({}, ...(ngDevMode ? [{ debugName: "userSearchLoading" }] : []));
|
|
10366
|
+
// Debounce timer for search
|
|
10367
|
+
searchDebounceTimers = {};
|
|
10344
10368
|
// Helper method to create entity mapping FormGroup
|
|
10345
10369
|
createEntityMappingFormGroup() {
|
|
10346
10370
|
const today = new Date().toISOString().split('T')[0];
|
|
@@ -10380,7 +10404,11 @@ class CideCoreUserCreateComponent {
|
|
|
10380
10404
|
return this.fb.group({
|
|
10381
10405
|
_id: [''],
|
|
10382
10406
|
syusd_document_type_id_sygms: [''],
|
|
10407
|
+
syusd_doc_number: [''],
|
|
10408
|
+
syusd_doc_name_as_per_doc: [''],
|
|
10383
10409
|
syusd_photo_group_id_cyfm: [''],
|
|
10410
|
+
syusd_doc_issue_date: [''],
|
|
10411
|
+
syusd_doc_expiry_date: [''],
|
|
10384
10412
|
syusd_doc_verification_status_id_sygms: [''],
|
|
10385
10413
|
syusd_document_kyc_status_id_sygms: [''],
|
|
10386
10414
|
syusd_document_file_id_cyfm: [''],
|
|
@@ -10394,10 +10422,13 @@ class CideCoreUserCreateComponent {
|
|
|
10394
10422
|
_id: [''],
|
|
10395
10423
|
syfdl_family_member_name: [''],
|
|
10396
10424
|
syfdl_family_member_id_user: [''],
|
|
10425
|
+
syfdl_family_member_dob: [''],
|
|
10397
10426
|
syfdl_relationship_id_sygms: [''],
|
|
10398
10427
|
syfdl_blood_group_sygms: [''],
|
|
10399
10428
|
syfdl_contact_email: [''],
|
|
10429
|
+
syfdl_contact_email_id: [''],
|
|
10400
10430
|
syfdl_contact_phone: [''],
|
|
10431
|
+
syfdl_contact_number: [''],
|
|
10401
10432
|
syfdl_isactive: [true]
|
|
10402
10433
|
});
|
|
10403
10434
|
}
|
|
@@ -10411,6 +10442,102 @@ class CideCoreUserCreateComponent {
|
|
|
10411
10442
|
{ id: 'family', label: 'Family Details', icon: 'family_restroom' }
|
|
10412
10443
|
];
|
|
10413
10444
|
}
|
|
10445
|
+
// User search methods for family member selection
|
|
10446
|
+
searchUsers(query = '', familyIndex = 0) {
|
|
10447
|
+
// Update loading state for specific family member
|
|
10448
|
+
this.userSearchLoading.update(loading => ({
|
|
10449
|
+
...loading,
|
|
10450
|
+
[familyIndex]: true
|
|
10451
|
+
}));
|
|
10452
|
+
// Create payload for user search - no pagination, larger page size
|
|
10453
|
+
const searchPayload = {
|
|
10454
|
+
total: 0,
|
|
10455
|
+
pageIndex: 1,
|
|
10456
|
+
pageSize: 100, // Load more users at once since no pagination
|
|
10457
|
+
query: query || '',
|
|
10458
|
+
pagination: false, // Disable pagination
|
|
10459
|
+
sort: {
|
|
10460
|
+
order: 'asc',
|
|
10461
|
+
key: 'user_fullname'
|
|
10462
|
+
}
|
|
10463
|
+
};
|
|
10464
|
+
this.userMasterService.getUserList(searchPayload).subscribe({
|
|
10465
|
+
next: (response) => {
|
|
10466
|
+
if (response?.success) {
|
|
10467
|
+
const userData = response?.data || [];
|
|
10468
|
+
this.userSearchResults.update(results => ({
|
|
10469
|
+
...results,
|
|
10470
|
+
[familyIndex]: userData
|
|
10471
|
+
}));
|
|
10472
|
+
}
|
|
10473
|
+
else {
|
|
10474
|
+
this.userSearchResults.update(results => ({
|
|
10475
|
+
...results,
|
|
10476
|
+
[familyIndex]: []
|
|
10477
|
+
}));
|
|
10478
|
+
}
|
|
10479
|
+
},
|
|
10480
|
+
error: (error) => {
|
|
10481
|
+
console.error('Error searching users:', error);
|
|
10482
|
+
this.userSearchResults.update(results => ({
|
|
10483
|
+
...results,
|
|
10484
|
+
[familyIndex]: []
|
|
10485
|
+
}));
|
|
10486
|
+
},
|
|
10487
|
+
complete: () => {
|
|
10488
|
+
this.userSearchLoading.update(loading => ({
|
|
10489
|
+
...loading,
|
|
10490
|
+
[familyIndex]: false
|
|
10491
|
+
}));
|
|
10492
|
+
}
|
|
10493
|
+
});
|
|
10494
|
+
}
|
|
10495
|
+
// Get user options for the select component
|
|
10496
|
+
userOptions(familyIndex = 0) {
|
|
10497
|
+
return this.userSearchResults()[familyIndex] || [];
|
|
10498
|
+
}
|
|
10499
|
+
// Handle search change from the select component with debouncing
|
|
10500
|
+
onUserSearchChange(searchEvent, familyIndex) {
|
|
10501
|
+
const query = searchEvent?.query || searchEvent || '';
|
|
10502
|
+
// Clear existing debounce timer for this family member
|
|
10503
|
+
if (this.searchDebounceTimers[familyIndex]) {
|
|
10504
|
+
clearTimeout(this.searchDebounceTimers[familyIndex]);
|
|
10505
|
+
}
|
|
10506
|
+
// Set new debounce timer (300ms delay)
|
|
10507
|
+
this.searchDebounceTimers[familyIndex] = setTimeout(() => {
|
|
10508
|
+
if (query) {
|
|
10509
|
+
this.searchUsers(query, familyIndex);
|
|
10510
|
+
}
|
|
10511
|
+
else {
|
|
10512
|
+
// If no query, load all users
|
|
10513
|
+
this.searchUsers('', familyIndex);
|
|
10514
|
+
}
|
|
10515
|
+
}, 300);
|
|
10516
|
+
}
|
|
10517
|
+
// Load initial users for the select component
|
|
10518
|
+
loadInitialUsers() {
|
|
10519
|
+
// Load initial users for all existing family members
|
|
10520
|
+
const familyCount = this.familyDetailsFormArray.length;
|
|
10521
|
+
for (let i = 0; i < familyCount; i++) {
|
|
10522
|
+
this.searchUsers('', i);
|
|
10523
|
+
}
|
|
10524
|
+
}
|
|
10525
|
+
// Handle user selection change in the form
|
|
10526
|
+
onUserSelectionChange(event, familyIndex) {
|
|
10527
|
+
const selectedUserId = event?.value || event;
|
|
10528
|
+
if (selectedUserId) {
|
|
10529
|
+
// Find the selected user from the results for this specific family member
|
|
10530
|
+
const userResults = this.userSearchResults()[familyIndex] || [];
|
|
10531
|
+
const selectedUser = userResults.find((user) => user._id === selectedUserId);
|
|
10532
|
+
if (selectedUser) {
|
|
10533
|
+
// Update the family member name field with the selected user's name
|
|
10534
|
+
const familyGroup = this.familyDetailsFormArray.at(familyIndex);
|
|
10535
|
+
familyGroup.patchValue({
|
|
10536
|
+
syfdl_family_member_name: selectedUser.user_fullname || selectedUser.user_username || ''
|
|
10537
|
+
});
|
|
10538
|
+
}
|
|
10539
|
+
}
|
|
10540
|
+
}
|
|
10414
10541
|
entityOptions = signal([], ...(ngDevMode ? [{ debugName: "entityOptions" }] : []));
|
|
10415
10542
|
roleOptions = signal([], ...(ngDevMode ? [{ debugName: "roleOptions" }] : []));
|
|
10416
10543
|
designationOptions = signal({}, ...(ngDevMode ? [{ debugName: "designationOptions" }] : []));
|
|
@@ -10462,6 +10589,8 @@ class CideCoreUserCreateComponent {
|
|
|
10462
10589
|
this.loadDropdownOptions();
|
|
10463
10590
|
this.setupFormSubscriptions();
|
|
10464
10591
|
this.setEntityIdFromAppState();
|
|
10592
|
+
// Load initial users for family member selection
|
|
10593
|
+
this.loadInitialUsers();
|
|
10465
10594
|
});
|
|
10466
10595
|
}
|
|
10467
10596
|
/**
|
|
@@ -10500,6 +10629,20 @@ class CideCoreUserCreateComponent {
|
|
|
10500
10629
|
// Set password validation based on mode
|
|
10501
10630
|
this.updatePasswordValidation();
|
|
10502
10631
|
}
|
|
10632
|
+
/**
|
|
10633
|
+
* Cleanup when component is destroyed
|
|
10634
|
+
*/
|
|
10635
|
+
ngOnDestroy() {
|
|
10636
|
+
console.log('🧹 CideCoreUserCreateComponent: Cleaning up component state');
|
|
10637
|
+
// Clear all debounce timers
|
|
10638
|
+
Object.values(this.searchDebounceTimers).forEach(timer => {
|
|
10639
|
+
if (timer) {
|
|
10640
|
+
clearTimeout(timer);
|
|
10641
|
+
}
|
|
10642
|
+
});
|
|
10643
|
+
this.searchDebounceTimers = {};
|
|
10644
|
+
console.log('🧹 CideCoreUserCreateComponent: Component state cleaned up');
|
|
10645
|
+
}
|
|
10503
10646
|
/**
|
|
10504
10647
|
* Update password validation based on create/edit mode
|
|
10505
10648
|
*/
|
|
@@ -10688,10 +10831,14 @@ class CideCoreUserCreateComponent {
|
|
|
10688
10831
|
const documentGroup = this.createDocumentFormGroup();
|
|
10689
10832
|
documentGroup.patchValue({
|
|
10690
10833
|
_id: document._id || '',
|
|
10691
|
-
syusd_document_type_id_sygms: document.syusd_document_type_id_sygms || '',
|
|
10834
|
+
syusd_document_type_id_sygms: document.syusd_document_type_id_sygms?._id || '',
|
|
10835
|
+
syusd_doc_number: document.syusd_doc_number || '',
|
|
10836
|
+
syusd_doc_name_as_per_doc: document.syusd_doc_name_as_per_doc || '',
|
|
10692
10837
|
syusd_photo_group_id_cyfm: document.syusd_photo_group_id_cyfm || '',
|
|
10693
|
-
|
|
10694
|
-
|
|
10838
|
+
syusd_doc_issue_date: document.syusd_doc_issue_date || '',
|
|
10839
|
+
syusd_doc_expiry_date: document.syusd_doc_expiry_date || '',
|
|
10840
|
+
syusd_doc_verification_status_id_sygms: document.syusd_doc_verification_status_id_sygms?._id || '',
|
|
10841
|
+
syusd_document_kyc_status_id_sygms: document.syusd_document_kyc_status_id_sygms?._id || '',
|
|
10695
10842
|
syusd_document_file_id_cyfm: document.syusd_document_file_id_cyfm || '',
|
|
10696
10843
|
syusd_document_remarks: document.syusd_document_remarks || '',
|
|
10697
10844
|
syusd_isactive: document.syusd_isactive ?? true
|
|
@@ -10713,11 +10860,14 @@ class CideCoreUserCreateComponent {
|
|
|
10713
10860
|
familyGroup.patchValue({
|
|
10714
10861
|
_id: familyDetail._id || '',
|
|
10715
10862
|
syfdl_family_member_name: familyDetail.syfdl_family_member_name || '',
|
|
10716
|
-
syfdl_family_member_id_user: familyDetail.syfdl_family_member_id_user || '',
|
|
10717
|
-
|
|
10718
|
-
|
|
10863
|
+
syfdl_family_member_id_user: familyDetail.syfdl_family_member_id_user?._id || '',
|
|
10864
|
+
syfdl_family_member_dob: familyDetail.syfdl_family_member_dob || '',
|
|
10865
|
+
syfdl_relationship_id_sygms: familyDetail.syfdl_relationship_id_sygms?._id || '',
|
|
10866
|
+
syfdl_blood_group_sygms: familyDetail.syfdl_blood_group_sygms?._id || '',
|
|
10719
10867
|
syfdl_contact_email: familyDetail.syfdl_contact_email || '',
|
|
10868
|
+
syfdl_contact_email_id: familyDetail.syfdl_contact_email_id || '',
|
|
10720
10869
|
syfdl_contact_phone: familyDetail.syfdl_contact_phone || '',
|
|
10870
|
+
syfdl_contact_number: familyDetail.syfdl_contact_number || '',
|
|
10721
10871
|
syfdl_isactive: familyDetail.syfdl_isactive ?? true
|
|
10722
10872
|
});
|
|
10723
10873
|
this.familyDetailsFormArray.push(familyGroup);
|
|
@@ -10742,7 +10892,6 @@ class CideCoreUserCreateComponent {
|
|
|
10742
10892
|
this.loadAddressTypes();
|
|
10743
10893
|
// Load document and family dropdown options
|
|
10744
10894
|
this.loadDocumentTypes();
|
|
10745
|
-
this.loadPhotoGroups();
|
|
10746
10895
|
this.loadDocumentVerificationStatus();
|
|
10747
10896
|
this.loadDocumentKycStatus();
|
|
10748
10897
|
this.loadBloodGroups();
|
|
@@ -11329,70 +11478,46 @@ class CideCoreUserCreateComponent {
|
|
|
11329
11478
|
});
|
|
11330
11479
|
}
|
|
11331
11480
|
addDocument() {
|
|
11332
|
-
|
|
11333
|
-
|
|
11334
|
-
|
|
11335
|
-
|
|
11336
|
-
|
|
11337
|
-
|
|
11338
|
-
syusd_doc_expiry_date: undefined,
|
|
11339
|
-
syusd_doc_verification_status_id_sygms: {},
|
|
11340
|
-
syusd_doc_kyc_status_id_sygms: {}
|
|
11341
|
-
};
|
|
11342
|
-
this.documents.update(docs => [...docs, newDocument]);
|
|
11343
|
-
// Add form controls for the new document
|
|
11344
|
-
const currentDocuments = this.documents();
|
|
11345
|
-
const index = currentDocuments.length - 1;
|
|
11346
|
-
this.userMasterForm.addControl(`documents.${index}.syusd_document_type_id_sygms`, this.fb.control(''));
|
|
11347
|
-
this.userMasterForm.addControl(`documents.${index}.syusd_doc_number`, this.fb.control(''));
|
|
11348
|
-
this.userMasterForm.addControl(`documents.${index}.syusd_doc_name_as_per_doc`, this.fb.control(''));
|
|
11349
|
-
this.userMasterForm.addControl(`documents.${index}.syusd_photo_group_id_cyfm`, this.fb.control(''));
|
|
11350
|
-
this.userMasterForm.addControl(`documents.${index}.syusd_doc_issue_date`, this.fb.control(''));
|
|
11351
|
-
this.userMasterForm.addControl(`documents.${index}.syusd_doc_expiry_date`, this.fb.control(''));
|
|
11352
|
-
this.userMasterForm.addControl(`documents.${index}.syusd_doc_verification_status_id_sygms`, this.fb.control(''));
|
|
11353
|
-
this.userMasterForm.addControl(`documents.${index}.syusd_doc_kyc_status_id_sygms`, this.fb.control(''));
|
|
11481
|
+
// Create a new document FormGroup using the existing helper method
|
|
11482
|
+
const newDocumentGroup = this.createDocumentFormGroup();
|
|
11483
|
+
// Add the new document FormGroup to the FormArray
|
|
11484
|
+
this.documentsFormArray.push(newDocumentGroup);
|
|
11485
|
+
// Update the documents signal to keep UI in sync
|
|
11486
|
+
this.documents.update(docs => [...docs, newDocumentGroup.value]);
|
|
11354
11487
|
}
|
|
11355
11488
|
removeDocument(index) {
|
|
11356
|
-
// Remove
|
|
11357
|
-
this.
|
|
11358
|
-
|
|
11359
|
-
this.userMasterForm.removeControl(`documents.${index}.syusd_doc_name_as_per_doc`);
|
|
11360
|
-
this.userMasterForm.removeControl(`documents.${index}.syusd_photo_group_id_cyfm`);
|
|
11361
|
-
this.userMasterForm.removeControl(`documents.${index}.syusd_doc_issue_date`);
|
|
11362
|
-
this.userMasterForm.removeControl(`documents.${index}.syusd_doc_expiry_date`);
|
|
11363
|
-
this.userMasterForm.removeControl(`documents.${index}.syusd_doc_verification_status_id_sygms`);
|
|
11364
|
-
this.userMasterForm.removeControl(`documents.${index}.syusd_doc_kyc_status_id_sygms`);
|
|
11489
|
+
// Remove the document from the FormArray
|
|
11490
|
+
this.documentsFormArray.removeAt(index);
|
|
11491
|
+
// Update the documents signal to keep UI in sync
|
|
11365
11492
|
this.documents.update(docs => docs.filter((_, i) => i !== index));
|
|
11366
11493
|
}
|
|
11367
11494
|
addFamilyDetail() {
|
|
11368
|
-
|
|
11369
|
-
|
|
11370
|
-
|
|
11371
|
-
|
|
11372
|
-
|
|
11373
|
-
|
|
11374
|
-
|
|
11375
|
-
|
|
11376
|
-
this.
|
|
11377
|
-
// Add form controls for the new family detail
|
|
11378
|
-
const currentFamilies = this.familyDetails();
|
|
11379
|
-
const index = currentFamilies.length - 1;
|
|
11380
|
-
this.userMasterForm.addControl(`family_details.${index}.syfdl_family_member_name`, this.fb.control(''));
|
|
11381
|
-
this.userMasterForm.addControl(`family_details.${index}.syfdl_relationship_id_sygms`, this.fb.control(''));
|
|
11382
|
-
this.userMasterForm.addControl(`family_details.${index}.syfdl_family_member_dob`, this.fb.control(''));
|
|
11383
|
-
this.userMasterForm.addControl(`family_details.${index}.syfdl_blood_group_sygms`, this.fb.control(''));
|
|
11384
|
-
this.userMasterForm.addControl(`family_details.${index}.syfdl_contact_email_id`, this.fb.control(''));
|
|
11385
|
-
this.userMasterForm.addControl(`family_details.${index}.syfdl_contact_number`, this.fb.control(''));
|
|
11495
|
+
// Create a new family detail FormGroup using the existing helper method
|
|
11496
|
+
const newFamilyGroup = this.createFamilyDetailFormGroup();
|
|
11497
|
+
// Add the new family detail FormGroup to the FormArray
|
|
11498
|
+
this.familyDetailsFormArray.push(newFamilyGroup);
|
|
11499
|
+
// Update the family details signal to keep UI in sync
|
|
11500
|
+
this.familyDetails.update(families => [...families, newFamilyGroup.value]);
|
|
11501
|
+
// Load initial users for the new family member
|
|
11502
|
+
const newIndex = this.familyDetailsFormArray.length - 1;
|
|
11503
|
+
this.searchUsers('', newIndex);
|
|
11386
11504
|
}
|
|
11387
11505
|
removeFamilyDetail(index) {
|
|
11388
|
-
// Remove
|
|
11389
|
-
this.
|
|
11390
|
-
|
|
11391
|
-
this.userMasterForm.removeControl(`family_details.${index}.syfdl_family_member_dob`);
|
|
11392
|
-
this.userMasterForm.removeControl(`family_details.${index}.syfdl_blood_group_sygms`);
|
|
11393
|
-
this.userMasterForm.removeControl(`family_details.${index}.syfdl_contact_email_id`);
|
|
11394
|
-
this.userMasterForm.removeControl(`family_details.${index}.syfdl_contact_number`);
|
|
11506
|
+
// Remove the family detail from the FormArray
|
|
11507
|
+
this.familyDetailsFormArray.removeAt(index);
|
|
11508
|
+
// Update the family details signal to keep UI in sync
|
|
11395
11509
|
this.familyDetails.update(families => families.filter((_, i) => i !== index));
|
|
11510
|
+
// Clean up user search data for the removed family member
|
|
11511
|
+
this.userSearchResults.update(results => {
|
|
11512
|
+
const newResults = { ...results };
|
|
11513
|
+
delete newResults[index];
|
|
11514
|
+
return newResults;
|
|
11515
|
+
});
|
|
11516
|
+
this.userSearchLoading.update(loading => {
|
|
11517
|
+
const newLoading = { ...loading };
|
|
11518
|
+
delete newLoading[index];
|
|
11519
|
+
return newLoading;
|
|
11520
|
+
});
|
|
11396
11521
|
}
|
|
11397
11522
|
onSubmit() {
|
|
11398
11523
|
// Custom validation: ensure at least one entity mapping exists
|
|
@@ -11408,14 +11533,14 @@ class CideCoreUserCreateComponent {
|
|
|
11408
11533
|
if (this.userMasterForm.valid) {
|
|
11409
11534
|
this.loading.set(true);
|
|
11410
11535
|
// Prepare form data with entity mappings and menu rights
|
|
11411
|
-
const { core_entity_mapping, menu_rights, core_user_contact_addresses, ...auth_user_mst } = this.userMasterForm.value;
|
|
11536
|
+
const { core_entity_mapping, menu_rights, core_user_contact_addresses, core_user_documents, core_user_family_details, ...auth_user_mst } = this.userMasterForm.value;
|
|
11412
11537
|
const formData = {
|
|
11413
11538
|
auth_user_mst: auth_user_mst,
|
|
11414
11539
|
core_entity_mapping: core_entity_mapping || [],
|
|
11415
11540
|
menu_rights: this.menuRightsMap() || {},
|
|
11416
11541
|
core_user_contact_addresses: core_user_contact_addresses || [],
|
|
11417
|
-
core_user_documents: [],
|
|
11418
|
-
core_user_family_details: [],
|
|
11542
|
+
core_user_documents: core_user_documents || [],
|
|
11543
|
+
core_user_family_details: core_user_family_details || [],
|
|
11419
11544
|
core_user_attributes: []
|
|
11420
11545
|
};
|
|
11421
11546
|
if (this.userId()) {
|
|
@@ -11491,25 +11616,13 @@ class CideCoreUserCreateComponent {
|
|
|
11491
11616
|
while (this.contactAddressesFormArray.length !== 0) {
|
|
11492
11617
|
this.contactAddressesFormArray.removeAt(0);
|
|
11493
11618
|
}
|
|
11494
|
-
|
|
11495
|
-
|
|
11496
|
-
this.
|
|
11497
|
-
|
|
11498
|
-
|
|
11499
|
-
|
|
11500
|
-
this.
|
|
11501
|
-
this.userMasterForm.removeControl(`documents.${i}.syusd_doc_expiry_date`);
|
|
11502
|
-
this.userMasterForm.removeControl(`documents.${i}.syusd_doc_verification_status_id_sygms`);
|
|
11503
|
-
this.userMasterForm.removeControl(`documents.${i}.syusd_doc_kyc_status_id_sygms`);
|
|
11504
|
-
}
|
|
11505
|
-
const familyCount = this.familyDetails().length;
|
|
11506
|
-
for (let i = 0; i < familyCount; i++) {
|
|
11507
|
-
this.userMasterForm.removeControl(`family_details.${i}.syfdl_family_member_name`);
|
|
11508
|
-
this.userMasterForm.removeControl(`family_details.${i}.syfdl_relationship_id_sygms`);
|
|
11509
|
-
this.userMasterForm.removeControl(`family_details.${i}.syfdl_family_member_dob`);
|
|
11510
|
-
this.userMasterForm.removeControl(`family_details.${i}.syfdl_blood_group_sygms`);
|
|
11511
|
-
this.userMasterForm.removeControl(`family_details.${i}.syfdl_contact_email_id`);
|
|
11512
|
-
this.userMasterForm.removeControl(`family_details.${i}.syfdl_contact_number`);
|
|
11619
|
+
// Clear documents FormArray
|
|
11620
|
+
while (this.documentsFormArray.length !== 0) {
|
|
11621
|
+
this.documentsFormArray.removeAt(0);
|
|
11622
|
+
}
|
|
11623
|
+
// Clear family details FormArray
|
|
11624
|
+
while (this.familyDetailsFormArray.length !== 0) {
|
|
11625
|
+
this.familyDetailsFormArray.removeAt(0);
|
|
11513
11626
|
}
|
|
11514
11627
|
// Clear entity mapping FormArray
|
|
11515
11628
|
while (this.entityMappingsFormArray.length !== 0) {
|
|
@@ -11852,18 +11965,6 @@ class CideCoreUserCreateComponent {
|
|
|
11852
11965
|
}
|
|
11853
11966
|
});
|
|
11854
11967
|
}
|
|
11855
|
-
/**
|
|
11856
|
-
* Load photo groups
|
|
11857
|
-
*/
|
|
11858
|
-
loadPhotoGroups() {
|
|
11859
|
-
// TODO: Implement photo group service call
|
|
11860
|
-
// For now, using mock data
|
|
11861
|
-
this.photoGroupOptions.set([
|
|
11862
|
-
{ _id: '1', cyfm_name: 'Profile Photos' },
|
|
11863
|
-
{ _id: '2', cyfm_name: 'Document Photos' },
|
|
11864
|
-
{ _id: '3', cyfm_name: 'ID Card Photos' }
|
|
11865
|
-
]);
|
|
11866
|
-
}
|
|
11867
11968
|
/**
|
|
11868
11969
|
* Load document verification status from general master service
|
|
11869
11970
|
*/
|
|
@@ -11977,7 +12078,7 @@ class CideCoreUserCreateComponent {
|
|
|
11977
12078
|
});
|
|
11978
12079
|
}
|
|
11979
12080
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CideCoreUserCreateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
11980
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: CideCoreUserCreateComponent, isStandalone: true, selector: "cide-core-user-create", ngImport: i0, template: "<!-- \n ENTERPRISE USER MASTER FORM\n \n Enterprise-Level Styling with Tailwind CSS\n Features: Responsive grids, proper typography, enhanced user experience\n-->\n\n<div class=\"tw-w-full tw-h-full tw-p-3\">\n <form class=\"tw-max-w-7xl tw-mx-auto tw-bg-transparent\" [formGroup]=\"userMasterForm\" [class.tw-opacity-60]=\"loading()\"\n (ngSubmit)=\"onSubmit()\">\n\n <!-- User Context Header -->\n <div\n class=\"tw-bg-gradient-to-r tw-from-blue-50 tw-to-indigo-50 tw-border tw-border-blue-200 tw-rounded-md tw-p-2 tw-mb-3 tw-shadow-sm\">\n <div class=\"tw-flex tw-items-center tw-justify-between tw-flex-wrap tw-gap-2\">\n <!-- User Basic Info Display -->\n <div class=\"tw-flex tw-items-center tw-gap-3 tw-flex-wrap\">\n <!-- Profile Photo Preview -->\n <div class=\"tw-flex tw-items-center tw-gap-2\">\n <div\n class=\"tw-w-8 tw-h-8 tw-rounded-full tw-bg-blue-100 tw-border tw-border-blue-200 tw-flex tw-items-center tw-justify-center tw-overflow-hidden\">\n @if (getUserPhoto()) {\n <img [src]=\"getUserPhoto()\" alt=\"Profile\" class=\"tw-w-full tw-h-full tw-object-cover\">\n } @else {\n <cide-ele-icon variant=\"blue\" size=\"xs\">person</cide-ele-icon>\n }\n </div>\n <div class=\"tw-flex tw-flex-col\">\n <span class=\"tw-text-xs tw-font-medium tw-text-blue-900\">\n {{ getUserFullName() || 'New User' }}\n </span>\n <span class=\"tw-text-xs tw-text-blue-600\">\n {{ getUserUsername() || 'Username not set' }}\n </span>\n </div>\n </div>\n\n <!-- Contact Info -->\n <div class=\"tw-flex tw-items-center tw-gap-3\">\n <div class=\"tw-flex tw-items-center tw-gap-1 tw-text-xs tw-text-gray-700\">\n <cide-ele-icon variant=\"gray\" size=\"xs\">email</cide-ele-icon>\n <span>{{ getUserEmail() || 'Email not set' }}</span>\n </div>\n <div class=\"tw-flex tw-items-center tw-gap-1 tw-text-xs tw-text-gray-700\">\n <cide-ele-icon variant=\"gray\" size=\"xs\">phone</cide-ele-icon>\n <span>{{ getUserMobile() || 'Mobile not set' }}</span>\n </div>\n </div>\n\n <!-- Active Status -->\n <div class=\"tw-flex tw-items-center tw-gap-1\">\n @if (getUserActiveStatus()) {\n <span\n class=\"tw-inline-flex tw-items-center tw-px-2 tw-py-1 tw-rounded tw-text-xs tw-font-medium tw-bg-green-100 tw-text-green-700\">\n <cide-ele-icon variant=\"green\" size=\"xs\" class=\"tw-mr-1\">check_circle</cide-ele-icon>\n Active\n </span>\n } @else {\n <span\n class=\"tw-inline-flex tw-items-center tw-px-2 tw-py-1 tw-rounded tw-text-xs tw-font-medium tw-bg-red-100 tw-text-red-700\">\n <cide-ele-icon variant=\"red\" size=\"xs\" class=\"tw-mr-1\">cancel</cide-ele-icon>\n Inactive\n </span>\n }\n </div>\n </div>\n\n <!-- Entity Info -->\n <div class=\"tw-flex tw-items-center tw-gap-2\">\n @if (hasDefaultEntity()) {\n <div class=\"tw-flex tw-items-center tw-gap-1 tw-text-xs tw-text-blue-700\">\n <cide-ele-icon variant=\"blue\" size=\"xs\">business</cide-ele-icon>\n <span class=\"tw-font-medium\">{{ getDefaultEntityName() }}</span>\n </div>\n } @else {\n <div class=\"tw-flex tw-items-center tw-gap-1 tw-text-xs tw-text-gray-500\">\n <cide-ele-icon variant=\"gray\" size=\"xs\">business</cide-ele-icon>\n <span class=\"tw-italic\">No entity</span>\n </div>\n }\n\n <span class=\"tw-text-xs tw-text-gray-600 tw-px-2 tw-py-1 tw-bg-gray-100 tw-rounded\">\n {{ getEntityMappingCount() }} mapping(s)\n </span>\n </div>\n </div>\n </div>\n\n <!-- Tab Navigation -->\n <div class=\"tw-p-0 tw-mb-2 tw-border-b tw-border-gray-200\">\n <cide-ele-tab [tabs]=\"userTabs()\" [activeTabId]=\"activeTab()\" size=\"md\" variant=\"default\"\n (tabChange)=\"onTabChange($event)\">\n </cide-ele-tab>\n </div>\n\n <!-- Tab Content -->\n <div class=\"tw-transition-opacity tw-duration-300\" [class.tw-opacity-60]=\"loading()\">\n @switch (activeTab()) {\n\n @case ('basic') {\n <!-- User Basic Information Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n\n <!-- Name Fields -->\n <div class=\"tw-grid tw-grid-cols-1 xl:tw-grid-cols-4 lg:tw-grid-cols-2 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input id=\"user_firstname\" label=\"First Name *\" formControlName=\"user_firstname\"\n placeholder=\"Enter first name\" [maxlength]=\"20\" size=\"md\" (ngModelChange)=\"onNameFieldChange()\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_middlename\" label=\"Middle Name\" formControlName=\"user_middlename\"\n placeholder=\"Enter middle name\" [maxlength]=\"20\" size=\"md\" (ngModelChange)=\"onNameFieldChange()\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_lastname\" label=\"Last Name *\" formControlName=\"user_lastname\"\n placeholder=\"Enter last name\" [maxlength]=\"20\" size=\"md\" (ngModelChange)=\"onNameFieldChange()\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_fullname\" label=\"Full Name * (Auto-generated)\" formControlName=\"user_fullname\"\n placeholder=\"Auto-generated from name fields or enter manually\" [maxlength]=\"62\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <!-- Contact and Login Information -->\n <div class=\"tw-grid tw-grid-cols-1 xl:tw-grid-cols-3 lg:tw-grid-cols-2 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input id=\"user_username\" label=\"Username *\" formControlName=\"user_username\"\n placeholder=\"Enter unique username\" [maxlength]=\"20\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_emailid\" label=\"Email ID *\" formControlName=\"user_emailid\" type=\"email\"\n placeholder=\"Enter valid email address\" [maxlength]=\"320\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_mobileno\" label=\"Mobile Number *\" formControlName=\"user_mobileno\" type=\"tel\"\n placeholder=\"Enter mobile number\" [maxlength]=\"15\" size=\"md\">\n </cide-ele-input>\n </div>\n\n\n\n <!-- Status Control -->\n <div class=\"tw-grid tw-grid-cols-1 tw-mb-4\">\n <div class=\"tw-p-4 tw-bg-blue-50 tw-border tw-border-blue-100 tw-rounded-lg\">\n <label\n class=\"tw-flex tw-flex-col tw-cursor-pointer tw-py-2 tw-bg-transparent tw-border-none tw-rounded-none tw-transition-all tw-duration-200 hover:tw-bg-blue-75\">\n <cide-ele-input type=\"checkbox\" label=\"Active User Status\" formControlName=\"user_isactive\"\n class=\"tw-h-5 tw-accent-blue-500 tw-rounded tw-mb-1\" />\n <span class=\"tw-font-semibold tw-text-gray-700 tw-text-base\"></span>\n <span class=\"tw-text-sm tw-text-gray-600 tw-mt-1 tw-leading-relaxed\">Enable this user account for system\n access and operations</span>\n </label>\n </div>\n </div>\n </div>\n }\n\n @case ('auth') {\n <!-- Authentication Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n <!-- Password Fields -->\n @if (shouldShowPasswordFields()) {\n <div class=\"tw-mb-6\">\n <!-- Password Fields Header for Edit Mode -->\n @if (isEditMode()) {\n <div class=\"tw-flex tw-items-center tw-justify-between tw-mb-3\">\n <h6 class=\"tw-text-sm tw-font-semibold tw-text-gray-800\">Update Password</h6>\n <button type=\"button\"\n class=\"tw-px-3 tw-py-1 tw-bg-gray-100 tw-text-gray-600 tw-border tw-border-gray-300 tw-rounded-md tw-text-xs tw-font-medium hover:tw-bg-gray-200 tw-transition-colors\"\n (click)=\"cancelPasswordUpdate()\">\n Cancel Password Update\n </button>\n </div>\n }\n\n <div class=\"tw-grid tw-grid-cols-1 lg:tw-grid-cols-2 md:tw-grid-cols-1 tw-gap-6\">\n <cide-ele-input id=\"user_password\" [label]=\"getPasswordFieldLabel()\" formControlName=\"user_password\"\n type=\"password\" placeholder=\"Enter secure password (min 8 characters)\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_confirm_password\" [label]=\"getPasswordConfirmLabel()\"\n formControlName=\"user_confirm_password\" type=\"password\" placeholder=\"Confirm your password\" size=\"md\">\n </cide-ele-input>\n </div>\n </div>\n }\n\n <!-- Password Update Option for Edit Mode -->\n @if (isEditMode() && !shouldShowPasswordFields()) {\n <div class=\"tw-mb-6\">\n <div class=\"tw-p-4 tw-bg-blue-50 tw-border tw-border-blue-200 tw-rounded-lg\">\n <h6 class=\"tw-text-sm tw-font-semibold tw-text-blue-800 tw-mb-2\">Password Update</h6>\n <p class=\"tw-text-sm tw-text-blue-600 tw-mb-3\">Current password will be kept. Click below to change\n password.</p>\n\n @if (hasPasswordInput()) {\n <div\n class=\"tw-mb-3 tw-p-2 tw-bg-yellow-50 tw-border tw-border-yellow-200 tw-rounded tw-text-sm tw-text-yellow-700\">\n <cide-ele-icon variant=\"yellow\" size=\"xs\" class=\"tw-mr-1\">warning</cide-ele-icon>\n Password fields contain text. Click \"Change Password\" to manage existing input.\n </div>\n }\n\n <button type=\"button\"\n class=\"tw-px-4 tw-py-2 tw-bg-blue-100 tw-text-blue-700 tw-border tw-border-blue-300 tw-rounded-md tw-text-sm tw-font-medium hover:tw-bg-blue-200 tw-transition-colors\"\n (click)=\"triggerPasswordUpdate()\">\n @if (hasPasswordInput()) {\n Manage Password Fields\n } @else {\n Change Password\n }\n </button>\n </div>\n </div>\n }\n\n <!-- Password Options -->\n <div class=\"tw-grid tw-grid-cols-1 tw-gap-6 tw-mb-6\">\n <div class=\"tw-p-4 tw-bg-yellow-50 tw-border tw-border-yellow-100 tw-rounded-lg\">\n <label\n class=\"tw-flex tw-flex-col tw-gap-2 tw-cursor-pointer tw-py-2 tw-bg-transparent tw-border-none tw-rounded-none tw-transition-all tw-duration-200\">\n <cide-ele-input type=\"checkbox\" label=\"Force Password Change on Login\"\n formControlName=\"user_passwordchangeonlogin\" class=\"tw-h-5 tw-accent-yellow-500 tw-rounded tw-mb-1\" />\n <span class=\"tw-text-sm tw-text-gray-600 tw-mt-1 tw-leading-relaxed\">User will be required to change\n password on next login</span>\n </label>\n </div>\n </div>\n\n <!-- Photo Upload -->\n <div class=\"tw-grid tw-grid-cols-1 tw-gap-6 tw-mb-6\">\n <div class=\"tw-bg-gray-50 tw-border tw-border-gray-200 tw-rounded-lg tw-p-4\">\n <h6 class=\"tw-text-sm tw-font-semibold tw-text-gray-800 tw-mb-3\">Profile Photo</h6>\n <div class=\"tw-flex tw-flex-col tw-items-center tw-gap-4\">\n <cide-ele-file-input id=\"user_photo_upload\" formControlName=\"user_photo_id_cyfm\" accept=\"image/*\"\n [showPreview]=\"true\" [previewBoxMode]=\"true\" previewWidth=\"150px\" previewHeight=\"150px\"\n placeholderText=\"Click to upload photo\" placeholderIcon=\"\uD83D\uDC64\">\n </cide-ele-file-input>\n <div class=\"tw-text-xs tw-text-gray-500 tw-text-center tw-max-w-sm\">\n Supported formats: JPG, PNG, GIF. Maximum size: 2MB. Recommended size: 150x150px for best results.\n </div>\n </div>\n </div>\n </div>\n </div>\n }\n\n @case ('roles') {\n <!-- Entity, Roles & Permissions Mapping Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n\n\n\n <!-- Important Note -->\n <div class=\"tw-bg-amber-50 tw-border tw-border-amber-200 tw-rounded-lg tw-p-4 tw-mb-6\">\n <div class=\"tw-flex tw-items-start tw-gap-3\">\n <cide-ele-icon variant=\"amber\" size=\"lg\">info</cide-ele-icon>\n <div class=\"tw-flex-1\">\n <h4 class=\"tw-text-sm tw-font-semibold tw-text-amber-800 tw-mb-1\">Entity-Role Based Access</h4>\n <p class=\"tw-text-sm tw-text-amber-700 tw-mb-2\">User access is completely managed through entity-role\n mappings below. At least one entity mapping is required for user access.</p>\n @if (hasDefaultEntity()) {\n <div class=\"tw-flex tw-items-center tw-gap-2 tw-mt-2 tw-p-2 tw-bg-amber-100 tw-rounded\">\n <cide-ele-icon variant=\"amber\" size=\"sm\">star</cide-ele-icon>\n <span class=\"tw-text-sm tw-text-amber-800\">\n <strong>Default Entity:</strong> {{ getDefaultEntityName() }}\n </span>\n </div>\n } @else {\n <div class=\"tw-text-sm tw-text-amber-600 tw-mt-2 tw-italic\">\n \u26A0\uFE0F No default entity selected. Please set one entity as default.\n </div>\n }\n </div>\n </div>\n </div>\n\n <!-- Entity-Role Mapping Section -->\n <div class=\"tw-bg-blue-50 tw-border tw-border-blue-200 tw-rounded-lg tw-p-6 tw-mb-6\">\n <div class=\"tw-flex tw-text-center tw-justify-between tw-items-center tw-mb-4\">\n <div>\n <h4 class=\"tw-text-sm tw-text-left tw-font-semibold tw-text-blue-900 tw-mb-1\">Entity-Role Mapping</h4>\n <p class=\"tw-text-sm tw-text-blue-700\">Map user to entities with specific roles and permissions</p>\n </div>\n <div class=\"tw-flex tw-flex-col tw-items-end\">\n <button cideEleButton variant=\"primary\" size=\"md\" type=\"button\" (click)=\"addEntityMapping()\" leftIcon=\"add\"\n [disabled]=\"isAllEntitiesMapped()\">\n Add Entity Mapping\n </button>\n \n @if (isAllEntitiesMapped()) {\n <div class=\"tw-mt-2 tw-p-2 tw-bg-blue-50 tw-border tw-border-blue-200 tw-rounded-md tw-max-w-xs\">\n <p class=\"tw-text-xs tw-text-blue-700\">\n <cide-ele-icon variant=\"info\" size=\"xs\" class=\"tw-mr-1\">info</cide-ele-icon>\n All available entities are already mapped.\n </p>\n </div>\n }\n </div>\n </div>\n\n <div formArrayName=\"core_entity_mapping\">\n @for (mapping of entityMappings(); track $index; let i = $index) {\n <div class=\"tw-bg-white tw-border tw-border-blue-200 tw-rounded-xl tw-mb-6 tw-overflow-hidden tw-shadow-sm\"\n [formGroupName]=\"i\">\n <div\n class=\"tw-bg-gradient-to-r tw-from-blue-50 tw-to-blue-100 tw-px-6 tw-py-3 tw-flex tw-justify-between tw-items-center tw-border-b tw-border-blue-200\">\n <div class=\"tw-flex tw-items-center tw-gap-2\">\n <h5 class=\"tw-m-0 tw-text-blue-800 tw-text-sm tw-font-semibold\">Entity Mapping {{ i + 1 }}</h5>\n @if (mapping.syenm_isdefault) {\n <span\n class=\"tw-inline-flex tw-items-center tw-px-2 tw-py-1 tw-rounded-full tw-text-xs tw-font-medium tw-bg-green-100 tw-text-green-800\">\n <cide-ele-icon variant=\"green\" size=\"xs\" class=\"tw-mr-1\">star</cide-ele-icon>\n Default\n </span>\n }\n </div>\n <button cideEleButton variant=\"danger\" size=\"sm\" type=\"button\" (click)=\"removeEntityMapping(i)\"\n leftIcon=\"delete\">\n Remove\n </button>\n </div>\n\n <div class=\"tw-p-6\">\n <!-- Entity and Role Selection -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <div>\n <cide-ele-select label=\"Entity *\" [options]=\"getFilteredEntityOptions(i)\" formControlName=\"syenm_entity_id_syen\"\n valueKey=\"_id\" labelKey=\"syen_name\" placeholder=\"Select entity\" size=\"md\"\n (change)=\"onEntityChange(i, $event)\">\n </cide-ele-select>\n \n @if (isAllEntitiesSelected(i)) {\n <div class=\"tw-mt-2 tw-p-2 tw-bg-yellow-50 tw-border tw-border-yellow-200 tw-rounded-md\">\n <p class=\"tw-text-xs tw-text-yellow-700\">\n <cide-ele-icon variant=\"warning\" size=\"xs\" class=\"tw-mr-1\">info</cide-ele-icon>\n All entities are already mapped. Remove another mapping to add this one.\n </p>\n </div>\n }\n </div>\n\n <cide-ele-select label=\"Role for this Entity\" [options]=\"getRoleOptionsForEntity(i)\"\n formControlName=\"syenm_role_id_syusrol\" placeholder=\"Select role for this entity\" size=\"md\">\n </cide-ele-select>\n </div>\n\n <!-- Entity-Specific Details -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-select label=\"Department for this Entity\" [options]=\"getDepartmentOptionsForEntity(i)\"\n formControlName=\"syenm_department_id_sydept\" (change)=\"onDepartmentChange($event)\" valueKey=\"_id\" labelKey=\"sydept_name\" placeholder=\"Select department\" size=\"md\">\n </cide-ele-select>\n\n <cide-ele-select label=\"Designation for this Entity\" [options]=\"getDesignationOptionsForEntity(i)\" valueKey=\"_id\" labelKey=\"sydsg_name\"\n formControlName=\"syenm_designation_id_sydsg\" placeholder=\"Select designation\" size=\"md\">\n </cide-ele-select>\n </div>\n\n <!-- Active Period for Entity Mapping -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input label=\"Active From *\" [id]=\"'syenm_activefrom['+i+']'\"\n formControlName=\"syenm_activefrom\" type=\"date\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input label=\"Active Until\" [id]=\"'syenm_activeupto['+i+']'\"\n formControlName=\"syenm_activeupto\" type=\"date\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <!-- Mapping Settings -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-3 tw-gap-6 tw-mb-6\">\n <div class=\"tw-p-3 tw-bg-green-50 tw-border tw-border-green-200 tw-rounded-lg\">\n <cide-ele-input type=\"checkbox\" label=\"Default Entity\" formControlName=\"syenm_isdefault\"\n (change)=\"onDefaultEntityChange(i, $event)\" class=\"tw-h-5 tw-accent-green-500\" />\n <span class=\"tw-text-xs tw-text-green-600 tw-block tw-mt-1\">Set as user's default entity (only one\n allowed)</span>\n </div>\n\n <div class=\"tw-p-3 tw-bg-blue-50 tw-border tw-border-blue-200 tw-rounded-lg\">\n <cide-ele-input type=\"checkbox\" label=\"Active Mapping\" formControlName=\"syenm_isactive\"\n class=\"tw-h-5 tw-accent-blue-500\" />\n <span class=\"tw-text-xs tw-text-blue-600 tw-block tw-mt-1\">Enable this entity mapping</span>\n </div>\n </div>\n\n <!-- Menu Rights Grid for this Entity-Role -->\n <div class=\"tw-border-t tw-border-gray-200 tw-pt-4\">\n <div class=\"tw-flex tw-justify-between tw-items-center tw-mb-4\">\n <h6 class=\"tw-text-sm tw-font-semibold tw-text-gray-800\">Menu Rights & Permissions</h6>\n <div class=\"tw-flex tw-gap-2\">\n <button cideEleButton variant=\"secondary\" size=\"sm\" type=\"button\" (click)=\"refreshMenuRights(i)\"\n leftIcon=\"refresh\">\n Refresh Rights\n </button>\n </div>\n </div>\n\n @if (getMenuRightsForMapping(i).length > 0) {\n <!-- Menu Rights Grid -->\n <div class=\"tw-overflow-x-auto tw-bg-white tw-border tw-border-gray-200 tw-rounded-lg\">\n <table class=\"tw-w-full tw-text-sm\">\n <thead class=\"tw-bg-gray-50 tw-border-b tw-border-gray-200\">\n <tr>\n <th class=\"tw-px-4 tw-py-3 tw-text-left tw-font-medium tw-text-gray-700\">Menu</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Role Rights</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Create</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Read</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Update</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Delete</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Exception</th>\n </tr>\n </thead>\n <tbody>\n @for (menuRight of getMenuRightsForMapping(i); track $index; let j = $index) {\n <tr class=\"tw-border-b tw-border-gray-100 hover:tw-bg-gray-50\">\n <td class=\"tw-px-4 tw-py-3 tw-font-medium tw-text-gray-900\">\n {{ menuRight.menu_name }}\n <div class=\"tw-text-xs tw-text-gray-500\">{{ menuRight.menu_code }}</div>\n </td>\n\n <!-- Role Rights Display -->\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n <div class=\"tw-flex tw-flex-wrap tw-justify-center tw-gap-1\">\n @for (right of menuRight.role_rights; track $index) {\n <span\n class=\"tw-inline-block tw-px-2 tw-py-1 tw-text-xs tw-bg-blue-100 tw-text-blue-800 tw-rounded\">\n {{ right }}\n </span>\n }\n </div>\n </td>\n\n <!-- Individual Permission Controls -->\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n <cide-ele-input type=\"checkbox\"\n [formControlName]=\"'core_entity_mapping.' + i + '.menu_rights.' + j + '.create'\"\n class=\"tw-h-4 tw-accent-green-500\" />\n </td>\n\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n <cide-ele-input type=\"checkbox\"\n [formControlName]=\"'core_entity_mapping.' + i + '.menu_rights.' + j + '.read'\"\n class=\"tw-h-4 tw-accent-blue-500\" />\n </td>\n\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n <cide-ele-input type=\"checkbox\"\n [formControlName]=\"'core_entity_mapping.' + i + '.menu_rights.' + j + '.update'\"\n class=\"tw-h-4 tw-accent-yellow-500\" />\n </td>\n\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n <cide-ele-input type=\"checkbox\"\n [formControlName]=\"'core_entity_mapping.' + i + '.menu_rights.' + j + '.delete'\"\n class=\"tw-h-4 tw-accent-red-500\" />\n </td>\n\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n @if (hasExceptionForMenu(i, menuRight.menu_id)) {\n <span\n class=\"tw-inline-block tw-px-2 tw-py-1 tw-text-xs tw-bg-yellow-100 tw-text-yellow-800 tw-rounded\">\n Override\n </span>\n } @else {\n <span class=\"tw-text-xs tw-text-gray-400\">Default</span>\n }\n </td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <!-- Legend -->\n <div class=\"tw-mt-4 tw-p-3 tw-bg-gray-50 tw-rounded-lg\">\n <h6 class=\"tw-text-xs tw-font-semibold tw-text-gray-700 tw-mb-2\">Legend:</h6>\n <div class=\"tw-grid tw-grid-cols-2 md:tw-grid-cols-4 tw-gap-3 tw-text-xs tw-text-gray-600\">\n <div><span class=\"tw-w-3 tw-h-3 tw-bg-blue-100 tw-inline-block tw-rounded tw-mr-2\"></span>Role\n Rights: Inherited from role</div>\n <div><span\n class=\"tw-w-3 tw-h-3 tw-bg-yellow-100 tw-inline-block tw-rounded tw-mr-2\"></span>Override:\n User-specific exception</div>\n <div><span\n class=\"tw-w-3 tw-h-3 tw-bg-green-100 tw-inline-block tw-rounded tw-mr-2\"></span>Enabled:\n Permission granted</div>\n <div><span\n class=\"tw-w-3 tw-h-3 tw-bg-gray-100 tw-inline-block tw-rounded tw-mr-2\"></span>Disabled:\n Permission restricted</div>\n </div>\n </div>\n\n } @else {\n <div class=\"tw-text-center tw-py-8 tw-bg-gray-50 tw-border tw-border-gray-200 tw-rounded-lg\">\n <div class=\"tw-text-gray-400 tw-mb-3\">\n <cide-ele-icon variant=\"gray\" size=\"lg\">menu</cide-ele-icon>\n </div>\n <h6 class=\"tw-text-sm tw-font-medium tw-text-gray-600 tw-mb-2\">No Menu Rights Available</h6>\n <p class=\"tw-text-xs tw-text-gray-500 tw-mb-3 tw-text-center\">Select both entity and role to load\n menu rights for this mapping.</p>\n @if (mapping.syenm_entity_id_syen?._id && mapping.syenm_role_id_syusrol) {\n <button cideEleButton variant=\"primary\" size=\"sm\" type=\"button\" (click)=\"loadMenuRights(i)\"\n leftIcon=\"refresh\">\n Load Menu Rights\n </button>\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n </div>\n\n @if (entityMappings().length === 0) {\n <div class=\"tw-text-center tw-py-8 tw-bg-white tw-border tw-border-blue-200 tw-rounded-lg\">\n <div class=\"tw-text-blue-400 tw-mb-3\">\n <cide-ele-icon variant=\"blue\" size=\"lg\">business</cide-ele-icon>\n </div>\n <h4 class=\"tw-text-sm tw-font-medium tw-text-blue-800 tw-mb-2\">No Entity Mappings</h4>\n <p class=\"tw-text-blue-600 tw-mb-4 tw-text-center\">Add entity mappings to assign specific roles and\n permissions for different entities.</p>\n <button class=\"tw-mx-auto\" cideEleButton variant=\"primary\" size=\"md\" type=\"button\"\n (click)=\"addEntityMapping()\" leftIcon=\"add\">\n Add First Entity Mapping\n </button>\n </div>\n }\n </div>\n\n\n </div>\n }\n\n @case ('addresses') {\n <!-- Contact Addresses Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n <div class=\"tw-flex tw-justify-end\">\n <div class=\"tw-flex tw-justify-between tw-items-end tw-mb-2 tw-gap-4\">\n <button cideEleButton variant=\"primary\" size=\"md\" type=\"button\" (click)=\"addContactAddress()\"\n leftIcon=\"add\">\n Add New Address\n </button>\n </div>\n </div>\n\n <div formArrayName=\"core_user_contact_addresses\">\n @for (address of contactAddresses(); track $index; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"tw-bg-white tw-border tw-border-gray-200 tw-rounded-xl tw-mb-8 tw-overflow-hidden tw-transition-all tw-duration-300 hover:tw-shadow-lg tw-shadow-sm\">\n <div\n class=\"tw-bg-gradient-to-r tw-from-gray-50 tw-to-gray-100 tw-px-6 tw-py-1 tw-flex tw-justify-between tw-items-center tw-border-b tw-border-gray-200\">\n <h4 class=\"tw-m-0 tw-text-gray-700 tw-text-sm tw-font-semibold tw-tracking-tight\">Address {{ i + 1 }}</h4>\n <button cideEleButton variant=\"danger\" size=\"sm\" type=\"button\" (click)=\"removeContactAddress(i)\"\n leftIcon=\"delete\">\n Remove\n </button>\n </div>\n <div class=\"tw-p-6\">\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-select label=\"Address Type\" [options]=\"addressTypeOptions()\"\n formControlName=\"sycad_address_type_id_sygms\" placeholder=\"Select address type\" size=\"md\"\n valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n\n <cide-ele-input label=\"Contact Person Name\" formControlName=\"sycad_contact_person_name\"\n placeholder=\"Enter contact person name\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 tw-mb-6\">\n <cide-ele-textarea label=\"Complete Address\" formControlName=\"sycad_contact_address\"\n placeholder=\"Enter complete address with area, city, and landmarks\" [rows]=\"3\" size=\"md\">\n </cide-ele-textarea>\n </div>\n\n <!-- Postal Code & City -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-select \n label=\"Postal Code\"\n [options]=\"addressPostalCodes()[i] || []\" \n formControlName=\"sycad_contact_pin_sypin\"\n placeholder=\"Select postal code\"\n [searchable]=\"true\"\n [loading]=\"addressPostalCodesLoading()[i] || false\"\n (searchChange)=\"onPostalCodeSearch($event, i)\"\n (change)=\"onPostalCodeSelection($event, i)\"\n size=\"md\">\n </cide-ele-select>\n \n <cide-ele-input \n label=\"City\" \n formControlName=\"sycad_contact_city_sypin\"\n placeholder=\"Enter city\"\n size=\"md\">\n </cide-ele-input>\n </div>\n \n <!-- State & Country -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input \n label=\"State\" \n formControlName=\"sycad_contact_state_sypin\"\n placeholder=\"Enter state\"\n size=\"md\">\n </cide-ele-input>\n\n <cide-ele-select \n label=\"Country\" \n [options]=\"addressCountries()[i] || []\" \n formControlName=\"sycad_contact_country_syctr\"\n placeholder=\"Select country\"\n valueKey=\"_id\"\n labelKey=\"syctr_country_iso_name\"\n [searchable]=\"true\"\n (searchChange)=\"onCountrySearch($event, i)\"\n [loading]=\"addressCountriesLoading()[i] || false\"\n size=\"md\">\n </cide-ele-select>\n </div>\n\n <!-- Phone Numbers -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input \n label=\"Primary Phone\" \n formControlName=\"sycad_contact_phone\"\n type=\"tel\"\n placeholder=\"Enter primary phone number\"\n size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input \n label=\"Alternate Phone\" \n formControlName=\"sycad_contact_phone_alt\"\n type=\"tel\"\n placeholder=\"Enter alternate phone number\"\n size=\"md\">\n </cide-ele-input>\n </div>\n\n <!-- Fax & Email -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input \n label=\"Fax Number\" \n formControlName=\"sycad_contact_fax\"\n placeholder=\"Enter fax number\"\n size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input \n label=\"Primary Email\" \n formControlName=\"sycad_contact_email\"\n type=\"email\"\n placeholder=\"Enter primary email address\"\n size=\"md\">\n </cide-ele-input>\n </div>\n\n <!-- Alternate Email -->\n <div class=\"tw-grid tw-grid-cols-1 tw-mb-6\">\n <cide-ele-input \n label=\"Alternate Email\" \n formControlName=\"sycad_contact_email_alt\"\n type=\"email\"\n placeholder=\"Enter alternate email address\"\n size=\"md\">\n </cide-ele-input>\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n }\n\n @case ('documents') {\n <!-- Documents Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n <div class=\"tw-flex tw-justify-end tw-items-end tw-mb-2 tw-gap-4\">\n <button cideEleButton variant=\"primary\" size=\"md\" type=\"button\" (click)=\"addDocument()\" leftIcon=\"add\">\n Add Document\n </button>\n </div>\n\n @for (doc of documents(); track $index; let i = $index) {\n <div\n class=\"tw-bg-white tw-border tw-border-gray-200 tw-rounded-xl tw-mb-8 tw-overflow-hidden tw-transition-all tw-duration-300 hover:tw-shadow-lg tw-shadow-sm\">\n <div\n class=\"tw-bg-gradient-to-r tw-from-gray-50 tw-to-gray-100 tw-px-6 tw-py-1 tw-flex tw-justify-between tw-items-center tw-border-b tw-border-gray-200\">\n <h4 class=\"tw-m-0 tw-text-gray-700 tw-text-sm tw-font-semibold tw-tracking-tight\">Document {{ i + 1 }}</h4>\n <button cideEleButton variant=\"danger\" size=\"sm\" type=\"button\" (click)=\"removeDocument(i)\"\n leftIcon=\"delete\">\n Remove\n </button>\n </div>\n <div class=\"tw-p-6\">\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-select label=\"Document Type\" [options]=\"documentTypeOptions()\"\n [formControlName]=\"'documents.' + i + '.syusd_document_type_id_sygms'\"\n placeholder=\"Select document type\" size=\"md\" valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n\n <cide-ele-input label=\"Document Number\" [formControlName]=\"'documents.' + i + '.syusd_doc_number'\"\n placeholder=\"Enter document number\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input label=\"Name as per Document\"\n [formControlName]=\"'documents.' + i + '.syusd_doc_name_as_per_doc'\"\n placeholder=\"Enter name exactly as shown on document\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-select label=\"Photo Group\" [options]=\"photoGroupOptions()\"\n [formControlName]=\"'documents.' + i + '.syusd_photo_group_id_cyfm'\"\n placeholder=\"Select photo group\" size=\"md\" valueKey=\"_id\" labelKey=\"cyfm_name\">\n </cide-ele-select>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input label=\"Issue Date\" [formControlName]=\"'documents.' + i + '.syusd_doc_issue_date'\"\n [id]=\"'syusd_doc_issue_date['+i+']'\" type=\"date\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input label=\"Expiry Date\" [formControlName]=\"'documents.' + i + '.syusd_doc_expiry_date'\"\n [id]=\"'syusd_doc_expiry_date['+i+']'\" type=\"date\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6\">\n <cide-ele-select label=\"Document Verification Status\" [options]=\"documentVerificationStatusOptions()\"\n [formControlName]=\"'documents.' + i + '.syusd_doc_verification_status_id_sygms'\"\n placeholder=\"Select verification status\" size=\"md\" valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n\n <cide-ele-select label=\"Document KYC Status\" [options]=\"documentKycStatusOptions()\"\n [formControlName]=\"'documents.' + i + '.syusd_doc_kyc_status_id_sygms'\"\n placeholder=\"Select KYC status\" size=\"md\" valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n </div>\n </div>\n </div>\n }\n </div>\n }\n\n @case ('family') {\n <!-- Family Details Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n <div class=\"tw-flex tw-justify-end tw-items-end tw-mb-2 tw-gap-4\">\n <button cideEleButton variant=\"primary\" size=\"md\" type=\"button\" (click)=\"addFamilyDetail()\" leftIcon=\"add\">\n Add Family Member\n </button>\n </div>\n\n @for (family of familyDetails(); track $index; let i = $index) {\n <div\n class=\"tw-bg-white tw-border tw-border-gray-200 tw-rounded-xl tw-mb-8 tw-overflow-hidden tw-transition-all tw-duration-300 hover:tw-shadow-lg tw-shadow-sm\">\n <div\n class=\"tw-bg-gradient-to-r tw-from-gray-50 tw-to-gray-100 tw-px-6 tw-py-1 tw-flex tw-justify-between tw-items-center tw-border-b tw-border-gray-200\">\n <h4 class=\"tw-m-0 tw-text-gray-700 tw-text-sm tw-font-semibold tw-tracking-tight\">Family Member {{ i + 1 }}\n </h4>\n <button cideEleButton variant=\"danger\" size=\"sm\" type=\"button\" (click)=\"removeFamilyDetail(i)\"\n leftIcon=\"delete\">\n Remove\n </button>\n </div>\n <div class=\"tw-p-6\">\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input label=\"Family Member Name\"\n [formControlName]=\"'family_details.' + i + '.syfdl_family_member_name'\"\n placeholder=\"Enter family member full name\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-select label=\"Relationship\" [options]=\"relationshipOptions()\"\n [formControlName]=\"'family_details.' + i + '.syfdl_relationship_id_sygms'\"\n placeholder=\"Select relationship\" size=\"md\" valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input label=\"Date of Birth\"\n [formControlName]=\"'family_details.' + i + '.syfdl_family_member_dob'\" type=\"date\" size=\"md\"\n [id]=\"'syfdl_family_member_dob['+i+']'\">\n </cide-ele-input>\n\n <cide-ele-select label=\"Blood Group\" [options]=\"bloodGroupOptions()\"\n [formControlName]=\"'family_details.' + i + '.syfdl_blood_group_sygms'\"\n placeholder=\"Select blood group\" size=\"md\" valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6\">\n <cide-ele-input label=\"Contact Email\" [formControlName]=\"'family_details.' + i + '.syfdl_contact_email_id'\"\n type=\"email\" placeholder=\"Enter contact email\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input label=\"Contact Number\" [formControlName]=\"'family_details.' + i + '.syfdl_contact_number'\"\n type=\"tel\" placeholder=\"Enter contact number\" size=\"md\">\n </cide-ele-input>\n </div>\n </div>\n </div>\n }\n </div>\n }\n }\n </div>\n\n <!-- Form Actions -->\n <div\n class=\"tw-flex tw-justify-end tw-gap-4 tw-py-2 tw-bg-white tw-border-t tw-border-gray-200 tw-sticky tw-bottom-0 tw-z-10\">\n <button cideEleButton type=\"button\" variant=\"secondary\" (click)=\"resetForm()\" leftIcon=\"refresh\"\n [disabled]=\"loading()\">\n Reset Form\n </button>\n\n <button cideEleButton type=\"submit\" variant=\"primary\" [disabled]=\"loading() || userMasterForm.invalid\"\n [loading]=\"loading()\" leftIcon=\"save\">\n Save User Master\n </button>\n </div>\n </form>\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$2.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1$2.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "component", type: CideInputComponent, selector: "cide-ele-input", inputs: ["fill", "label", "labelHide", "disabled", "clearInput", "labelPlacement", "labelDir", "placeholder", "leadingIcon", "trailingIcon", "helperText", "helperTextCollapse", "hideHelperAndErrorText", "errorText", "maxlength", "minlength", "required", "autocapitalize", "autocomplete", "type", "width", "id", "ngModel", "option", "min", "max", "size"], outputs: ["ngModelChange"] }, { kind: "component", type: CideSelectComponent, selector: "cide-ele-select", inputs: ["label", "labelHide", "placeholder", "helperText", "errorText", "required", "disabled", "id", "ngModel", "size", "fill", "labelPlacement", "labelDir", "leadingIcon", "trailingIcon", "clearInput", "options", "multiple", "searchable", "showSearchInput", "loading", "valueKey", "labelKey"], outputs: ["ngModelChange", "change", "searchChange"] }, { kind: "component", type: CideTextareaComponent, selector: "cide-ele-textarea", inputs: ["label", "labelHide", "placeholder", "helperText", "errorText", "required", "disabled", "minlength", "maxlength", "rows", "id", "ngModel", "size", "fill", "labelPlacement", "labelDir", "leadingIcon", "trailingIcon", "clearInput"], outputs: ["ngModelChange"] }, { kind: "component", type: CideEleButtonComponent, selector: "button[cideEleButton], a[cideEleButton]", inputs: ["label", "variant", "size", "type", "shape", "elevation", "disabled", "id", "loading", "fullWidth", "leftIcon", "rightIcon", "customClass", "tooltip", "ariaLabel", "testId", "routerLink", "routerExtras", "preventDoubleClick", "animated"], outputs: ["btnClick", "doubleClick"] }, { kind: "component", type: CideEleTabComponent, selector: "cide-ele-tab", inputs: ["tabs", "activeTabId", "size", "variant", "fullWidth", "disabled"], outputs: ["tabChange"] }, { kind: "component", type: CideEleFileInputComponent, selector: "cide-ele-file-input", inputs: ["label", "accept", "multiple", "disabled", "helperText", "errorText", "showPreview", "previewWidth", "previewHeight", "previewBoxMode", "placeholderText", "placeholderIcon"], outputs: ["fileChange"] }, { kind: "component", type: CideIconComponent, selector: "cide-ele-icon", inputs: ["size", "type", "toolTip"] }] });
|
|
12081
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: CideCoreUserCreateComponent, isStandalone: true, selector: "cide-core-user-create", ngImport: i0, template: "<!-- \n ENTERPRISE USER MASTER FORM\n \n Enterprise-Level Styling with Tailwind CSS\n Features: Responsive grids, proper typography, enhanced user experience\n-->\n\n<div class=\"tw-w-full tw-h-full tw-p-3\">\n <form class=\"tw-max-w-7xl tw-mx-auto tw-bg-transparent\" [formGroup]=\"userMasterForm\" [class.tw-opacity-60]=\"loading()\"\n (ngSubmit)=\"onSubmit()\">\n\n <!-- User Context Header -->\n <div\n class=\"tw-bg-gradient-to-r tw-from-blue-50 tw-to-indigo-50 tw-border tw-border-blue-200 tw-rounded-md tw-p-2 tw-mb-3 tw-shadow-sm\">\n <div class=\"tw-flex tw-items-center tw-justify-between tw-flex-wrap tw-gap-2\">\n <!-- User Basic Info Display -->\n <div class=\"tw-flex tw-items-center tw-gap-3 tw-flex-wrap\">\n <!-- Profile Photo Preview -->\n <div class=\"tw-flex tw-items-center tw-gap-2\">\n <div\n class=\"tw-w-8 tw-h-8 tw-rounded-full tw-bg-blue-100 tw-border tw-border-blue-200 tw-flex tw-items-center tw-justify-center tw-overflow-hidden\">\n @if (getUserPhoto()) {\n <img [src]=\"getUserPhoto()\" alt=\"Profile\" class=\"tw-w-full tw-h-full tw-object-cover\">\n } @else {\n <cide-ele-icon variant=\"blue\" size=\"xs\">person</cide-ele-icon>\n }\n </div>\n <div class=\"tw-flex tw-flex-col\">\n <span class=\"tw-text-xs tw-font-medium tw-text-blue-900\">\n {{ getUserFullName() || 'New User' }}\n </span>\n <span class=\"tw-text-xs tw-text-blue-600\">\n {{ getUserUsername() || 'Username not set' }}\n </span>\n </div>\n </div>\n\n <!-- Contact Info -->\n <div class=\"tw-flex tw-items-center tw-gap-3\">\n <div class=\"tw-flex tw-items-center tw-gap-1 tw-text-xs tw-text-gray-700\">\n <cide-ele-icon variant=\"gray\" size=\"xs\">email</cide-ele-icon>\n <span>{{ getUserEmail() || 'Email not set' }}</span>\n </div>\n <div class=\"tw-flex tw-items-center tw-gap-1 tw-text-xs tw-text-gray-700\">\n <cide-ele-icon variant=\"gray\" size=\"xs\">phone</cide-ele-icon>\n <span>{{ getUserMobile() || 'Mobile not set' }}</span>\n </div>\n </div>\n\n <!-- Active Status -->\n <div class=\"tw-flex tw-items-center tw-gap-1\">\n @if (getUserActiveStatus()) {\n <span\n class=\"tw-inline-flex tw-items-center tw-px-2 tw-py-1 tw-rounded tw-text-xs tw-font-medium tw-bg-green-100 tw-text-green-700\">\n <cide-ele-icon variant=\"green\" size=\"xs\" class=\"tw-mr-1\">check_circle</cide-ele-icon>\n Active\n </span>\n } @else {\n <span\n class=\"tw-inline-flex tw-items-center tw-px-2 tw-py-1 tw-rounded tw-text-xs tw-font-medium tw-bg-red-100 tw-text-red-700\">\n <cide-ele-icon variant=\"red\" size=\"xs\" class=\"tw-mr-1\">cancel</cide-ele-icon>\n Inactive\n </span>\n }\n </div>\n </div>\n\n <!-- Entity Info -->\n <div class=\"tw-flex tw-items-center tw-gap-2\">\n @if (hasDefaultEntity()) {\n <div class=\"tw-flex tw-items-center tw-gap-1 tw-text-xs tw-text-blue-700\">\n <cide-ele-icon variant=\"blue\" size=\"xs\">business</cide-ele-icon>\n <span class=\"tw-font-medium\">{{ getDefaultEntityName() }}</span>\n </div>\n } @else {\n <div class=\"tw-flex tw-items-center tw-gap-1 tw-text-xs tw-text-gray-500\">\n <cide-ele-icon variant=\"gray\" size=\"xs\">business</cide-ele-icon>\n <span class=\"tw-italic\">No entity</span>\n </div>\n }\n\n <span class=\"tw-text-xs tw-text-gray-600 tw-px-2 tw-py-1 tw-bg-gray-100 tw-rounded\">\n {{ getEntityMappingCount() }} mapping(s)\n </span>\n </div>\n </div>\n </div>\n\n <!-- Tab Navigation -->\n <div class=\"tw-p-0 tw-mb-2 tw-border-b tw-border-gray-200\">\n <cide-ele-tab [tabs]=\"userTabs()\" [activeTabId]=\"activeTab()\" size=\"md\" variant=\"default\"\n (tabChange)=\"onTabChange($event)\">\n </cide-ele-tab>\n </div>\n\n <!-- Tab Content -->\n <div class=\"tw-transition-opacity tw-duration-300\" [class.tw-opacity-60]=\"loading()\">\n @switch (activeTab()) {\n\n @case ('basic') {\n <!-- User Basic Information Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n\n <!-- Name Fields -->\n <div class=\"tw-grid tw-grid-cols-1 xl:tw-grid-cols-4 lg:tw-grid-cols-2 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input id=\"user_firstname\" label=\"First Name *\" formControlName=\"user_firstname\"\n placeholder=\"Enter first name\" [maxlength]=\"20\" size=\"md\" (ngModelChange)=\"onNameFieldChange()\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_middlename\" label=\"Middle Name\" formControlName=\"user_middlename\"\n placeholder=\"Enter middle name\" [maxlength]=\"20\" size=\"md\" (ngModelChange)=\"onNameFieldChange()\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_lastname\" label=\"Last Name *\" formControlName=\"user_lastname\"\n placeholder=\"Enter last name\" [maxlength]=\"20\" size=\"md\" (ngModelChange)=\"onNameFieldChange()\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_fullname\" label=\"Full Name * (Auto-generated)\" formControlName=\"user_fullname\"\n placeholder=\"Auto-generated from name fields or enter manually\" [maxlength]=\"62\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <!-- Contact and Login Information -->\n <div class=\"tw-grid tw-grid-cols-1 xl:tw-grid-cols-3 lg:tw-grid-cols-2 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input id=\"user_username\" label=\"Username *\" formControlName=\"user_username\"\n placeholder=\"Enter unique username\" [maxlength]=\"20\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_emailid\" label=\"Email ID *\" formControlName=\"user_emailid\" type=\"email\"\n placeholder=\"Enter valid email address\" [maxlength]=\"320\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_mobileno\" label=\"Mobile Number *\" formControlName=\"user_mobileno\" type=\"tel\"\n placeholder=\"Enter mobile number\" [maxlength]=\"15\" size=\"md\">\n </cide-ele-input>\n </div>\n\n\n\n <!-- Status Control -->\n <div class=\"tw-grid tw-grid-cols-1 tw-mb-4\">\n <div class=\"tw-p-4 tw-bg-blue-50 tw-border tw-border-blue-100 tw-rounded-lg\">\n <label\n class=\"tw-flex tw-flex-col tw-cursor-pointer tw-py-2 tw-bg-transparent tw-border-none tw-rounded-none tw-transition-all tw-duration-200 hover:tw-bg-blue-75\">\n <cide-ele-input type=\"checkbox\" label=\"Active User Status\" formControlName=\"user_isactive\"\n class=\"tw-h-5 tw-accent-blue-500 tw-rounded tw-mb-1\" />\n <span class=\"tw-font-semibold tw-text-gray-700 tw-text-base\"></span>\n <span class=\"tw-text-sm tw-text-gray-600 tw-mt-1 tw-leading-relaxed\">Enable this user account for system\n access and operations</span>\n </label>\n </div>\n </div>\n </div>\n }\n\n @case ('auth') {\n <!-- Authentication Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n <!-- Password Fields -->\n @if (shouldShowPasswordFields()) {\n <div class=\"tw-mb-6\">\n <!-- Password Fields Header for Edit Mode -->\n @if (isEditMode()) {\n <div class=\"tw-flex tw-items-center tw-justify-between tw-mb-3\">\n <h6 class=\"tw-text-sm tw-font-semibold tw-text-gray-800\">Update Password</h6>\n <button type=\"button\"\n class=\"tw-px-3 tw-py-1 tw-bg-gray-100 tw-text-gray-600 tw-border tw-border-gray-300 tw-rounded-md tw-text-xs tw-font-medium hover:tw-bg-gray-200 tw-transition-colors\"\n (click)=\"cancelPasswordUpdate()\">\n Cancel Password Update\n </button>\n </div>\n }\n\n <div class=\"tw-grid tw-grid-cols-1 lg:tw-grid-cols-2 md:tw-grid-cols-1 tw-gap-6\">\n <cide-ele-input id=\"user_password\" [label]=\"getPasswordFieldLabel()\" formControlName=\"user_password\"\n type=\"password\" placeholder=\"Enter secure password (min 8 characters)\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_confirm_password\" [label]=\"getPasswordConfirmLabel()\"\n formControlName=\"user_confirm_password\" type=\"password\" placeholder=\"Confirm your password\" size=\"md\">\n </cide-ele-input>\n </div>\n </div>\n }\n\n <!-- Password Update Option for Edit Mode -->\n @if (isEditMode() && !shouldShowPasswordFields()) {\n <div class=\"tw-mb-6\">\n <div class=\"tw-p-4 tw-bg-blue-50 tw-border tw-border-blue-200 tw-rounded-lg\">\n <h6 class=\"tw-text-sm tw-font-semibold tw-text-blue-800 tw-mb-2\">Password Update</h6>\n <p class=\"tw-text-sm tw-text-blue-600 tw-mb-3\">Current password will be kept. Click below to change\n password.</p>\n\n @if (hasPasswordInput()) {\n <div\n class=\"tw-mb-3 tw-p-2 tw-bg-yellow-50 tw-border tw-border-yellow-200 tw-rounded tw-text-sm tw-text-yellow-700\">\n <cide-ele-icon variant=\"yellow\" size=\"xs\" class=\"tw-mr-1\">warning</cide-ele-icon>\n Password fields contain text. Click \"Change Password\" to manage existing input.\n </div>\n }\n\n <button type=\"button\"\n class=\"tw-px-4 tw-py-2 tw-bg-blue-100 tw-text-blue-700 tw-border tw-border-blue-300 tw-rounded-md tw-text-sm tw-font-medium hover:tw-bg-blue-200 tw-transition-colors\"\n (click)=\"triggerPasswordUpdate()\">\n @if (hasPasswordInput()) {\n Manage Password Fields\n } @else {\n Change Password\n }\n </button>\n </div>\n </div>\n }\n\n <!-- Password Options -->\n <div class=\"tw-grid tw-grid-cols-1 tw-gap-6 tw-mb-6\">\n <div class=\"tw-p-4 tw-bg-yellow-50 tw-border tw-border-yellow-100 tw-rounded-lg\">\n <label\n class=\"tw-flex tw-flex-col tw-gap-2 tw-cursor-pointer tw-py-2 tw-bg-transparent tw-border-none tw-rounded-none tw-transition-all tw-duration-200\">\n <cide-ele-input type=\"checkbox\" label=\"Force Password Change on Login\"\n formControlName=\"user_passwordchangeonlogin\" class=\"tw-h-5 tw-accent-yellow-500 tw-rounded tw-mb-1\" />\n <span class=\"tw-text-sm tw-text-gray-600 tw-mt-1 tw-leading-relaxed\">User will be required to change\n password on next login</span>\n </label>\n </div>\n </div>\n\n <!-- Photo Upload -->\n <div class=\"tw-grid tw-grid-cols-1 tw-gap-6 tw-mb-6\">\n <div class=\"tw-bg-gray-50 tw-border tw-border-gray-200 tw-rounded-lg tw-p-4\">\n <h6 class=\"tw-text-sm tw-font-semibold tw-text-gray-800 tw-mb-3\">Profile Photo</h6>\n <div class=\"tw-flex tw-flex-col tw-items-center tw-gap-4\">\n <cide-ele-file-input id=\"user_photo_upload\" formControlName=\"user_photo_id_cyfm\" accept=\"image/*\"\n [showPreview]=\"true\" [previewBoxMode]=\"true\" previewWidth=\"150px\" previewHeight=\"150px\"\n placeholderText=\"Click to upload photo\" placeholderIcon=\"\uD83D\uDC64\">\n </cide-ele-file-input>\n <div class=\"tw-text-xs tw-text-gray-500 tw-text-center tw-max-w-sm\">\n Supported formats: JPG, PNG, GIF. Maximum size: 2MB. Recommended size: 150x150px for best results.\n </div>\n </div>\n </div>\n </div>\n </div>\n }\n\n @case ('roles') {\n <!-- Entity, Roles & Permissions Mapping Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n\n\n\n <!-- Important Note -->\n <div class=\"tw-bg-amber-50 tw-border tw-border-amber-200 tw-rounded-lg tw-p-4 tw-mb-6\">\n <div class=\"tw-flex tw-items-start tw-gap-3\">\n <cide-ele-icon variant=\"amber\" size=\"lg\">info</cide-ele-icon>\n <div class=\"tw-flex-1\">\n <h4 class=\"tw-text-sm tw-font-semibold tw-text-amber-800 tw-mb-1\">Entity-Role Based Access</h4>\n <p class=\"tw-text-sm tw-text-amber-700 tw-mb-2\">User access is completely managed through entity-role\n mappings below. At least one entity mapping is required for user access.</p>\n @if (hasDefaultEntity()) {\n <div class=\"tw-flex tw-items-center tw-gap-2 tw-mt-2 tw-p-2 tw-bg-amber-100 tw-rounded\">\n <cide-ele-icon variant=\"amber\" size=\"sm\">star</cide-ele-icon>\n <span class=\"tw-text-sm tw-text-amber-800\">\n <strong>Default Entity:</strong> {{ getDefaultEntityName() }}\n </span>\n </div>\n } @else {\n <div class=\"tw-text-sm tw-text-amber-600 tw-mt-2 tw-italic\">\n \u26A0\uFE0F No default entity selected. Please set one entity as default.\n </div>\n }\n </div>\n </div>\n </div>\n\n <!-- Entity-Role Mapping Section -->\n <div class=\"tw-bg-blue-50 tw-border tw-border-blue-200 tw-rounded-lg tw-p-6 tw-mb-6\">\n <div class=\"tw-flex tw-text-center tw-justify-between tw-items-center tw-mb-4\">\n <div>\n <h4 class=\"tw-text-sm tw-text-left tw-font-semibold tw-text-blue-900 tw-mb-1\">Entity-Role Mapping</h4>\n <p class=\"tw-text-sm tw-text-blue-700\">Map user to entities with specific roles and permissions</p>\n </div>\n <div class=\"tw-flex tw-flex-col tw-items-end\">\n <button cideEleButton variant=\"primary\" size=\"md\" type=\"button\" (click)=\"addEntityMapping()\" leftIcon=\"add\"\n [disabled]=\"isAllEntitiesMapped()\">\n Add Entity Mapping\n </button>\n \n @if (isAllEntitiesMapped()) {\n <div class=\"tw-mt-2 tw-p-2 tw-bg-blue-50 tw-border tw-border-blue-200 tw-rounded-md tw-max-w-xs\">\n <p class=\"tw-text-xs tw-text-blue-700\">\n <cide-ele-icon variant=\"info\" size=\"xs\" class=\"tw-mr-1\">info</cide-ele-icon>\n All available entities are already mapped.\n </p>\n </div>\n }\n </div>\n </div>\n\n <div formArrayName=\"core_entity_mapping\">\n @for (mapping of entityMappings(); track $index; let i = $index) {\n <div class=\"tw-bg-white tw-border tw-border-blue-200 tw-rounded-xl tw-mb-6 tw-overflow-hidden tw-shadow-sm\"\n [formGroupName]=\"i\">\n <div\n class=\"tw-bg-gradient-to-r tw-from-blue-50 tw-to-blue-100 tw-px-6 tw-py-3 tw-flex tw-justify-between tw-items-center tw-border-b tw-border-blue-200\">\n <div class=\"tw-flex tw-items-center tw-gap-2\">\n <h5 class=\"tw-m-0 tw-text-blue-800 tw-text-sm tw-font-semibold\">Entity Mapping {{ i + 1 }}</h5>\n @if (mapping.syenm_isdefault) {\n <span\n class=\"tw-inline-flex tw-items-center tw-px-2 tw-py-1 tw-rounded-full tw-text-xs tw-font-medium tw-bg-green-100 tw-text-green-800\">\n <cide-ele-icon variant=\"green\" size=\"xs\" class=\"tw-mr-1\">star</cide-ele-icon>\n Default\n </span>\n }\n </div>\n <button cideEleButton variant=\"danger\" size=\"sm\" type=\"button\" (click)=\"removeEntityMapping(i)\"\n leftIcon=\"delete\">\n Remove\n </button>\n </div>\n\n <div class=\"tw-p-6\">\n <!-- Entity and Role Selection -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <div>\n <cide-ele-select label=\"Entity *\" [options]=\"getFilteredEntityOptions(i)\" formControlName=\"syenm_entity_id_syen\"\n valueKey=\"_id\" labelKey=\"syen_name\" placeholder=\"Select entity\" size=\"md\"\n (change)=\"onEntityChange(i, $event)\">\n </cide-ele-select>\n \n @if (isAllEntitiesSelected(i)) {\n <div class=\"tw-mt-2 tw-p-2 tw-bg-yellow-50 tw-border tw-border-yellow-200 tw-rounded-md\">\n <p class=\"tw-text-xs tw-text-yellow-700\">\n <cide-ele-icon variant=\"warning\" size=\"xs\" class=\"tw-mr-1\">info</cide-ele-icon>\n All entities are already mapped. Remove another mapping to add this one.\n </p>\n </div>\n }\n </div>\n\n <cide-ele-select label=\"Role for this Entity\" [options]=\"getRoleOptionsForEntity(i)\"\n formControlName=\"syenm_role_id_syusrol\" placeholder=\"Select role for this entity\" size=\"md\">\n </cide-ele-select>\n </div>\n\n <!-- Entity-Specific Details -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-select label=\"Department for this Entity\" [options]=\"getDepartmentOptionsForEntity(i)\"\n formControlName=\"syenm_department_id_sydept\" (change)=\"onDepartmentChange($event)\" valueKey=\"_id\" labelKey=\"sydept_name\" placeholder=\"Select department\" size=\"md\">\n </cide-ele-select>\n\n <cide-ele-select label=\"Designation for this Entity\" [options]=\"getDesignationOptionsForEntity(i)\" valueKey=\"_id\" labelKey=\"sydsg_name\"\n formControlName=\"syenm_designation_id_sydsg\" placeholder=\"Select designation\" size=\"md\">\n </cide-ele-select>\n </div>\n\n <!-- Active Period for Entity Mapping -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input label=\"Active From *\" [id]=\"'syenm_activefrom['+i+']'\"\n formControlName=\"syenm_activefrom\" type=\"date\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input label=\"Active Until\" [id]=\"'syenm_activeupto['+i+']'\"\n formControlName=\"syenm_activeupto\" type=\"date\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <!-- Mapping Settings -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-3 tw-gap-6 tw-mb-6\">\n <div class=\"tw-p-3 tw-bg-green-50 tw-border tw-border-green-200 tw-rounded-lg\">\n <cide-ele-input type=\"checkbox\" label=\"Default Entity\" formControlName=\"syenm_isdefault\"\n (change)=\"onDefaultEntityChange(i, $event)\" class=\"tw-h-5 tw-accent-green-500\" />\n <span class=\"tw-text-xs tw-text-green-600 tw-block tw-mt-1\">Set as user's default entity (only one\n allowed)</span>\n </div>\n\n <div class=\"tw-p-3 tw-bg-blue-50 tw-border tw-border-blue-200 tw-rounded-lg\">\n <cide-ele-input type=\"checkbox\" label=\"Active Mapping\" formControlName=\"syenm_isactive\"\n class=\"tw-h-5 tw-accent-blue-500\" />\n <span class=\"tw-text-xs tw-text-blue-600 tw-block tw-mt-1\">Enable this entity mapping</span>\n </div>\n </div>\n\n <!-- Menu Rights Grid for this Entity-Role -->\n <div class=\"tw-border-t tw-border-gray-200 tw-pt-4\">\n <div class=\"tw-flex tw-justify-between tw-items-center tw-mb-4\">\n <h6 class=\"tw-text-sm tw-font-semibold tw-text-gray-800\">Menu Rights & Permissions</h6>\n <div class=\"tw-flex tw-gap-2\">\n <button cideEleButton variant=\"secondary\" size=\"sm\" type=\"button\" (click)=\"refreshMenuRights(i)\"\n leftIcon=\"refresh\">\n Refresh Rights\n </button>\n </div>\n </div>\n\n @if (getMenuRightsForMapping(i).length > 0) {\n <!-- Menu Rights Grid -->\n <div class=\"tw-overflow-x-auto tw-bg-white tw-border tw-border-gray-200 tw-rounded-lg\">\n <table class=\"tw-w-full tw-text-sm\">\n <thead class=\"tw-bg-gray-50 tw-border-b tw-border-gray-200\">\n <tr>\n <th class=\"tw-px-4 tw-py-3 tw-text-left tw-font-medium tw-text-gray-700\">Menu</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Role Rights</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Create</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Read</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Update</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Delete</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Exception</th>\n </tr>\n </thead>\n <tbody>\n @for (menuRight of getMenuRightsForMapping(i); track $index; let j = $index) {\n <tr class=\"tw-border-b tw-border-gray-100 hover:tw-bg-gray-50\">\n <td class=\"tw-px-4 tw-py-3 tw-font-medium tw-text-gray-900\">\n {{ menuRight.menu_name }}\n <div class=\"tw-text-xs tw-text-gray-500\">{{ menuRight.menu_code }}</div>\n </td>\n\n <!-- Role Rights Display -->\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n <div class=\"tw-flex tw-flex-wrap tw-justify-center tw-gap-1\">\n @for (right of menuRight.role_rights; track $index) {\n <span\n class=\"tw-inline-block tw-px-2 tw-py-1 tw-text-xs tw-bg-blue-100 tw-text-blue-800 tw-rounded\">\n {{ right }}\n </span>\n }\n </div>\n </td>\n\n <!-- Individual Permission Controls -->\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n <cide-ele-input type=\"checkbox\"\n [formControlName]=\"'core_entity_mapping.' + i + '.menu_rights.' + j + '.create'\"\n class=\"tw-h-4 tw-accent-green-500\" />\n </td>\n\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n <cide-ele-input type=\"checkbox\"\n [formControlName]=\"'core_entity_mapping.' + i + '.menu_rights.' + j + '.read'\"\n class=\"tw-h-4 tw-accent-blue-500\" />\n </td>\n\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n <cide-ele-input type=\"checkbox\"\n [formControlName]=\"'core_entity_mapping.' + i + '.menu_rights.' + j + '.update'\"\n class=\"tw-h-4 tw-accent-yellow-500\" />\n </td>\n\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n <cide-ele-input type=\"checkbox\"\n [formControlName]=\"'core_entity_mapping.' + i + '.menu_rights.' + j + '.delete'\"\n class=\"tw-h-4 tw-accent-red-500\" />\n </td>\n\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n @if (hasExceptionForMenu(i, menuRight.menu_id)) {\n <span\n class=\"tw-inline-block tw-px-2 tw-py-1 tw-text-xs tw-bg-yellow-100 tw-text-yellow-800 tw-rounded\">\n Override\n </span>\n } @else {\n <span class=\"tw-text-xs tw-text-gray-400\">Default</span>\n }\n </td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <!-- Legend -->\n <div class=\"tw-mt-4 tw-p-3 tw-bg-gray-50 tw-rounded-lg\">\n <h6 class=\"tw-text-xs tw-font-semibold tw-text-gray-700 tw-mb-2\">Legend:</h6>\n <div class=\"tw-grid tw-grid-cols-2 md:tw-grid-cols-4 tw-gap-3 tw-text-xs tw-text-gray-600\">\n <div><span class=\"tw-w-3 tw-h-3 tw-bg-blue-100 tw-inline-block tw-rounded tw-mr-2\"></span>Role\n Rights: Inherited from role</div>\n <div><span\n class=\"tw-w-3 tw-h-3 tw-bg-yellow-100 tw-inline-block tw-rounded tw-mr-2\"></span>Override:\n User-specific exception</div>\n <div><span\n class=\"tw-w-3 tw-h-3 tw-bg-green-100 tw-inline-block tw-rounded tw-mr-2\"></span>Enabled:\n Permission granted</div>\n <div><span\n class=\"tw-w-3 tw-h-3 tw-bg-gray-100 tw-inline-block tw-rounded tw-mr-2\"></span>Disabled:\n Permission restricted</div>\n </div>\n </div>\n\n } @else {\n <div class=\"tw-text-center tw-py-8 tw-bg-gray-50 tw-border tw-border-gray-200 tw-rounded-lg\">\n <div class=\"tw-text-gray-400 tw-mb-3\">\n <cide-ele-icon variant=\"gray\" size=\"lg\">menu</cide-ele-icon>\n </div>\n <h6 class=\"tw-text-sm tw-font-medium tw-text-gray-600 tw-mb-2\">No Menu Rights Available</h6>\n <p class=\"tw-text-xs tw-text-gray-500 tw-mb-3 tw-text-center\">Select both entity and role to load\n menu rights for this mapping.</p>\n @if (mapping.syenm_entity_id_syen?._id && mapping.syenm_role_id_syusrol) {\n <button cideEleButton variant=\"primary\" size=\"sm\" type=\"button\" (click)=\"loadMenuRights(i)\"\n leftIcon=\"refresh\">\n Load Menu Rights\n </button>\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n </div>\n\n @if (entityMappings().length === 0) {\n <div class=\"tw-text-center tw-py-8 tw-bg-white tw-border tw-border-blue-200 tw-rounded-lg\">\n <div class=\"tw-text-blue-400 tw-mb-3\">\n <cide-ele-icon variant=\"blue\" size=\"lg\">business</cide-ele-icon>\n </div>\n <h4 class=\"tw-text-sm tw-font-medium tw-text-blue-800 tw-mb-2\">No Entity Mappings</h4>\n <p class=\"tw-text-blue-600 tw-mb-4 tw-text-center\">Add entity mappings to assign specific roles and\n permissions for different entities.</p>\n <button class=\"tw-mx-auto\" cideEleButton variant=\"primary\" size=\"md\" type=\"button\"\n (click)=\"addEntityMapping()\" leftIcon=\"add\">\n Add First Entity Mapping\n </button>\n </div>\n }\n </div>\n\n\n </div>\n }\n\n @case ('addresses') {\n <!-- Contact Addresses Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n <div class=\"tw-flex tw-justify-end\">\n <div class=\"tw-flex tw-justify-between tw-items-end tw-mb-2 tw-gap-4\">\n <button cideEleButton variant=\"primary\" size=\"md\" type=\"button\" (click)=\"addContactAddress()\"\n leftIcon=\"add\">\n Add New Address\n </button>\n </div>\n </div>\n\n <div formArrayName=\"core_user_contact_addresses\">\n @for (address of contactAddresses(); track $index; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"tw-bg-white tw-border tw-border-gray-200 tw-rounded-xl tw-mb-8 tw-overflow-hidden tw-transition-all tw-duration-300 hover:tw-shadow-lg tw-shadow-sm\">\n <div\n class=\"tw-bg-gradient-to-r tw-from-gray-50 tw-to-gray-100 tw-px-6 tw-py-1 tw-flex tw-justify-between tw-items-center tw-border-b tw-border-gray-200\">\n <h4 class=\"tw-m-0 tw-text-gray-700 tw-text-sm tw-font-semibold tw-tracking-tight\">Address {{ i + 1 }}</h4>\n <button cideEleButton variant=\"danger\" size=\"sm\" type=\"button\" (click)=\"removeContactAddress(i)\"\n leftIcon=\"delete\">\n Remove\n </button>\n </div>\n <div class=\"tw-p-6\">\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-select label=\"Address Type\" [options]=\"addressTypeOptions()\" id=\"sycad_address_type_id_sygms\"\n formControlName=\"sycad_address_type_id_sygms\" placeholder=\"Select address type\" size=\"md\"\n valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n\n <cide-ele-input label=\"Contact Person Name\" formControlName=\"sycad_contact_person_name\"\n placeholder=\"Enter contact person name\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 tw-mb-6\">\n <cide-ele-textarea label=\"Complete Address\" formControlName=\"sycad_contact_address\"\n placeholder=\"Enter complete address with area, city, and landmarks\" [rows]=\"3\" size=\"md\">\n </cide-ele-textarea>\n </div>\n\n <!-- Postal Code & City -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-select \n label=\"Postal Code\"\n [options]=\"addressPostalCodes()[i] || []\" \n formControlName=\"sycad_contact_pin_sypin\"\n placeholder=\"Select postal code\"\n [searchable]=\"true\"\n [loading]=\"addressPostalCodesLoading()[i] || false\"\n (searchChange)=\"onPostalCodeSearch($event, i)\"\n (change)=\"onPostalCodeSelection($event, i)\"\n size=\"md\">\n </cide-ele-select>\n \n <cide-ele-input \n label=\"City\" \n formControlName=\"sycad_contact_city_sypin\"\n placeholder=\"Enter city\"\n size=\"md\">\n </cide-ele-input>\n </div>\n \n <!-- State & Country -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input \n label=\"State\" \n formControlName=\"sycad_contact_state_sypin\"\n placeholder=\"Enter state\"\n size=\"md\">\n </cide-ele-input>\n\n <cide-ele-select \n label=\"Country\" \n [options]=\"addressCountries()[i] || []\" \n formControlName=\"sycad_contact_country_syctr\"\n placeholder=\"Select country\"\n valueKey=\"_id\"\n labelKey=\"syctr_country_iso_name\"\n [searchable]=\"true\"\n (searchChange)=\"onCountrySearch($event, i)\"\n [loading]=\"addressCountriesLoading()[i] || false\"\n size=\"md\">\n </cide-ele-select>\n </div>\n\n <!-- Phone Numbers -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input \n label=\"Primary Phone\" \n formControlName=\"sycad_contact_phone\"\n type=\"tel\"\n placeholder=\"Enter primary phone number\"\n size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input \n label=\"Alternate Phone\" \n formControlName=\"sycad_contact_phone_alt\"\n type=\"tel\"\n placeholder=\"Enter alternate phone number\"\n size=\"md\">\n </cide-ele-input>\n </div>\n\n <!-- Fax & Email -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input \n label=\"Fax Number\" \n formControlName=\"sycad_contact_fax\"\n placeholder=\"Enter fax number\"\n size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input \n label=\"Primary Email\" \n formControlName=\"sycad_contact_email\"\n type=\"email\"\n placeholder=\"Enter primary email address\"\n size=\"md\">\n </cide-ele-input>\n </div>\n\n <!-- Alternate Email -->\n <div class=\"tw-grid tw-grid-cols-1 tw-mb-6\">\n <cide-ele-input \n label=\"Alternate Email\" \n formControlName=\"sycad_contact_email_alt\"\n type=\"email\"\n placeholder=\"Enter alternate email address\"\n size=\"md\">\n </cide-ele-input>\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n }\n\n @case ('documents') {\n <!-- Documents Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n <div class=\"tw-flex tw-justify-end tw-items-end tw-mb-2 tw-gap-4\">\n <button cideEleButton variant=\"primary\" size=\"md\" type=\"button\" (click)=\"addDocument()\" leftIcon=\"add\">\n Add Document\n </button>\n </div>\n\n <div formArrayName=\"core_user_documents\">\n @for (doc of documents(); track $index; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"tw-bg-white tw-border tw-border-gray-200 tw-rounded-xl tw-mb-8 tw-overflow-hidden tw-transition-all tw-duration-300 hover:tw-shadow-lg tw-shadow-sm\">\n <div\n class=\"tw-bg-gradient-to-r tw-from-gray-50 tw-to-gray-100 tw-px-6 tw-py-1 tw-flex tw-justify-between tw-items-center tw-border-b tw-border-gray-200\">\n <h4 class=\"tw-m-0 tw-text-gray-700 tw-text-sm tw-font-semibold tw-tracking-tight\">Document {{ i + 1 }}</h4>\n <button cideEleButton variant=\"danger\" size=\"sm\" type=\"button\" (click)=\"removeDocument(i)\"\n leftIcon=\"delete\">\n Remove\n </button>\n </div>\n <div class=\"tw-p-6\">\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-select label=\"Document Type\" [options]=\"documentTypeOptions()\"\n formControlName=\"syusd_document_type_id_sygms\"\n placeholder=\"Select document type\" size=\"md\" valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n\n <cide-ele-input label=\"Document Number\" formControlName=\"syusd_doc_number\"\n placeholder=\"Enter document number\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input label=\"Name as per Document\"\n formControlName=\"syusd_doc_name_as_per_doc\"\n placeholder=\"Enter name exactly as shown on document\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-select label=\"Photo Group\" [options]=\"photoGroupOptions()\"\n formControlName=\"syusd_photo_group_id_cyfm\"\n placeholder=\"Select photo group\" size=\"md\" valueKey=\"_id\" labelKey=\"cyfm_name\">\n </cide-ele-select>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input label=\"Issue Date\" formControlName=\"syusd_doc_issue_date\"\n [id]=\"'syusd_doc_issue_date['+i+']'\" type=\"date\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input label=\"Expiry Date\" formControlName=\"syusd_doc_expiry_date\"\n [id]=\"'syusd_doc_expiry_date['+i+']'\" type=\"date\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6\">\n <cide-ele-select label=\"Document Verification Status\" [options]=\"documentVerificationStatusOptions()\"\n formControlName=\"syusd_doc_verification_status_id_sygms\"\n placeholder=\"Select verification status\" size=\"md\" valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n\n <cide-ele-select label=\"Document KYC Status\" [options]=\"documentKycStatusOptions()\"\n formControlName=\"syusd_doc_kyc_status_id_sygms\"\n placeholder=\"Select KYC status\" size=\"md\" valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n }\n\n @case ('family') {\n <!-- Family Details Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n <div class=\"tw-flex tw-justify-end tw-items-end tw-mb-2 tw-gap-4\">\n <button cideEleButton variant=\"primary\" size=\"md\" type=\"button\" (click)=\"addFamilyDetail()\" leftIcon=\"add\">\n Add Family Member\n </button>\n </div>\n\n <div formArrayName=\"core_user_family_details\">\n @for (family of familyDetails(); track $index; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"tw-bg-white tw-border tw-border-gray-200 tw-rounded-xl tw-mb-8 tw-overflow-hidden tw-transition-all tw-duration-300 hover:tw-shadow-lg tw-shadow-sm\">\n <div\n class=\"tw-bg-gradient-to-r tw-from-gray-50 tw-to-gray-100 tw-px-6 tw-py-1 tw-flex tw-justify-between tw-items-center tw-border-b tw-border-gray-200\">\n <h4 class=\"tw-m-0 tw-text-gray-700 tw-text-sm tw-font-semibold tw-tracking-tight\">Family Member {{ i + 1 }}\n </h4>\n <button cideEleButton variant=\"danger\" size=\"sm\" type=\"button\" (click)=\"removeFamilyDetail(i)\"\n leftIcon=\"delete\">\n Remove\n </button>\n </div>\n <div class=\"tw-p-6\">\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input label=\"Family Member Name\"\n formControlName=\"syfdl_family_member_name\"\n placeholder=\"Enter family member full name\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-select \n label=\"Family Member User\"\n [options]=\"userOptions(i)\"\n formControlName=\"syfdl_family_member_id_user\"\n placeholder=\"Select family member user\" \n size=\"md\" \n valueKey=\"_id\" \n labelKey=\"user_fullname\"\n [searchable]=\"true\"\n [loading]=\"userSearchLoading()[i] || false\"\n (searchChange)=\"onUserSearchChange($event, i)\"\n (change)=\"onUserSelectionChange($event, i)\">\n </cide-ele-select>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-select label=\"Relationship\" [options]=\"relationshipOptions()\"\n formControlName=\"syfdl_relationship_id_sygms\"\n placeholder=\"Select relationship\" size=\"md\" valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n\n <cide-ele-select label=\"Blood Group\" [options]=\"bloodGroupOptions()\"\n formControlName=\"syfdl_blood_group_sygms\"\n placeholder=\"Select blood group\" size=\"md\" valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input label=\"Date of Birth\"\n formControlName=\"syfdl_family_member_dob\" type=\"date\" size=\"md\"\n [id]=\"'syfdl_family_member_dob['+i+']'\">\n </cide-ele-input>\n\n <cide-ele-input label=\"Contact Phone\"\n formControlName=\"syfdl_contact_phone\"\n type=\"tel\" placeholder=\"Enter contact phone\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input label=\"Contact Email\" formControlName=\"syfdl_contact_email\"\n type=\"email\" placeholder=\"Enter contact email\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input label=\"Contact Email ID\" formControlName=\"syfdl_contact_email_id\"\n type=\"email\" placeholder=\"Enter contact email ID\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6\">\n <cide-ele-input label=\"Contact Number\" formControlName=\"syfdl_contact_number\"\n type=\"tel\" placeholder=\"Enter contact number\" size=\"md\">\n </cide-ele-input>\n\n <div class=\"tw-flex tw-items-center tw-pt-6\">\n <cide-ele-input \n formControlName=\"syfdl_isactive\"\n type=\"checkbox\"\n label=\"Active\"\n size=\"md\">\n </cide-ele-input>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n }\n }\n </div>\n\n <!-- Form Actions -->\n <div\n class=\"tw-flex tw-justify-end tw-gap-4 tw-py-2 tw-bg-white tw-border-t tw-border-gray-200 tw-sticky tw-bottom-0 tw-z-10\">\n <button cideEleButton type=\"button\" variant=\"secondary\" (click)=\"resetForm()\" leftIcon=\"refresh\"\n [disabled]=\"loading()\">\n Reset Form\n </button>\n\n <button cideEleButton type=\"submit\" variant=\"primary\" [disabled]=\"loading() || userMasterForm.invalid\"\n [loading]=\"loading()\" leftIcon=\"save\">\n Save User Master\n </button>\n </div>\n </form>\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$2.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1$2.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "component", type: CideInputComponent, selector: "cide-ele-input", inputs: ["fill", "label", "labelHide", "disabled", "clearInput", "labelPlacement", "labelDir", "placeholder", "leadingIcon", "trailingIcon", "helperText", "helperTextCollapse", "hideHelperAndErrorText", "errorText", "maxlength", "minlength", "required", "autocapitalize", "autocomplete", "type", "width", "id", "ngModel", "option", "min", "max", "size"], outputs: ["ngModelChange"] }, { kind: "component", type: CideSelectComponent, selector: "cide-ele-select", inputs: ["label", "labelHide", "placeholder", "helperText", "errorText", "required", "disabled", "id", "ngModel", "size", "fill", "labelPlacement", "labelDir", "leadingIcon", "trailingIcon", "clearInput", "options", "multiple", "searchable", "showSearchInput", "loading", "valueKey", "labelKey"], outputs: ["ngModelChange", "change", "searchChange"] }, { kind: "component", type: CideTextareaComponent, selector: "cide-ele-textarea", inputs: ["label", "labelHide", "placeholder", "helperText", "errorText", "required", "disabled", "minlength", "maxlength", "rows", "id", "ngModel", "size", "fill", "labelPlacement", "labelDir", "leadingIcon", "trailingIcon", "clearInput"], outputs: ["ngModelChange"] }, { kind: "component", type: CideEleButtonComponent, selector: "button[cideEleButton], a[cideEleButton]", inputs: ["label", "variant", "size", "type", "shape", "elevation", "disabled", "id", "loading", "fullWidth", "leftIcon", "rightIcon", "customClass", "tooltip", "ariaLabel", "testId", "routerLink", "routerExtras", "preventDoubleClick", "animated"], outputs: ["btnClick", "doubleClick"] }, { kind: "component", type: CideEleTabComponent, selector: "cide-ele-tab", inputs: ["tabs", "activeTabId", "size", "variant", "fullWidth", "disabled"], outputs: ["tabChange"] }, { kind: "component", type: CideEleFileInputComponent, selector: "cide-ele-file-input", inputs: ["label", "accept", "multiple", "disabled", "helperText", "errorText", "showPreview", "previewWidth", "previewHeight", "previewBoxMode", "placeholderText", "placeholderIcon"], outputs: ["fileChange"] }, { kind: "component", type: CideIconComponent, selector: "cide-ele-icon", inputs: ["size", "type", "toolTip"] }] });
|
|
11981
12082
|
}
|
|
11982
12083
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CideCoreUserCreateComponent, decorators: [{
|
|
11983
12084
|
type: Component,
|
|
@@ -11991,7 +12092,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImpor
|
|
|
11991
12092
|
CideEleTabComponent,
|
|
11992
12093
|
CideEleFileInputComponent,
|
|
11993
12094
|
CideIconComponent
|
|
11994
|
-
], template: "<!-- \n ENTERPRISE USER MASTER FORM\n \n Enterprise-Level Styling with Tailwind CSS\n Features: Responsive grids, proper typography, enhanced user experience\n-->\n\n<div class=\"tw-w-full tw-h-full tw-p-3\">\n <form class=\"tw-max-w-7xl tw-mx-auto tw-bg-transparent\" [formGroup]=\"userMasterForm\" [class.tw-opacity-60]=\"loading()\"\n (ngSubmit)=\"onSubmit()\">\n\n <!-- User Context Header -->\n <div\n class=\"tw-bg-gradient-to-r tw-from-blue-50 tw-to-indigo-50 tw-border tw-border-blue-200 tw-rounded-md tw-p-2 tw-mb-3 tw-shadow-sm\">\n <div class=\"tw-flex tw-items-center tw-justify-between tw-flex-wrap tw-gap-2\">\n <!-- User Basic Info Display -->\n <div class=\"tw-flex tw-items-center tw-gap-3 tw-flex-wrap\">\n <!-- Profile Photo Preview -->\n <div class=\"tw-flex tw-items-center tw-gap-2\">\n <div\n class=\"tw-w-8 tw-h-8 tw-rounded-full tw-bg-blue-100 tw-border tw-border-blue-200 tw-flex tw-items-center tw-justify-center tw-overflow-hidden\">\n @if (getUserPhoto()) {\n <img [src]=\"getUserPhoto()\" alt=\"Profile\" class=\"tw-w-full tw-h-full tw-object-cover\">\n } @else {\n <cide-ele-icon variant=\"blue\" size=\"xs\">person</cide-ele-icon>\n }\n </div>\n <div class=\"tw-flex tw-flex-col\">\n <span class=\"tw-text-xs tw-font-medium tw-text-blue-900\">\n {{ getUserFullName() || 'New User' }}\n </span>\n <span class=\"tw-text-xs tw-text-blue-600\">\n {{ getUserUsername() || 'Username not set' }}\n </span>\n </div>\n </div>\n\n <!-- Contact Info -->\n <div class=\"tw-flex tw-items-center tw-gap-3\">\n <div class=\"tw-flex tw-items-center tw-gap-1 tw-text-xs tw-text-gray-700\">\n <cide-ele-icon variant=\"gray\" size=\"xs\">email</cide-ele-icon>\n <span>{{ getUserEmail() || 'Email not set' }}</span>\n </div>\n <div class=\"tw-flex tw-items-center tw-gap-1 tw-text-xs tw-text-gray-700\">\n <cide-ele-icon variant=\"gray\" size=\"xs\">phone</cide-ele-icon>\n <span>{{ getUserMobile() || 'Mobile not set' }}</span>\n </div>\n </div>\n\n <!-- Active Status -->\n <div class=\"tw-flex tw-items-center tw-gap-1\">\n @if (getUserActiveStatus()) {\n <span\n class=\"tw-inline-flex tw-items-center tw-px-2 tw-py-1 tw-rounded tw-text-xs tw-font-medium tw-bg-green-100 tw-text-green-700\">\n <cide-ele-icon variant=\"green\" size=\"xs\" class=\"tw-mr-1\">check_circle</cide-ele-icon>\n Active\n </span>\n } @else {\n <span\n class=\"tw-inline-flex tw-items-center tw-px-2 tw-py-1 tw-rounded tw-text-xs tw-font-medium tw-bg-red-100 tw-text-red-700\">\n <cide-ele-icon variant=\"red\" size=\"xs\" class=\"tw-mr-1\">cancel</cide-ele-icon>\n Inactive\n </span>\n }\n </div>\n </div>\n\n <!-- Entity Info -->\n <div class=\"tw-flex tw-items-center tw-gap-2\">\n @if (hasDefaultEntity()) {\n <div class=\"tw-flex tw-items-center tw-gap-1 tw-text-xs tw-text-blue-700\">\n <cide-ele-icon variant=\"blue\" size=\"xs\">business</cide-ele-icon>\n <span class=\"tw-font-medium\">{{ getDefaultEntityName() }}</span>\n </div>\n } @else {\n <div class=\"tw-flex tw-items-center tw-gap-1 tw-text-xs tw-text-gray-500\">\n <cide-ele-icon variant=\"gray\" size=\"xs\">business</cide-ele-icon>\n <span class=\"tw-italic\">No entity</span>\n </div>\n }\n\n <span class=\"tw-text-xs tw-text-gray-600 tw-px-2 tw-py-1 tw-bg-gray-100 tw-rounded\">\n {{ getEntityMappingCount() }} mapping(s)\n </span>\n </div>\n </div>\n </div>\n\n <!-- Tab Navigation -->\n <div class=\"tw-p-0 tw-mb-2 tw-border-b tw-border-gray-200\">\n <cide-ele-tab [tabs]=\"userTabs()\" [activeTabId]=\"activeTab()\" size=\"md\" variant=\"default\"\n (tabChange)=\"onTabChange($event)\">\n </cide-ele-tab>\n </div>\n\n <!-- Tab Content -->\n <div class=\"tw-transition-opacity tw-duration-300\" [class.tw-opacity-60]=\"loading()\">\n @switch (activeTab()) {\n\n @case ('basic') {\n <!-- User Basic Information Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n\n <!-- Name Fields -->\n <div class=\"tw-grid tw-grid-cols-1 xl:tw-grid-cols-4 lg:tw-grid-cols-2 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input id=\"user_firstname\" label=\"First Name *\" formControlName=\"user_firstname\"\n placeholder=\"Enter first name\" [maxlength]=\"20\" size=\"md\" (ngModelChange)=\"onNameFieldChange()\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_middlename\" label=\"Middle Name\" formControlName=\"user_middlename\"\n placeholder=\"Enter middle name\" [maxlength]=\"20\" size=\"md\" (ngModelChange)=\"onNameFieldChange()\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_lastname\" label=\"Last Name *\" formControlName=\"user_lastname\"\n placeholder=\"Enter last name\" [maxlength]=\"20\" size=\"md\" (ngModelChange)=\"onNameFieldChange()\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_fullname\" label=\"Full Name * (Auto-generated)\" formControlName=\"user_fullname\"\n placeholder=\"Auto-generated from name fields or enter manually\" [maxlength]=\"62\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <!-- Contact and Login Information -->\n <div class=\"tw-grid tw-grid-cols-1 xl:tw-grid-cols-3 lg:tw-grid-cols-2 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input id=\"user_username\" label=\"Username *\" formControlName=\"user_username\"\n placeholder=\"Enter unique username\" [maxlength]=\"20\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_emailid\" label=\"Email ID *\" formControlName=\"user_emailid\" type=\"email\"\n placeholder=\"Enter valid email address\" [maxlength]=\"320\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_mobileno\" label=\"Mobile Number *\" formControlName=\"user_mobileno\" type=\"tel\"\n placeholder=\"Enter mobile number\" [maxlength]=\"15\" size=\"md\">\n </cide-ele-input>\n </div>\n\n\n\n <!-- Status Control -->\n <div class=\"tw-grid tw-grid-cols-1 tw-mb-4\">\n <div class=\"tw-p-4 tw-bg-blue-50 tw-border tw-border-blue-100 tw-rounded-lg\">\n <label\n class=\"tw-flex tw-flex-col tw-cursor-pointer tw-py-2 tw-bg-transparent tw-border-none tw-rounded-none tw-transition-all tw-duration-200 hover:tw-bg-blue-75\">\n <cide-ele-input type=\"checkbox\" label=\"Active User Status\" formControlName=\"user_isactive\"\n class=\"tw-h-5 tw-accent-blue-500 tw-rounded tw-mb-1\" />\n <span class=\"tw-font-semibold tw-text-gray-700 tw-text-base\"></span>\n <span class=\"tw-text-sm tw-text-gray-600 tw-mt-1 tw-leading-relaxed\">Enable this user account for system\n access and operations</span>\n </label>\n </div>\n </div>\n </div>\n }\n\n @case ('auth') {\n <!-- Authentication Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n <!-- Password Fields -->\n @if (shouldShowPasswordFields()) {\n <div class=\"tw-mb-6\">\n <!-- Password Fields Header for Edit Mode -->\n @if (isEditMode()) {\n <div class=\"tw-flex tw-items-center tw-justify-between tw-mb-3\">\n <h6 class=\"tw-text-sm tw-font-semibold tw-text-gray-800\">Update Password</h6>\n <button type=\"button\"\n class=\"tw-px-3 tw-py-1 tw-bg-gray-100 tw-text-gray-600 tw-border tw-border-gray-300 tw-rounded-md tw-text-xs tw-font-medium hover:tw-bg-gray-200 tw-transition-colors\"\n (click)=\"cancelPasswordUpdate()\">\n Cancel Password Update\n </button>\n </div>\n }\n\n <div class=\"tw-grid tw-grid-cols-1 lg:tw-grid-cols-2 md:tw-grid-cols-1 tw-gap-6\">\n <cide-ele-input id=\"user_password\" [label]=\"getPasswordFieldLabel()\" formControlName=\"user_password\"\n type=\"password\" placeholder=\"Enter secure password (min 8 characters)\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_confirm_password\" [label]=\"getPasswordConfirmLabel()\"\n formControlName=\"user_confirm_password\" type=\"password\" placeholder=\"Confirm your password\" size=\"md\">\n </cide-ele-input>\n </div>\n </div>\n }\n\n <!-- Password Update Option for Edit Mode -->\n @if (isEditMode() && !shouldShowPasswordFields()) {\n <div class=\"tw-mb-6\">\n <div class=\"tw-p-4 tw-bg-blue-50 tw-border tw-border-blue-200 tw-rounded-lg\">\n <h6 class=\"tw-text-sm tw-font-semibold tw-text-blue-800 tw-mb-2\">Password Update</h6>\n <p class=\"tw-text-sm tw-text-blue-600 tw-mb-3\">Current password will be kept. Click below to change\n password.</p>\n\n @if (hasPasswordInput()) {\n <div\n class=\"tw-mb-3 tw-p-2 tw-bg-yellow-50 tw-border tw-border-yellow-200 tw-rounded tw-text-sm tw-text-yellow-700\">\n <cide-ele-icon variant=\"yellow\" size=\"xs\" class=\"tw-mr-1\">warning</cide-ele-icon>\n Password fields contain text. Click \"Change Password\" to manage existing input.\n </div>\n }\n\n <button type=\"button\"\n class=\"tw-px-4 tw-py-2 tw-bg-blue-100 tw-text-blue-700 tw-border tw-border-blue-300 tw-rounded-md tw-text-sm tw-font-medium hover:tw-bg-blue-200 tw-transition-colors\"\n (click)=\"triggerPasswordUpdate()\">\n @if (hasPasswordInput()) {\n Manage Password Fields\n } @else {\n Change Password\n }\n </button>\n </div>\n </div>\n }\n\n <!-- Password Options -->\n <div class=\"tw-grid tw-grid-cols-1 tw-gap-6 tw-mb-6\">\n <div class=\"tw-p-4 tw-bg-yellow-50 tw-border tw-border-yellow-100 tw-rounded-lg\">\n <label\n class=\"tw-flex tw-flex-col tw-gap-2 tw-cursor-pointer tw-py-2 tw-bg-transparent tw-border-none tw-rounded-none tw-transition-all tw-duration-200\">\n <cide-ele-input type=\"checkbox\" label=\"Force Password Change on Login\"\n formControlName=\"user_passwordchangeonlogin\" class=\"tw-h-5 tw-accent-yellow-500 tw-rounded tw-mb-1\" />\n <span class=\"tw-text-sm tw-text-gray-600 tw-mt-1 tw-leading-relaxed\">User will be required to change\n password on next login</span>\n </label>\n </div>\n </div>\n\n <!-- Photo Upload -->\n <div class=\"tw-grid tw-grid-cols-1 tw-gap-6 tw-mb-6\">\n <div class=\"tw-bg-gray-50 tw-border tw-border-gray-200 tw-rounded-lg tw-p-4\">\n <h6 class=\"tw-text-sm tw-font-semibold tw-text-gray-800 tw-mb-3\">Profile Photo</h6>\n <div class=\"tw-flex tw-flex-col tw-items-center tw-gap-4\">\n <cide-ele-file-input id=\"user_photo_upload\" formControlName=\"user_photo_id_cyfm\" accept=\"image/*\"\n [showPreview]=\"true\" [previewBoxMode]=\"true\" previewWidth=\"150px\" previewHeight=\"150px\"\n placeholderText=\"Click to upload photo\" placeholderIcon=\"\uD83D\uDC64\">\n </cide-ele-file-input>\n <div class=\"tw-text-xs tw-text-gray-500 tw-text-center tw-max-w-sm\">\n Supported formats: JPG, PNG, GIF. Maximum size: 2MB. Recommended size: 150x150px for best results.\n </div>\n </div>\n </div>\n </div>\n </div>\n }\n\n @case ('roles') {\n <!-- Entity, Roles & Permissions Mapping Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n\n\n\n <!-- Important Note -->\n <div class=\"tw-bg-amber-50 tw-border tw-border-amber-200 tw-rounded-lg tw-p-4 tw-mb-6\">\n <div class=\"tw-flex tw-items-start tw-gap-3\">\n <cide-ele-icon variant=\"amber\" size=\"lg\">info</cide-ele-icon>\n <div class=\"tw-flex-1\">\n <h4 class=\"tw-text-sm tw-font-semibold tw-text-amber-800 tw-mb-1\">Entity-Role Based Access</h4>\n <p class=\"tw-text-sm tw-text-amber-700 tw-mb-2\">User access is completely managed through entity-role\n mappings below. At least one entity mapping is required for user access.</p>\n @if (hasDefaultEntity()) {\n <div class=\"tw-flex tw-items-center tw-gap-2 tw-mt-2 tw-p-2 tw-bg-amber-100 tw-rounded\">\n <cide-ele-icon variant=\"amber\" size=\"sm\">star</cide-ele-icon>\n <span class=\"tw-text-sm tw-text-amber-800\">\n <strong>Default Entity:</strong> {{ getDefaultEntityName() }}\n </span>\n </div>\n } @else {\n <div class=\"tw-text-sm tw-text-amber-600 tw-mt-2 tw-italic\">\n \u26A0\uFE0F No default entity selected. Please set one entity as default.\n </div>\n }\n </div>\n </div>\n </div>\n\n <!-- Entity-Role Mapping Section -->\n <div class=\"tw-bg-blue-50 tw-border tw-border-blue-200 tw-rounded-lg tw-p-6 tw-mb-6\">\n <div class=\"tw-flex tw-text-center tw-justify-between tw-items-center tw-mb-4\">\n <div>\n <h4 class=\"tw-text-sm tw-text-left tw-font-semibold tw-text-blue-900 tw-mb-1\">Entity-Role Mapping</h4>\n <p class=\"tw-text-sm tw-text-blue-700\">Map user to entities with specific roles and permissions</p>\n </div>\n <div class=\"tw-flex tw-flex-col tw-items-end\">\n <button cideEleButton variant=\"primary\" size=\"md\" type=\"button\" (click)=\"addEntityMapping()\" leftIcon=\"add\"\n [disabled]=\"isAllEntitiesMapped()\">\n Add Entity Mapping\n </button>\n \n @if (isAllEntitiesMapped()) {\n <div class=\"tw-mt-2 tw-p-2 tw-bg-blue-50 tw-border tw-border-blue-200 tw-rounded-md tw-max-w-xs\">\n <p class=\"tw-text-xs tw-text-blue-700\">\n <cide-ele-icon variant=\"info\" size=\"xs\" class=\"tw-mr-1\">info</cide-ele-icon>\n All available entities are already mapped.\n </p>\n </div>\n }\n </div>\n </div>\n\n <div formArrayName=\"core_entity_mapping\">\n @for (mapping of entityMappings(); track $index; let i = $index) {\n <div class=\"tw-bg-white tw-border tw-border-blue-200 tw-rounded-xl tw-mb-6 tw-overflow-hidden tw-shadow-sm\"\n [formGroupName]=\"i\">\n <div\n class=\"tw-bg-gradient-to-r tw-from-blue-50 tw-to-blue-100 tw-px-6 tw-py-3 tw-flex tw-justify-between tw-items-center tw-border-b tw-border-blue-200\">\n <div class=\"tw-flex tw-items-center tw-gap-2\">\n <h5 class=\"tw-m-0 tw-text-blue-800 tw-text-sm tw-font-semibold\">Entity Mapping {{ i + 1 }}</h5>\n @if (mapping.syenm_isdefault) {\n <span\n class=\"tw-inline-flex tw-items-center tw-px-2 tw-py-1 tw-rounded-full tw-text-xs tw-font-medium tw-bg-green-100 tw-text-green-800\">\n <cide-ele-icon variant=\"green\" size=\"xs\" class=\"tw-mr-1\">star</cide-ele-icon>\n Default\n </span>\n }\n </div>\n <button cideEleButton variant=\"danger\" size=\"sm\" type=\"button\" (click)=\"removeEntityMapping(i)\"\n leftIcon=\"delete\">\n Remove\n </button>\n </div>\n\n <div class=\"tw-p-6\">\n <!-- Entity and Role Selection -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <div>\n <cide-ele-select label=\"Entity *\" [options]=\"getFilteredEntityOptions(i)\" formControlName=\"syenm_entity_id_syen\"\n valueKey=\"_id\" labelKey=\"syen_name\" placeholder=\"Select entity\" size=\"md\"\n (change)=\"onEntityChange(i, $event)\">\n </cide-ele-select>\n \n @if (isAllEntitiesSelected(i)) {\n <div class=\"tw-mt-2 tw-p-2 tw-bg-yellow-50 tw-border tw-border-yellow-200 tw-rounded-md\">\n <p class=\"tw-text-xs tw-text-yellow-700\">\n <cide-ele-icon variant=\"warning\" size=\"xs\" class=\"tw-mr-1\">info</cide-ele-icon>\n All entities are already mapped. Remove another mapping to add this one.\n </p>\n </div>\n }\n </div>\n\n <cide-ele-select label=\"Role for this Entity\" [options]=\"getRoleOptionsForEntity(i)\"\n formControlName=\"syenm_role_id_syusrol\" placeholder=\"Select role for this entity\" size=\"md\">\n </cide-ele-select>\n </div>\n\n <!-- Entity-Specific Details -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-select label=\"Department for this Entity\" [options]=\"getDepartmentOptionsForEntity(i)\"\n formControlName=\"syenm_department_id_sydept\" (change)=\"onDepartmentChange($event)\" valueKey=\"_id\" labelKey=\"sydept_name\" placeholder=\"Select department\" size=\"md\">\n </cide-ele-select>\n\n <cide-ele-select label=\"Designation for this Entity\" [options]=\"getDesignationOptionsForEntity(i)\" valueKey=\"_id\" labelKey=\"sydsg_name\"\n formControlName=\"syenm_designation_id_sydsg\" placeholder=\"Select designation\" size=\"md\">\n </cide-ele-select>\n </div>\n\n <!-- Active Period for Entity Mapping -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input label=\"Active From *\" [id]=\"'syenm_activefrom['+i+']'\"\n formControlName=\"syenm_activefrom\" type=\"date\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input label=\"Active Until\" [id]=\"'syenm_activeupto['+i+']'\"\n formControlName=\"syenm_activeupto\" type=\"date\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <!-- Mapping Settings -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-3 tw-gap-6 tw-mb-6\">\n <div class=\"tw-p-3 tw-bg-green-50 tw-border tw-border-green-200 tw-rounded-lg\">\n <cide-ele-input type=\"checkbox\" label=\"Default Entity\" formControlName=\"syenm_isdefault\"\n (change)=\"onDefaultEntityChange(i, $event)\" class=\"tw-h-5 tw-accent-green-500\" />\n <span class=\"tw-text-xs tw-text-green-600 tw-block tw-mt-1\">Set as user's default entity (only one\n allowed)</span>\n </div>\n\n <div class=\"tw-p-3 tw-bg-blue-50 tw-border tw-border-blue-200 tw-rounded-lg\">\n <cide-ele-input type=\"checkbox\" label=\"Active Mapping\" formControlName=\"syenm_isactive\"\n class=\"tw-h-5 tw-accent-blue-500\" />\n <span class=\"tw-text-xs tw-text-blue-600 tw-block tw-mt-1\">Enable this entity mapping</span>\n </div>\n </div>\n\n <!-- Menu Rights Grid for this Entity-Role -->\n <div class=\"tw-border-t tw-border-gray-200 tw-pt-4\">\n <div class=\"tw-flex tw-justify-between tw-items-center tw-mb-4\">\n <h6 class=\"tw-text-sm tw-font-semibold tw-text-gray-800\">Menu Rights & Permissions</h6>\n <div class=\"tw-flex tw-gap-2\">\n <button cideEleButton variant=\"secondary\" size=\"sm\" type=\"button\" (click)=\"refreshMenuRights(i)\"\n leftIcon=\"refresh\">\n Refresh Rights\n </button>\n </div>\n </div>\n\n @if (getMenuRightsForMapping(i).length > 0) {\n <!-- Menu Rights Grid -->\n <div class=\"tw-overflow-x-auto tw-bg-white tw-border tw-border-gray-200 tw-rounded-lg\">\n <table class=\"tw-w-full tw-text-sm\">\n <thead class=\"tw-bg-gray-50 tw-border-b tw-border-gray-200\">\n <tr>\n <th class=\"tw-px-4 tw-py-3 tw-text-left tw-font-medium tw-text-gray-700\">Menu</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Role Rights</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Create</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Read</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Update</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Delete</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Exception</th>\n </tr>\n </thead>\n <tbody>\n @for (menuRight of getMenuRightsForMapping(i); track $index; let j = $index) {\n <tr class=\"tw-border-b tw-border-gray-100 hover:tw-bg-gray-50\">\n <td class=\"tw-px-4 tw-py-3 tw-font-medium tw-text-gray-900\">\n {{ menuRight.menu_name }}\n <div class=\"tw-text-xs tw-text-gray-500\">{{ menuRight.menu_code }}</div>\n </td>\n\n <!-- Role Rights Display -->\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n <div class=\"tw-flex tw-flex-wrap tw-justify-center tw-gap-1\">\n @for (right of menuRight.role_rights; track $index) {\n <span\n class=\"tw-inline-block tw-px-2 tw-py-1 tw-text-xs tw-bg-blue-100 tw-text-blue-800 tw-rounded\">\n {{ right }}\n </span>\n }\n </div>\n </td>\n\n <!-- Individual Permission Controls -->\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n <cide-ele-input type=\"checkbox\"\n [formControlName]=\"'core_entity_mapping.' + i + '.menu_rights.' + j + '.create'\"\n class=\"tw-h-4 tw-accent-green-500\" />\n </td>\n\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n <cide-ele-input type=\"checkbox\"\n [formControlName]=\"'core_entity_mapping.' + i + '.menu_rights.' + j + '.read'\"\n class=\"tw-h-4 tw-accent-blue-500\" />\n </td>\n\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n <cide-ele-input type=\"checkbox\"\n [formControlName]=\"'core_entity_mapping.' + i + '.menu_rights.' + j + '.update'\"\n class=\"tw-h-4 tw-accent-yellow-500\" />\n </td>\n\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n <cide-ele-input type=\"checkbox\"\n [formControlName]=\"'core_entity_mapping.' + i + '.menu_rights.' + j + '.delete'\"\n class=\"tw-h-4 tw-accent-red-500\" />\n </td>\n\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n @if (hasExceptionForMenu(i, menuRight.menu_id)) {\n <span\n class=\"tw-inline-block tw-px-2 tw-py-1 tw-text-xs tw-bg-yellow-100 tw-text-yellow-800 tw-rounded\">\n Override\n </span>\n } @else {\n <span class=\"tw-text-xs tw-text-gray-400\">Default</span>\n }\n </td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <!-- Legend -->\n <div class=\"tw-mt-4 tw-p-3 tw-bg-gray-50 tw-rounded-lg\">\n <h6 class=\"tw-text-xs tw-font-semibold tw-text-gray-700 tw-mb-2\">Legend:</h6>\n <div class=\"tw-grid tw-grid-cols-2 md:tw-grid-cols-4 tw-gap-3 tw-text-xs tw-text-gray-600\">\n <div><span class=\"tw-w-3 tw-h-3 tw-bg-blue-100 tw-inline-block tw-rounded tw-mr-2\"></span>Role\n Rights: Inherited from role</div>\n <div><span\n class=\"tw-w-3 tw-h-3 tw-bg-yellow-100 tw-inline-block tw-rounded tw-mr-2\"></span>Override:\n User-specific exception</div>\n <div><span\n class=\"tw-w-3 tw-h-3 tw-bg-green-100 tw-inline-block tw-rounded tw-mr-2\"></span>Enabled:\n Permission granted</div>\n <div><span\n class=\"tw-w-3 tw-h-3 tw-bg-gray-100 tw-inline-block tw-rounded tw-mr-2\"></span>Disabled:\n Permission restricted</div>\n </div>\n </div>\n\n } @else {\n <div class=\"tw-text-center tw-py-8 tw-bg-gray-50 tw-border tw-border-gray-200 tw-rounded-lg\">\n <div class=\"tw-text-gray-400 tw-mb-3\">\n <cide-ele-icon variant=\"gray\" size=\"lg\">menu</cide-ele-icon>\n </div>\n <h6 class=\"tw-text-sm tw-font-medium tw-text-gray-600 tw-mb-2\">No Menu Rights Available</h6>\n <p class=\"tw-text-xs tw-text-gray-500 tw-mb-3 tw-text-center\">Select both entity and role to load\n menu rights for this mapping.</p>\n @if (mapping.syenm_entity_id_syen?._id && mapping.syenm_role_id_syusrol) {\n <button cideEleButton variant=\"primary\" size=\"sm\" type=\"button\" (click)=\"loadMenuRights(i)\"\n leftIcon=\"refresh\">\n Load Menu Rights\n </button>\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n </div>\n\n @if (entityMappings().length === 0) {\n <div class=\"tw-text-center tw-py-8 tw-bg-white tw-border tw-border-blue-200 tw-rounded-lg\">\n <div class=\"tw-text-blue-400 tw-mb-3\">\n <cide-ele-icon variant=\"blue\" size=\"lg\">business</cide-ele-icon>\n </div>\n <h4 class=\"tw-text-sm tw-font-medium tw-text-blue-800 tw-mb-2\">No Entity Mappings</h4>\n <p class=\"tw-text-blue-600 tw-mb-4 tw-text-center\">Add entity mappings to assign specific roles and\n permissions for different entities.</p>\n <button class=\"tw-mx-auto\" cideEleButton variant=\"primary\" size=\"md\" type=\"button\"\n (click)=\"addEntityMapping()\" leftIcon=\"add\">\n Add First Entity Mapping\n </button>\n </div>\n }\n </div>\n\n\n </div>\n }\n\n @case ('addresses') {\n <!-- Contact Addresses Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n <div class=\"tw-flex tw-justify-end\">\n <div class=\"tw-flex tw-justify-between tw-items-end tw-mb-2 tw-gap-4\">\n <button cideEleButton variant=\"primary\" size=\"md\" type=\"button\" (click)=\"addContactAddress()\"\n leftIcon=\"add\">\n Add New Address\n </button>\n </div>\n </div>\n\n <div formArrayName=\"core_user_contact_addresses\">\n @for (address of contactAddresses(); track $index; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"tw-bg-white tw-border tw-border-gray-200 tw-rounded-xl tw-mb-8 tw-overflow-hidden tw-transition-all tw-duration-300 hover:tw-shadow-lg tw-shadow-sm\">\n <div\n class=\"tw-bg-gradient-to-r tw-from-gray-50 tw-to-gray-100 tw-px-6 tw-py-1 tw-flex tw-justify-between tw-items-center tw-border-b tw-border-gray-200\">\n <h4 class=\"tw-m-0 tw-text-gray-700 tw-text-sm tw-font-semibold tw-tracking-tight\">Address {{ i + 1 }}</h4>\n <button cideEleButton variant=\"danger\" size=\"sm\" type=\"button\" (click)=\"removeContactAddress(i)\"\n leftIcon=\"delete\">\n Remove\n </button>\n </div>\n <div class=\"tw-p-6\">\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-select label=\"Address Type\" [options]=\"addressTypeOptions()\"\n formControlName=\"sycad_address_type_id_sygms\" placeholder=\"Select address type\" size=\"md\"\n valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n\n <cide-ele-input label=\"Contact Person Name\" formControlName=\"sycad_contact_person_name\"\n placeholder=\"Enter contact person name\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 tw-mb-6\">\n <cide-ele-textarea label=\"Complete Address\" formControlName=\"sycad_contact_address\"\n placeholder=\"Enter complete address with area, city, and landmarks\" [rows]=\"3\" size=\"md\">\n </cide-ele-textarea>\n </div>\n\n <!-- Postal Code & City -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-select \n label=\"Postal Code\"\n [options]=\"addressPostalCodes()[i] || []\" \n formControlName=\"sycad_contact_pin_sypin\"\n placeholder=\"Select postal code\"\n [searchable]=\"true\"\n [loading]=\"addressPostalCodesLoading()[i] || false\"\n (searchChange)=\"onPostalCodeSearch($event, i)\"\n (change)=\"onPostalCodeSelection($event, i)\"\n size=\"md\">\n </cide-ele-select>\n \n <cide-ele-input \n label=\"City\" \n formControlName=\"sycad_contact_city_sypin\"\n placeholder=\"Enter city\"\n size=\"md\">\n </cide-ele-input>\n </div>\n \n <!-- State & Country -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input \n label=\"State\" \n formControlName=\"sycad_contact_state_sypin\"\n placeholder=\"Enter state\"\n size=\"md\">\n </cide-ele-input>\n\n <cide-ele-select \n label=\"Country\" \n [options]=\"addressCountries()[i] || []\" \n formControlName=\"sycad_contact_country_syctr\"\n placeholder=\"Select country\"\n valueKey=\"_id\"\n labelKey=\"syctr_country_iso_name\"\n [searchable]=\"true\"\n (searchChange)=\"onCountrySearch($event, i)\"\n [loading]=\"addressCountriesLoading()[i] || false\"\n size=\"md\">\n </cide-ele-select>\n </div>\n\n <!-- Phone Numbers -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input \n label=\"Primary Phone\" \n formControlName=\"sycad_contact_phone\"\n type=\"tel\"\n placeholder=\"Enter primary phone number\"\n size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input \n label=\"Alternate Phone\" \n formControlName=\"sycad_contact_phone_alt\"\n type=\"tel\"\n placeholder=\"Enter alternate phone number\"\n size=\"md\">\n </cide-ele-input>\n </div>\n\n <!-- Fax & Email -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input \n label=\"Fax Number\" \n formControlName=\"sycad_contact_fax\"\n placeholder=\"Enter fax number\"\n size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input \n label=\"Primary Email\" \n formControlName=\"sycad_contact_email\"\n type=\"email\"\n placeholder=\"Enter primary email address\"\n size=\"md\">\n </cide-ele-input>\n </div>\n\n <!-- Alternate Email -->\n <div class=\"tw-grid tw-grid-cols-1 tw-mb-6\">\n <cide-ele-input \n label=\"Alternate Email\" \n formControlName=\"sycad_contact_email_alt\"\n type=\"email\"\n placeholder=\"Enter alternate email address\"\n size=\"md\">\n </cide-ele-input>\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n }\n\n @case ('documents') {\n <!-- Documents Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n <div class=\"tw-flex tw-justify-end tw-items-end tw-mb-2 tw-gap-4\">\n <button cideEleButton variant=\"primary\" size=\"md\" type=\"button\" (click)=\"addDocument()\" leftIcon=\"add\">\n Add Document\n </button>\n </div>\n\n @for (doc of documents(); track $index; let i = $index) {\n <div\n class=\"tw-bg-white tw-border tw-border-gray-200 tw-rounded-xl tw-mb-8 tw-overflow-hidden tw-transition-all tw-duration-300 hover:tw-shadow-lg tw-shadow-sm\">\n <div\n class=\"tw-bg-gradient-to-r tw-from-gray-50 tw-to-gray-100 tw-px-6 tw-py-1 tw-flex tw-justify-between tw-items-center tw-border-b tw-border-gray-200\">\n <h4 class=\"tw-m-0 tw-text-gray-700 tw-text-sm tw-font-semibold tw-tracking-tight\">Document {{ i + 1 }}</h4>\n <button cideEleButton variant=\"danger\" size=\"sm\" type=\"button\" (click)=\"removeDocument(i)\"\n leftIcon=\"delete\">\n Remove\n </button>\n </div>\n <div class=\"tw-p-6\">\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-select label=\"Document Type\" [options]=\"documentTypeOptions()\"\n [formControlName]=\"'documents.' + i + '.syusd_document_type_id_sygms'\"\n placeholder=\"Select document type\" size=\"md\" valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n\n <cide-ele-input label=\"Document Number\" [formControlName]=\"'documents.' + i + '.syusd_doc_number'\"\n placeholder=\"Enter document number\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input label=\"Name as per Document\"\n [formControlName]=\"'documents.' + i + '.syusd_doc_name_as_per_doc'\"\n placeholder=\"Enter name exactly as shown on document\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-select label=\"Photo Group\" [options]=\"photoGroupOptions()\"\n [formControlName]=\"'documents.' + i + '.syusd_photo_group_id_cyfm'\"\n placeholder=\"Select photo group\" size=\"md\" valueKey=\"_id\" labelKey=\"cyfm_name\">\n </cide-ele-select>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input label=\"Issue Date\" [formControlName]=\"'documents.' + i + '.syusd_doc_issue_date'\"\n [id]=\"'syusd_doc_issue_date['+i+']'\" type=\"date\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input label=\"Expiry Date\" [formControlName]=\"'documents.' + i + '.syusd_doc_expiry_date'\"\n [id]=\"'syusd_doc_expiry_date['+i+']'\" type=\"date\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6\">\n <cide-ele-select label=\"Document Verification Status\" [options]=\"documentVerificationStatusOptions()\"\n [formControlName]=\"'documents.' + i + '.syusd_doc_verification_status_id_sygms'\"\n placeholder=\"Select verification status\" size=\"md\" valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n\n <cide-ele-select label=\"Document KYC Status\" [options]=\"documentKycStatusOptions()\"\n [formControlName]=\"'documents.' + i + '.syusd_doc_kyc_status_id_sygms'\"\n placeholder=\"Select KYC status\" size=\"md\" valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n </div>\n </div>\n </div>\n }\n </div>\n }\n\n @case ('family') {\n <!-- Family Details Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n <div class=\"tw-flex tw-justify-end tw-items-end tw-mb-2 tw-gap-4\">\n <button cideEleButton variant=\"primary\" size=\"md\" type=\"button\" (click)=\"addFamilyDetail()\" leftIcon=\"add\">\n Add Family Member\n </button>\n </div>\n\n @for (family of familyDetails(); track $index; let i = $index) {\n <div\n class=\"tw-bg-white tw-border tw-border-gray-200 tw-rounded-xl tw-mb-8 tw-overflow-hidden tw-transition-all tw-duration-300 hover:tw-shadow-lg tw-shadow-sm\">\n <div\n class=\"tw-bg-gradient-to-r tw-from-gray-50 tw-to-gray-100 tw-px-6 tw-py-1 tw-flex tw-justify-between tw-items-center tw-border-b tw-border-gray-200\">\n <h4 class=\"tw-m-0 tw-text-gray-700 tw-text-sm tw-font-semibold tw-tracking-tight\">Family Member {{ i + 1 }}\n </h4>\n <button cideEleButton variant=\"danger\" size=\"sm\" type=\"button\" (click)=\"removeFamilyDetail(i)\"\n leftIcon=\"delete\">\n Remove\n </button>\n </div>\n <div class=\"tw-p-6\">\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input label=\"Family Member Name\"\n [formControlName]=\"'family_details.' + i + '.syfdl_family_member_name'\"\n placeholder=\"Enter family member full name\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-select label=\"Relationship\" [options]=\"relationshipOptions()\"\n [formControlName]=\"'family_details.' + i + '.syfdl_relationship_id_sygms'\"\n placeholder=\"Select relationship\" size=\"md\" valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input label=\"Date of Birth\"\n [formControlName]=\"'family_details.' + i + '.syfdl_family_member_dob'\" type=\"date\" size=\"md\"\n [id]=\"'syfdl_family_member_dob['+i+']'\">\n </cide-ele-input>\n\n <cide-ele-select label=\"Blood Group\" [options]=\"bloodGroupOptions()\"\n [formControlName]=\"'family_details.' + i + '.syfdl_blood_group_sygms'\"\n placeholder=\"Select blood group\" size=\"md\" valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6\">\n <cide-ele-input label=\"Contact Email\" [formControlName]=\"'family_details.' + i + '.syfdl_contact_email_id'\"\n type=\"email\" placeholder=\"Enter contact email\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input label=\"Contact Number\" [formControlName]=\"'family_details.' + i + '.syfdl_contact_number'\"\n type=\"tel\" placeholder=\"Enter contact number\" size=\"md\">\n </cide-ele-input>\n </div>\n </div>\n </div>\n }\n </div>\n }\n }\n </div>\n\n <!-- Form Actions -->\n <div\n class=\"tw-flex tw-justify-end tw-gap-4 tw-py-2 tw-bg-white tw-border-t tw-border-gray-200 tw-sticky tw-bottom-0 tw-z-10\">\n <button cideEleButton type=\"button\" variant=\"secondary\" (click)=\"resetForm()\" leftIcon=\"refresh\"\n [disabled]=\"loading()\">\n Reset Form\n </button>\n\n <button cideEleButton type=\"submit\" variant=\"primary\" [disabled]=\"loading() || userMasterForm.invalid\"\n [loading]=\"loading()\" leftIcon=\"save\">\n Save User Master\n </button>\n </div>\n </form>\n</div>" }]
|
|
12095
|
+
], template: "<!-- \n ENTERPRISE USER MASTER FORM\n \n Enterprise-Level Styling with Tailwind CSS\n Features: Responsive grids, proper typography, enhanced user experience\n-->\n\n<div class=\"tw-w-full tw-h-full tw-p-3\">\n <form class=\"tw-max-w-7xl tw-mx-auto tw-bg-transparent\" [formGroup]=\"userMasterForm\" [class.tw-opacity-60]=\"loading()\"\n (ngSubmit)=\"onSubmit()\">\n\n <!-- User Context Header -->\n <div\n class=\"tw-bg-gradient-to-r tw-from-blue-50 tw-to-indigo-50 tw-border tw-border-blue-200 tw-rounded-md tw-p-2 tw-mb-3 tw-shadow-sm\">\n <div class=\"tw-flex tw-items-center tw-justify-between tw-flex-wrap tw-gap-2\">\n <!-- User Basic Info Display -->\n <div class=\"tw-flex tw-items-center tw-gap-3 tw-flex-wrap\">\n <!-- Profile Photo Preview -->\n <div class=\"tw-flex tw-items-center tw-gap-2\">\n <div\n class=\"tw-w-8 tw-h-8 tw-rounded-full tw-bg-blue-100 tw-border tw-border-blue-200 tw-flex tw-items-center tw-justify-center tw-overflow-hidden\">\n @if (getUserPhoto()) {\n <img [src]=\"getUserPhoto()\" alt=\"Profile\" class=\"tw-w-full tw-h-full tw-object-cover\">\n } @else {\n <cide-ele-icon variant=\"blue\" size=\"xs\">person</cide-ele-icon>\n }\n </div>\n <div class=\"tw-flex tw-flex-col\">\n <span class=\"tw-text-xs tw-font-medium tw-text-blue-900\">\n {{ getUserFullName() || 'New User' }}\n </span>\n <span class=\"tw-text-xs tw-text-blue-600\">\n {{ getUserUsername() || 'Username not set' }}\n </span>\n </div>\n </div>\n\n <!-- Contact Info -->\n <div class=\"tw-flex tw-items-center tw-gap-3\">\n <div class=\"tw-flex tw-items-center tw-gap-1 tw-text-xs tw-text-gray-700\">\n <cide-ele-icon variant=\"gray\" size=\"xs\">email</cide-ele-icon>\n <span>{{ getUserEmail() || 'Email not set' }}</span>\n </div>\n <div class=\"tw-flex tw-items-center tw-gap-1 tw-text-xs tw-text-gray-700\">\n <cide-ele-icon variant=\"gray\" size=\"xs\">phone</cide-ele-icon>\n <span>{{ getUserMobile() || 'Mobile not set' }}</span>\n </div>\n </div>\n\n <!-- Active Status -->\n <div class=\"tw-flex tw-items-center tw-gap-1\">\n @if (getUserActiveStatus()) {\n <span\n class=\"tw-inline-flex tw-items-center tw-px-2 tw-py-1 tw-rounded tw-text-xs tw-font-medium tw-bg-green-100 tw-text-green-700\">\n <cide-ele-icon variant=\"green\" size=\"xs\" class=\"tw-mr-1\">check_circle</cide-ele-icon>\n Active\n </span>\n } @else {\n <span\n class=\"tw-inline-flex tw-items-center tw-px-2 tw-py-1 tw-rounded tw-text-xs tw-font-medium tw-bg-red-100 tw-text-red-700\">\n <cide-ele-icon variant=\"red\" size=\"xs\" class=\"tw-mr-1\">cancel</cide-ele-icon>\n Inactive\n </span>\n }\n </div>\n </div>\n\n <!-- Entity Info -->\n <div class=\"tw-flex tw-items-center tw-gap-2\">\n @if (hasDefaultEntity()) {\n <div class=\"tw-flex tw-items-center tw-gap-1 tw-text-xs tw-text-blue-700\">\n <cide-ele-icon variant=\"blue\" size=\"xs\">business</cide-ele-icon>\n <span class=\"tw-font-medium\">{{ getDefaultEntityName() }}</span>\n </div>\n } @else {\n <div class=\"tw-flex tw-items-center tw-gap-1 tw-text-xs tw-text-gray-500\">\n <cide-ele-icon variant=\"gray\" size=\"xs\">business</cide-ele-icon>\n <span class=\"tw-italic\">No entity</span>\n </div>\n }\n\n <span class=\"tw-text-xs tw-text-gray-600 tw-px-2 tw-py-1 tw-bg-gray-100 tw-rounded\">\n {{ getEntityMappingCount() }} mapping(s)\n </span>\n </div>\n </div>\n </div>\n\n <!-- Tab Navigation -->\n <div class=\"tw-p-0 tw-mb-2 tw-border-b tw-border-gray-200\">\n <cide-ele-tab [tabs]=\"userTabs()\" [activeTabId]=\"activeTab()\" size=\"md\" variant=\"default\"\n (tabChange)=\"onTabChange($event)\">\n </cide-ele-tab>\n </div>\n\n <!-- Tab Content -->\n <div class=\"tw-transition-opacity tw-duration-300\" [class.tw-opacity-60]=\"loading()\">\n @switch (activeTab()) {\n\n @case ('basic') {\n <!-- User Basic Information Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n\n <!-- Name Fields -->\n <div class=\"tw-grid tw-grid-cols-1 xl:tw-grid-cols-4 lg:tw-grid-cols-2 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input id=\"user_firstname\" label=\"First Name *\" formControlName=\"user_firstname\"\n placeholder=\"Enter first name\" [maxlength]=\"20\" size=\"md\" (ngModelChange)=\"onNameFieldChange()\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_middlename\" label=\"Middle Name\" formControlName=\"user_middlename\"\n placeholder=\"Enter middle name\" [maxlength]=\"20\" size=\"md\" (ngModelChange)=\"onNameFieldChange()\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_lastname\" label=\"Last Name *\" formControlName=\"user_lastname\"\n placeholder=\"Enter last name\" [maxlength]=\"20\" size=\"md\" (ngModelChange)=\"onNameFieldChange()\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_fullname\" label=\"Full Name * (Auto-generated)\" formControlName=\"user_fullname\"\n placeholder=\"Auto-generated from name fields or enter manually\" [maxlength]=\"62\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <!-- Contact and Login Information -->\n <div class=\"tw-grid tw-grid-cols-1 xl:tw-grid-cols-3 lg:tw-grid-cols-2 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input id=\"user_username\" label=\"Username *\" formControlName=\"user_username\"\n placeholder=\"Enter unique username\" [maxlength]=\"20\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_emailid\" label=\"Email ID *\" formControlName=\"user_emailid\" type=\"email\"\n placeholder=\"Enter valid email address\" [maxlength]=\"320\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_mobileno\" label=\"Mobile Number *\" formControlName=\"user_mobileno\" type=\"tel\"\n placeholder=\"Enter mobile number\" [maxlength]=\"15\" size=\"md\">\n </cide-ele-input>\n </div>\n\n\n\n <!-- Status Control -->\n <div class=\"tw-grid tw-grid-cols-1 tw-mb-4\">\n <div class=\"tw-p-4 tw-bg-blue-50 tw-border tw-border-blue-100 tw-rounded-lg\">\n <label\n class=\"tw-flex tw-flex-col tw-cursor-pointer tw-py-2 tw-bg-transparent tw-border-none tw-rounded-none tw-transition-all tw-duration-200 hover:tw-bg-blue-75\">\n <cide-ele-input type=\"checkbox\" label=\"Active User Status\" formControlName=\"user_isactive\"\n class=\"tw-h-5 tw-accent-blue-500 tw-rounded tw-mb-1\" />\n <span class=\"tw-font-semibold tw-text-gray-700 tw-text-base\"></span>\n <span class=\"tw-text-sm tw-text-gray-600 tw-mt-1 tw-leading-relaxed\">Enable this user account for system\n access and operations</span>\n </label>\n </div>\n </div>\n </div>\n }\n\n @case ('auth') {\n <!-- Authentication Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n <!-- Password Fields -->\n @if (shouldShowPasswordFields()) {\n <div class=\"tw-mb-6\">\n <!-- Password Fields Header for Edit Mode -->\n @if (isEditMode()) {\n <div class=\"tw-flex tw-items-center tw-justify-between tw-mb-3\">\n <h6 class=\"tw-text-sm tw-font-semibold tw-text-gray-800\">Update Password</h6>\n <button type=\"button\"\n class=\"tw-px-3 tw-py-1 tw-bg-gray-100 tw-text-gray-600 tw-border tw-border-gray-300 tw-rounded-md tw-text-xs tw-font-medium hover:tw-bg-gray-200 tw-transition-colors\"\n (click)=\"cancelPasswordUpdate()\">\n Cancel Password Update\n </button>\n </div>\n }\n\n <div class=\"tw-grid tw-grid-cols-1 lg:tw-grid-cols-2 md:tw-grid-cols-1 tw-gap-6\">\n <cide-ele-input id=\"user_password\" [label]=\"getPasswordFieldLabel()\" formControlName=\"user_password\"\n type=\"password\" placeholder=\"Enter secure password (min 8 characters)\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input id=\"user_confirm_password\" [label]=\"getPasswordConfirmLabel()\"\n formControlName=\"user_confirm_password\" type=\"password\" placeholder=\"Confirm your password\" size=\"md\">\n </cide-ele-input>\n </div>\n </div>\n }\n\n <!-- Password Update Option for Edit Mode -->\n @if (isEditMode() && !shouldShowPasswordFields()) {\n <div class=\"tw-mb-6\">\n <div class=\"tw-p-4 tw-bg-blue-50 tw-border tw-border-blue-200 tw-rounded-lg\">\n <h6 class=\"tw-text-sm tw-font-semibold tw-text-blue-800 tw-mb-2\">Password Update</h6>\n <p class=\"tw-text-sm tw-text-blue-600 tw-mb-3\">Current password will be kept. Click below to change\n password.</p>\n\n @if (hasPasswordInput()) {\n <div\n class=\"tw-mb-3 tw-p-2 tw-bg-yellow-50 tw-border tw-border-yellow-200 tw-rounded tw-text-sm tw-text-yellow-700\">\n <cide-ele-icon variant=\"yellow\" size=\"xs\" class=\"tw-mr-1\">warning</cide-ele-icon>\n Password fields contain text. Click \"Change Password\" to manage existing input.\n </div>\n }\n\n <button type=\"button\"\n class=\"tw-px-4 tw-py-2 tw-bg-blue-100 tw-text-blue-700 tw-border tw-border-blue-300 tw-rounded-md tw-text-sm tw-font-medium hover:tw-bg-blue-200 tw-transition-colors\"\n (click)=\"triggerPasswordUpdate()\">\n @if (hasPasswordInput()) {\n Manage Password Fields\n } @else {\n Change Password\n }\n </button>\n </div>\n </div>\n }\n\n <!-- Password Options -->\n <div class=\"tw-grid tw-grid-cols-1 tw-gap-6 tw-mb-6\">\n <div class=\"tw-p-4 tw-bg-yellow-50 tw-border tw-border-yellow-100 tw-rounded-lg\">\n <label\n class=\"tw-flex tw-flex-col tw-gap-2 tw-cursor-pointer tw-py-2 tw-bg-transparent tw-border-none tw-rounded-none tw-transition-all tw-duration-200\">\n <cide-ele-input type=\"checkbox\" label=\"Force Password Change on Login\"\n formControlName=\"user_passwordchangeonlogin\" class=\"tw-h-5 tw-accent-yellow-500 tw-rounded tw-mb-1\" />\n <span class=\"tw-text-sm tw-text-gray-600 tw-mt-1 tw-leading-relaxed\">User will be required to change\n password on next login</span>\n </label>\n </div>\n </div>\n\n <!-- Photo Upload -->\n <div class=\"tw-grid tw-grid-cols-1 tw-gap-6 tw-mb-6\">\n <div class=\"tw-bg-gray-50 tw-border tw-border-gray-200 tw-rounded-lg tw-p-4\">\n <h6 class=\"tw-text-sm tw-font-semibold tw-text-gray-800 tw-mb-3\">Profile Photo</h6>\n <div class=\"tw-flex tw-flex-col tw-items-center tw-gap-4\">\n <cide-ele-file-input id=\"user_photo_upload\" formControlName=\"user_photo_id_cyfm\" accept=\"image/*\"\n [showPreview]=\"true\" [previewBoxMode]=\"true\" previewWidth=\"150px\" previewHeight=\"150px\"\n placeholderText=\"Click to upload photo\" placeholderIcon=\"\uD83D\uDC64\">\n </cide-ele-file-input>\n <div class=\"tw-text-xs tw-text-gray-500 tw-text-center tw-max-w-sm\">\n Supported formats: JPG, PNG, GIF. Maximum size: 2MB. Recommended size: 150x150px for best results.\n </div>\n </div>\n </div>\n </div>\n </div>\n }\n\n @case ('roles') {\n <!-- Entity, Roles & Permissions Mapping Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n\n\n\n <!-- Important Note -->\n <div class=\"tw-bg-amber-50 tw-border tw-border-amber-200 tw-rounded-lg tw-p-4 tw-mb-6\">\n <div class=\"tw-flex tw-items-start tw-gap-3\">\n <cide-ele-icon variant=\"amber\" size=\"lg\">info</cide-ele-icon>\n <div class=\"tw-flex-1\">\n <h4 class=\"tw-text-sm tw-font-semibold tw-text-amber-800 tw-mb-1\">Entity-Role Based Access</h4>\n <p class=\"tw-text-sm tw-text-amber-700 tw-mb-2\">User access is completely managed through entity-role\n mappings below. At least one entity mapping is required for user access.</p>\n @if (hasDefaultEntity()) {\n <div class=\"tw-flex tw-items-center tw-gap-2 tw-mt-2 tw-p-2 tw-bg-amber-100 tw-rounded\">\n <cide-ele-icon variant=\"amber\" size=\"sm\">star</cide-ele-icon>\n <span class=\"tw-text-sm tw-text-amber-800\">\n <strong>Default Entity:</strong> {{ getDefaultEntityName() }}\n </span>\n </div>\n } @else {\n <div class=\"tw-text-sm tw-text-amber-600 tw-mt-2 tw-italic\">\n \u26A0\uFE0F No default entity selected. Please set one entity as default.\n </div>\n }\n </div>\n </div>\n </div>\n\n <!-- Entity-Role Mapping Section -->\n <div class=\"tw-bg-blue-50 tw-border tw-border-blue-200 tw-rounded-lg tw-p-6 tw-mb-6\">\n <div class=\"tw-flex tw-text-center tw-justify-between tw-items-center tw-mb-4\">\n <div>\n <h4 class=\"tw-text-sm tw-text-left tw-font-semibold tw-text-blue-900 tw-mb-1\">Entity-Role Mapping</h4>\n <p class=\"tw-text-sm tw-text-blue-700\">Map user to entities with specific roles and permissions</p>\n </div>\n <div class=\"tw-flex tw-flex-col tw-items-end\">\n <button cideEleButton variant=\"primary\" size=\"md\" type=\"button\" (click)=\"addEntityMapping()\" leftIcon=\"add\"\n [disabled]=\"isAllEntitiesMapped()\">\n Add Entity Mapping\n </button>\n \n @if (isAllEntitiesMapped()) {\n <div class=\"tw-mt-2 tw-p-2 tw-bg-blue-50 tw-border tw-border-blue-200 tw-rounded-md tw-max-w-xs\">\n <p class=\"tw-text-xs tw-text-blue-700\">\n <cide-ele-icon variant=\"info\" size=\"xs\" class=\"tw-mr-1\">info</cide-ele-icon>\n All available entities are already mapped.\n </p>\n </div>\n }\n </div>\n </div>\n\n <div formArrayName=\"core_entity_mapping\">\n @for (mapping of entityMappings(); track $index; let i = $index) {\n <div class=\"tw-bg-white tw-border tw-border-blue-200 tw-rounded-xl tw-mb-6 tw-overflow-hidden tw-shadow-sm\"\n [formGroupName]=\"i\">\n <div\n class=\"tw-bg-gradient-to-r tw-from-blue-50 tw-to-blue-100 tw-px-6 tw-py-3 tw-flex tw-justify-between tw-items-center tw-border-b tw-border-blue-200\">\n <div class=\"tw-flex tw-items-center tw-gap-2\">\n <h5 class=\"tw-m-0 tw-text-blue-800 tw-text-sm tw-font-semibold\">Entity Mapping {{ i + 1 }}</h5>\n @if (mapping.syenm_isdefault) {\n <span\n class=\"tw-inline-flex tw-items-center tw-px-2 tw-py-1 tw-rounded-full tw-text-xs tw-font-medium tw-bg-green-100 tw-text-green-800\">\n <cide-ele-icon variant=\"green\" size=\"xs\" class=\"tw-mr-1\">star</cide-ele-icon>\n Default\n </span>\n }\n </div>\n <button cideEleButton variant=\"danger\" size=\"sm\" type=\"button\" (click)=\"removeEntityMapping(i)\"\n leftIcon=\"delete\">\n Remove\n </button>\n </div>\n\n <div class=\"tw-p-6\">\n <!-- Entity and Role Selection -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <div>\n <cide-ele-select label=\"Entity *\" [options]=\"getFilteredEntityOptions(i)\" formControlName=\"syenm_entity_id_syen\"\n valueKey=\"_id\" labelKey=\"syen_name\" placeholder=\"Select entity\" size=\"md\"\n (change)=\"onEntityChange(i, $event)\">\n </cide-ele-select>\n \n @if (isAllEntitiesSelected(i)) {\n <div class=\"tw-mt-2 tw-p-2 tw-bg-yellow-50 tw-border tw-border-yellow-200 tw-rounded-md\">\n <p class=\"tw-text-xs tw-text-yellow-700\">\n <cide-ele-icon variant=\"warning\" size=\"xs\" class=\"tw-mr-1\">info</cide-ele-icon>\n All entities are already mapped. Remove another mapping to add this one.\n </p>\n </div>\n }\n </div>\n\n <cide-ele-select label=\"Role for this Entity\" [options]=\"getRoleOptionsForEntity(i)\"\n formControlName=\"syenm_role_id_syusrol\" placeholder=\"Select role for this entity\" size=\"md\">\n </cide-ele-select>\n </div>\n\n <!-- Entity-Specific Details -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-select label=\"Department for this Entity\" [options]=\"getDepartmentOptionsForEntity(i)\"\n formControlName=\"syenm_department_id_sydept\" (change)=\"onDepartmentChange($event)\" valueKey=\"_id\" labelKey=\"sydept_name\" placeholder=\"Select department\" size=\"md\">\n </cide-ele-select>\n\n <cide-ele-select label=\"Designation for this Entity\" [options]=\"getDesignationOptionsForEntity(i)\" valueKey=\"_id\" labelKey=\"sydsg_name\"\n formControlName=\"syenm_designation_id_sydsg\" placeholder=\"Select designation\" size=\"md\">\n </cide-ele-select>\n </div>\n\n <!-- Active Period for Entity Mapping -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input label=\"Active From *\" [id]=\"'syenm_activefrom['+i+']'\"\n formControlName=\"syenm_activefrom\" type=\"date\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input label=\"Active Until\" [id]=\"'syenm_activeupto['+i+']'\"\n formControlName=\"syenm_activeupto\" type=\"date\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <!-- Mapping Settings -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-3 tw-gap-6 tw-mb-6\">\n <div class=\"tw-p-3 tw-bg-green-50 tw-border tw-border-green-200 tw-rounded-lg\">\n <cide-ele-input type=\"checkbox\" label=\"Default Entity\" formControlName=\"syenm_isdefault\"\n (change)=\"onDefaultEntityChange(i, $event)\" class=\"tw-h-5 tw-accent-green-500\" />\n <span class=\"tw-text-xs tw-text-green-600 tw-block tw-mt-1\">Set as user's default entity (only one\n allowed)</span>\n </div>\n\n <div class=\"tw-p-3 tw-bg-blue-50 tw-border tw-border-blue-200 tw-rounded-lg\">\n <cide-ele-input type=\"checkbox\" label=\"Active Mapping\" formControlName=\"syenm_isactive\"\n class=\"tw-h-5 tw-accent-blue-500\" />\n <span class=\"tw-text-xs tw-text-blue-600 tw-block tw-mt-1\">Enable this entity mapping</span>\n </div>\n </div>\n\n <!-- Menu Rights Grid for this Entity-Role -->\n <div class=\"tw-border-t tw-border-gray-200 tw-pt-4\">\n <div class=\"tw-flex tw-justify-between tw-items-center tw-mb-4\">\n <h6 class=\"tw-text-sm tw-font-semibold tw-text-gray-800\">Menu Rights & Permissions</h6>\n <div class=\"tw-flex tw-gap-2\">\n <button cideEleButton variant=\"secondary\" size=\"sm\" type=\"button\" (click)=\"refreshMenuRights(i)\"\n leftIcon=\"refresh\">\n Refresh Rights\n </button>\n </div>\n </div>\n\n @if (getMenuRightsForMapping(i).length > 0) {\n <!-- Menu Rights Grid -->\n <div class=\"tw-overflow-x-auto tw-bg-white tw-border tw-border-gray-200 tw-rounded-lg\">\n <table class=\"tw-w-full tw-text-sm\">\n <thead class=\"tw-bg-gray-50 tw-border-b tw-border-gray-200\">\n <tr>\n <th class=\"tw-px-4 tw-py-3 tw-text-left tw-font-medium tw-text-gray-700\">Menu</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Role Rights</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Create</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Read</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Update</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Delete</th>\n <th class=\"tw-px-3 tw-py-3 tw-text-center tw-font-medium tw-text-gray-700\">Exception</th>\n </tr>\n </thead>\n <tbody>\n @for (menuRight of getMenuRightsForMapping(i); track $index; let j = $index) {\n <tr class=\"tw-border-b tw-border-gray-100 hover:tw-bg-gray-50\">\n <td class=\"tw-px-4 tw-py-3 tw-font-medium tw-text-gray-900\">\n {{ menuRight.menu_name }}\n <div class=\"tw-text-xs tw-text-gray-500\">{{ menuRight.menu_code }}</div>\n </td>\n\n <!-- Role Rights Display -->\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n <div class=\"tw-flex tw-flex-wrap tw-justify-center tw-gap-1\">\n @for (right of menuRight.role_rights; track $index) {\n <span\n class=\"tw-inline-block tw-px-2 tw-py-1 tw-text-xs tw-bg-blue-100 tw-text-blue-800 tw-rounded\">\n {{ right }}\n </span>\n }\n </div>\n </td>\n\n <!-- Individual Permission Controls -->\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n <cide-ele-input type=\"checkbox\"\n [formControlName]=\"'core_entity_mapping.' + i + '.menu_rights.' + j + '.create'\"\n class=\"tw-h-4 tw-accent-green-500\" />\n </td>\n\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n <cide-ele-input type=\"checkbox\"\n [formControlName]=\"'core_entity_mapping.' + i + '.menu_rights.' + j + '.read'\"\n class=\"tw-h-4 tw-accent-blue-500\" />\n </td>\n\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n <cide-ele-input type=\"checkbox\"\n [formControlName]=\"'core_entity_mapping.' + i + '.menu_rights.' + j + '.update'\"\n class=\"tw-h-4 tw-accent-yellow-500\" />\n </td>\n\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n <cide-ele-input type=\"checkbox\"\n [formControlName]=\"'core_entity_mapping.' + i + '.menu_rights.' + j + '.delete'\"\n class=\"tw-h-4 tw-accent-red-500\" />\n </td>\n\n <td class=\"tw-px-3 tw-py-3 tw-text-center\">\n @if (hasExceptionForMenu(i, menuRight.menu_id)) {\n <span\n class=\"tw-inline-block tw-px-2 tw-py-1 tw-text-xs tw-bg-yellow-100 tw-text-yellow-800 tw-rounded\">\n Override\n </span>\n } @else {\n <span class=\"tw-text-xs tw-text-gray-400\">Default</span>\n }\n </td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <!-- Legend -->\n <div class=\"tw-mt-4 tw-p-3 tw-bg-gray-50 tw-rounded-lg\">\n <h6 class=\"tw-text-xs tw-font-semibold tw-text-gray-700 tw-mb-2\">Legend:</h6>\n <div class=\"tw-grid tw-grid-cols-2 md:tw-grid-cols-4 tw-gap-3 tw-text-xs tw-text-gray-600\">\n <div><span class=\"tw-w-3 tw-h-3 tw-bg-blue-100 tw-inline-block tw-rounded tw-mr-2\"></span>Role\n Rights: Inherited from role</div>\n <div><span\n class=\"tw-w-3 tw-h-3 tw-bg-yellow-100 tw-inline-block tw-rounded tw-mr-2\"></span>Override:\n User-specific exception</div>\n <div><span\n class=\"tw-w-3 tw-h-3 tw-bg-green-100 tw-inline-block tw-rounded tw-mr-2\"></span>Enabled:\n Permission granted</div>\n <div><span\n class=\"tw-w-3 tw-h-3 tw-bg-gray-100 tw-inline-block tw-rounded tw-mr-2\"></span>Disabled:\n Permission restricted</div>\n </div>\n </div>\n\n } @else {\n <div class=\"tw-text-center tw-py-8 tw-bg-gray-50 tw-border tw-border-gray-200 tw-rounded-lg\">\n <div class=\"tw-text-gray-400 tw-mb-3\">\n <cide-ele-icon variant=\"gray\" size=\"lg\">menu</cide-ele-icon>\n </div>\n <h6 class=\"tw-text-sm tw-font-medium tw-text-gray-600 tw-mb-2\">No Menu Rights Available</h6>\n <p class=\"tw-text-xs tw-text-gray-500 tw-mb-3 tw-text-center\">Select both entity and role to load\n menu rights for this mapping.</p>\n @if (mapping.syenm_entity_id_syen?._id && mapping.syenm_role_id_syusrol) {\n <button cideEleButton variant=\"primary\" size=\"sm\" type=\"button\" (click)=\"loadMenuRights(i)\"\n leftIcon=\"refresh\">\n Load Menu Rights\n </button>\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n </div>\n\n @if (entityMappings().length === 0) {\n <div class=\"tw-text-center tw-py-8 tw-bg-white tw-border tw-border-blue-200 tw-rounded-lg\">\n <div class=\"tw-text-blue-400 tw-mb-3\">\n <cide-ele-icon variant=\"blue\" size=\"lg\">business</cide-ele-icon>\n </div>\n <h4 class=\"tw-text-sm tw-font-medium tw-text-blue-800 tw-mb-2\">No Entity Mappings</h4>\n <p class=\"tw-text-blue-600 tw-mb-4 tw-text-center\">Add entity mappings to assign specific roles and\n permissions for different entities.</p>\n <button class=\"tw-mx-auto\" cideEleButton variant=\"primary\" size=\"md\" type=\"button\"\n (click)=\"addEntityMapping()\" leftIcon=\"add\">\n Add First Entity Mapping\n </button>\n </div>\n }\n </div>\n\n\n </div>\n }\n\n @case ('addresses') {\n <!-- Contact Addresses Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n <div class=\"tw-flex tw-justify-end\">\n <div class=\"tw-flex tw-justify-between tw-items-end tw-mb-2 tw-gap-4\">\n <button cideEleButton variant=\"primary\" size=\"md\" type=\"button\" (click)=\"addContactAddress()\"\n leftIcon=\"add\">\n Add New Address\n </button>\n </div>\n </div>\n\n <div formArrayName=\"core_user_contact_addresses\">\n @for (address of contactAddresses(); track $index; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"tw-bg-white tw-border tw-border-gray-200 tw-rounded-xl tw-mb-8 tw-overflow-hidden tw-transition-all tw-duration-300 hover:tw-shadow-lg tw-shadow-sm\">\n <div\n class=\"tw-bg-gradient-to-r tw-from-gray-50 tw-to-gray-100 tw-px-6 tw-py-1 tw-flex tw-justify-between tw-items-center tw-border-b tw-border-gray-200\">\n <h4 class=\"tw-m-0 tw-text-gray-700 tw-text-sm tw-font-semibold tw-tracking-tight\">Address {{ i + 1 }}</h4>\n <button cideEleButton variant=\"danger\" size=\"sm\" type=\"button\" (click)=\"removeContactAddress(i)\"\n leftIcon=\"delete\">\n Remove\n </button>\n </div>\n <div class=\"tw-p-6\">\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-select label=\"Address Type\" [options]=\"addressTypeOptions()\" id=\"sycad_address_type_id_sygms\"\n formControlName=\"sycad_address_type_id_sygms\" placeholder=\"Select address type\" size=\"md\"\n valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n\n <cide-ele-input label=\"Contact Person Name\" formControlName=\"sycad_contact_person_name\"\n placeholder=\"Enter contact person name\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 tw-mb-6\">\n <cide-ele-textarea label=\"Complete Address\" formControlName=\"sycad_contact_address\"\n placeholder=\"Enter complete address with area, city, and landmarks\" [rows]=\"3\" size=\"md\">\n </cide-ele-textarea>\n </div>\n\n <!-- Postal Code & City -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-select \n label=\"Postal Code\"\n [options]=\"addressPostalCodes()[i] || []\" \n formControlName=\"sycad_contact_pin_sypin\"\n placeholder=\"Select postal code\"\n [searchable]=\"true\"\n [loading]=\"addressPostalCodesLoading()[i] || false\"\n (searchChange)=\"onPostalCodeSearch($event, i)\"\n (change)=\"onPostalCodeSelection($event, i)\"\n size=\"md\">\n </cide-ele-select>\n \n <cide-ele-input \n label=\"City\" \n formControlName=\"sycad_contact_city_sypin\"\n placeholder=\"Enter city\"\n size=\"md\">\n </cide-ele-input>\n </div>\n \n <!-- State & Country -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input \n label=\"State\" \n formControlName=\"sycad_contact_state_sypin\"\n placeholder=\"Enter state\"\n size=\"md\">\n </cide-ele-input>\n\n <cide-ele-select \n label=\"Country\" \n [options]=\"addressCountries()[i] || []\" \n formControlName=\"sycad_contact_country_syctr\"\n placeholder=\"Select country\"\n valueKey=\"_id\"\n labelKey=\"syctr_country_iso_name\"\n [searchable]=\"true\"\n (searchChange)=\"onCountrySearch($event, i)\"\n [loading]=\"addressCountriesLoading()[i] || false\"\n size=\"md\">\n </cide-ele-select>\n </div>\n\n <!-- Phone Numbers -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input \n label=\"Primary Phone\" \n formControlName=\"sycad_contact_phone\"\n type=\"tel\"\n placeholder=\"Enter primary phone number\"\n size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input \n label=\"Alternate Phone\" \n formControlName=\"sycad_contact_phone_alt\"\n type=\"tel\"\n placeholder=\"Enter alternate phone number\"\n size=\"md\">\n </cide-ele-input>\n </div>\n\n <!-- Fax & Email -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input \n label=\"Fax Number\" \n formControlName=\"sycad_contact_fax\"\n placeholder=\"Enter fax number\"\n size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input \n label=\"Primary Email\" \n formControlName=\"sycad_contact_email\"\n type=\"email\"\n placeholder=\"Enter primary email address\"\n size=\"md\">\n </cide-ele-input>\n </div>\n\n <!-- Alternate Email -->\n <div class=\"tw-grid tw-grid-cols-1 tw-mb-6\">\n <cide-ele-input \n label=\"Alternate Email\" \n formControlName=\"sycad_contact_email_alt\"\n type=\"email\"\n placeholder=\"Enter alternate email address\"\n size=\"md\">\n </cide-ele-input>\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n }\n\n @case ('documents') {\n <!-- Documents Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n <div class=\"tw-flex tw-justify-end tw-items-end tw-mb-2 tw-gap-4\">\n <button cideEleButton variant=\"primary\" size=\"md\" type=\"button\" (click)=\"addDocument()\" leftIcon=\"add\">\n Add Document\n </button>\n </div>\n\n <div formArrayName=\"core_user_documents\">\n @for (doc of documents(); track $index; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"tw-bg-white tw-border tw-border-gray-200 tw-rounded-xl tw-mb-8 tw-overflow-hidden tw-transition-all tw-duration-300 hover:tw-shadow-lg tw-shadow-sm\">\n <div\n class=\"tw-bg-gradient-to-r tw-from-gray-50 tw-to-gray-100 tw-px-6 tw-py-1 tw-flex tw-justify-between tw-items-center tw-border-b tw-border-gray-200\">\n <h4 class=\"tw-m-0 tw-text-gray-700 tw-text-sm tw-font-semibold tw-tracking-tight\">Document {{ i + 1 }}</h4>\n <button cideEleButton variant=\"danger\" size=\"sm\" type=\"button\" (click)=\"removeDocument(i)\"\n leftIcon=\"delete\">\n Remove\n </button>\n </div>\n <div class=\"tw-p-6\">\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-select label=\"Document Type\" [options]=\"documentTypeOptions()\"\n formControlName=\"syusd_document_type_id_sygms\"\n placeholder=\"Select document type\" size=\"md\" valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n\n <cide-ele-input label=\"Document Number\" formControlName=\"syusd_doc_number\"\n placeholder=\"Enter document number\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input label=\"Name as per Document\"\n formControlName=\"syusd_doc_name_as_per_doc\"\n placeholder=\"Enter name exactly as shown on document\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-select label=\"Photo Group\" [options]=\"photoGroupOptions()\"\n formControlName=\"syusd_photo_group_id_cyfm\"\n placeholder=\"Select photo group\" size=\"md\" valueKey=\"_id\" labelKey=\"cyfm_name\">\n </cide-ele-select>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input label=\"Issue Date\" formControlName=\"syusd_doc_issue_date\"\n [id]=\"'syusd_doc_issue_date['+i+']'\" type=\"date\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input label=\"Expiry Date\" formControlName=\"syusd_doc_expiry_date\"\n [id]=\"'syusd_doc_expiry_date['+i+']'\" type=\"date\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6\">\n <cide-ele-select label=\"Document Verification Status\" [options]=\"documentVerificationStatusOptions()\"\n formControlName=\"syusd_doc_verification_status_id_sygms\"\n placeholder=\"Select verification status\" size=\"md\" valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n\n <cide-ele-select label=\"Document KYC Status\" [options]=\"documentKycStatusOptions()\"\n formControlName=\"syusd_doc_kyc_status_id_sygms\"\n placeholder=\"Select KYC status\" size=\"md\" valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n }\n\n @case ('family') {\n <!-- Family Details Section -->\n <div class=\"tw-py-2 tw-border-b-0 tw-mb-2\">\n <div class=\"tw-flex tw-justify-end tw-items-end tw-mb-2 tw-gap-4\">\n <button cideEleButton variant=\"primary\" size=\"md\" type=\"button\" (click)=\"addFamilyDetail()\" leftIcon=\"add\">\n Add Family Member\n </button>\n </div>\n\n <div formArrayName=\"core_user_family_details\">\n @for (family of familyDetails(); track $index; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"tw-bg-white tw-border tw-border-gray-200 tw-rounded-xl tw-mb-8 tw-overflow-hidden tw-transition-all tw-duration-300 hover:tw-shadow-lg tw-shadow-sm\">\n <div\n class=\"tw-bg-gradient-to-r tw-from-gray-50 tw-to-gray-100 tw-px-6 tw-py-1 tw-flex tw-justify-between tw-items-center tw-border-b tw-border-gray-200\">\n <h4 class=\"tw-m-0 tw-text-gray-700 tw-text-sm tw-font-semibold tw-tracking-tight\">Family Member {{ i + 1 }}\n </h4>\n <button cideEleButton variant=\"danger\" size=\"sm\" type=\"button\" (click)=\"removeFamilyDetail(i)\"\n leftIcon=\"delete\">\n Remove\n </button>\n </div>\n <div class=\"tw-p-6\">\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input label=\"Family Member Name\"\n formControlName=\"syfdl_family_member_name\"\n placeholder=\"Enter family member full name\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-select \n label=\"Family Member User\"\n [options]=\"userOptions(i)\"\n formControlName=\"syfdl_family_member_id_user\"\n placeholder=\"Select family member user\" \n size=\"md\" \n valueKey=\"_id\" \n labelKey=\"user_fullname\"\n [searchable]=\"true\"\n [loading]=\"userSearchLoading()[i] || false\"\n (searchChange)=\"onUserSearchChange($event, i)\"\n (change)=\"onUserSelectionChange($event, i)\">\n </cide-ele-select>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-select label=\"Relationship\" [options]=\"relationshipOptions()\"\n formControlName=\"syfdl_relationship_id_sygms\"\n placeholder=\"Select relationship\" size=\"md\" valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n\n <cide-ele-select label=\"Blood Group\" [options]=\"bloodGroupOptions()\"\n formControlName=\"syfdl_blood_group_sygms\"\n placeholder=\"Select blood group\" size=\"md\" valueKey=\"_id\" labelKey=\"sygms_title\">\n </cide-ele-select>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input label=\"Date of Birth\"\n formControlName=\"syfdl_family_member_dob\" type=\"date\" size=\"md\"\n [id]=\"'syfdl_family_member_dob['+i+']'\">\n </cide-ele-input>\n\n <cide-ele-input label=\"Contact Phone\"\n formControlName=\"syfdl_contact_phone\"\n type=\"tel\" placeholder=\"Enter contact phone\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6 tw-mb-6\">\n <cide-ele-input label=\"Contact Email\" formControlName=\"syfdl_contact_email\"\n type=\"email\" placeholder=\"Enter contact email\" size=\"md\">\n </cide-ele-input>\n\n <cide-ele-input label=\"Contact Email ID\" formControlName=\"syfdl_contact_email_id\"\n type=\"email\" placeholder=\"Enter contact email ID\" size=\"md\">\n </cide-ele-input>\n </div>\n\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6\">\n <cide-ele-input label=\"Contact Number\" formControlName=\"syfdl_contact_number\"\n type=\"tel\" placeholder=\"Enter contact number\" size=\"md\">\n </cide-ele-input>\n\n <div class=\"tw-flex tw-items-center tw-pt-6\">\n <cide-ele-input \n formControlName=\"syfdl_isactive\"\n type=\"checkbox\"\n label=\"Active\"\n size=\"md\">\n </cide-ele-input>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n }\n }\n </div>\n\n <!-- Form Actions -->\n <div\n class=\"tw-flex tw-justify-end tw-gap-4 tw-py-2 tw-bg-white tw-border-t tw-border-gray-200 tw-sticky tw-bottom-0 tw-z-10\">\n <button cideEleButton type=\"button\" variant=\"secondary\" (click)=\"resetForm()\" leftIcon=\"refresh\"\n [disabled]=\"loading()\">\n Reset Form\n </button>\n\n <button cideEleButton type=\"submit\" variant=\"primary\" [disabled]=\"loading() || userMasterForm.invalid\"\n [loading]=\"loading()\" leftIcon=\"save\">\n Save User Master\n </button>\n </div>\n </form>\n</div>" }]
|
|
11995
12096
|
}], ctorParameters: () => [] });
|
|
11996
12097
|
|
|
11997
12098
|
var userCreate_component = /*#__PURE__*/Object.freeze({
|