cloud-ide-core 0.0.1 → 1.0.2
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/README.md +49 -10
- package/fesm2022/cloud-ide-core-general-master-type.component-BNYoP_bS.mjs +609 -0
- package/fesm2022/cloud-ide-core-general-master-type.component-BNYoP_bS.mjs.map +1 -0
- package/fesm2022/cloud-ide-core-general-master-type.service-8JWTVijZ.mjs +206 -0
- package/fesm2022/cloud-ide-core-general-master-type.service-8JWTVijZ.mjs.map +1 -0
- package/fesm2022/cloud-ide-core-general-master.component-CFGGHinl.mjs +901 -0
- package/fesm2022/cloud-ide-core-general-master.component-CFGGHinl.mjs.map +1 -0
- package/fesm2022/cloud-ide-core-page-form.component-vfE-LkTS.mjs +215 -0
- package/fesm2022/cloud-ide-core-page-form.component-vfE-LkTS.mjs.map +1 -0
- package/fesm2022/cloud-ide-core.mjs +1280 -1105
- package/fesm2022/cloud-ide-core.mjs.map +1 -1
- package/index.d.ts +1736 -3
- package/package.json +3 -5
- package/esm2022/cloud-ide-core.mjs +0 -5
- package/esm2022/lib/cloud-ide-core.component.mjs +0 -19
- package/esm2022/lib/cloud-ide-core.service.mjs +0 -14
- package/esm2022/lib/core/department-management/components/department-list/department-list.component.mjs +0 -768
- package/esm2022/lib/core/department-management/index.mjs +0 -5
- package/esm2022/lib/core/department-management/services/department-management.service.mjs +0 -187
- package/esm2022/lib/core/designation-management/components/designation-list/designation-list.component.mjs +0 -1122
- package/esm2022/lib/core/designation-management/index.mjs +0 -5
- package/esm2022/lib/core/designation-management/services/designation-management.service.mjs +0 -194
- package/esm2022/lib/core/grade-level-management/components/grade-level-list/grade-level-list.component.mjs +0 -794
- package/esm2022/lib/core/grade-level-management/index.mjs +0 -5
- package/esm2022/lib/core/grade-level-management/services/grade-level-management.service.mjs +0 -172
- package/esm2022/lib/core/menu-management/components/menu-list/menu-list.component.mjs +0 -1135
- package/esm2022/lib/core/menu-management/index.mjs +0 -10
- package/esm2022/lib/core/menu-management/interfaces/menu-item.interface.mjs +0 -11
- package/esm2022/lib/core/menu-management/mock-data/menu-items.json +0 -311
- package/esm2022/lib/core/menu-management/services/menu-management.service.mjs +0 -230
- package/esm2022/lib/core/page-management/components/page-controls/page-controls.component.mjs +0 -483
- package/esm2022/lib/core/page-management/components/page-list/page-list.component.mjs +0 -393
- package/esm2022/lib/core/page-management/components/page-theme/page-theme.component.mjs +0 -767
- package/esm2022/lib/core/page-management/index.mjs +0 -10
- package/esm2022/lib/core/page-management/services/page-controls.service.mjs +0 -136
- package/esm2022/lib/core/page-management/services/page-management.service.mjs +0 -98
- package/esm2022/lib/core/page-management/services/page-theme.service.mjs +0 -107
- package/esm2022/public-api.mjs +0 -16
- package/lib/cloud-ide-core.component.d.ts +0 -5
- package/lib/cloud-ide-core.service.d.ts +0 -6
- package/lib/core/department-management/components/department-list/department-list.component.d.ts +0 -178
- package/lib/core/department-management/index.d.ts +0 -2
- package/lib/core/department-management/services/department-management.service.d.ts +0 -68
- package/lib/core/designation-management/components/designation-list/designation-list.component.d.ts +0 -242
- package/lib/core/designation-management/index.d.ts +0 -2
- package/lib/core/designation-management/services/designation-management.service.d.ts +0 -69
- package/lib/core/grade-level-management/components/grade-level-list/grade-level-list.component.d.ts +0 -199
- package/lib/core/grade-level-management/index.d.ts +0 -2
- package/lib/core/grade-level-management/services/grade-level-management.service.d.ts +0 -69
- package/lib/core/menu-management/components/menu-list/menu-list.component.d.ts +0 -278
- package/lib/core/menu-management/index.d.ts +0 -3
- package/lib/core/menu-management/interfaces/menu-item.interface.d.ts +0 -30
- package/lib/core/menu-management/services/menu-management.service.d.ts +0 -85
- package/lib/core/page-management/components/page-controls/page-controls.component.d.ts +0 -126
- package/lib/core/page-management/components/page-list/page-list.component.d.ts +0 -91
- package/lib/core/page-management/components/page-theme/page-theme.component.d.ts +0 -189
- package/lib/core/page-management/index.d.ts +0 -6
- package/lib/core/page-management/services/page-controls.service.d.ts +0 -54
- package/lib/core/page-management/services/page-management.service.d.ts +0 -42
- package/lib/core/page-management/services/page-theme.service.d.ts +0 -43
- package/public-api.d.ts +0 -7
|
@@ -13,12 +13,149 @@ import * as i1 from '@angular/common/http';
|
|
|
13
13
|
import { CideEleDataGridComponent, CideEleButtonComponent, CideInputComponent, CideSelectComponent, CideTextareaComponent, CideIconComponent, CideEleDropdownComponent, ConfirmationService, NotificationService, CideEleGlobalNotificationsComponent, CideEleJsonEditorComponent, CideSelectOptionComponent } from 'cloud-ide-element';
|
|
14
14
|
import { AppStateHelperService } from 'cloud-ide-layout';
|
|
15
15
|
|
|
16
|
+
const coreRoutes = [
|
|
17
|
+
{
|
|
18
|
+
path: 'menu-management',
|
|
19
|
+
loadComponent: () => Promise.resolve().then(function () { return menuList_component; }).then(c => c.MenuListComponent),
|
|
20
|
+
title: 'Menu Management',
|
|
21
|
+
data: {
|
|
22
|
+
reuseTab: true,
|
|
23
|
+
sypg_page_code: "core_menu_list"
|
|
24
|
+
}
|
|
25
|
+
}, {
|
|
26
|
+
path: 'department',
|
|
27
|
+
loadComponent: () => Promise.resolve().then(function () { return departmentList_component; }).then(c => c.DepartmentListComponent),
|
|
28
|
+
title: 'Department Management',
|
|
29
|
+
data: {
|
|
30
|
+
reuseTab: true,
|
|
31
|
+
sypg_page_code: "core_department_list"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
path: 'designation',
|
|
36
|
+
loadComponent: () => Promise.resolve().then(function () { return designationList_component; }).then(c => c.DesignationListComponent),
|
|
37
|
+
title: 'Designation Management',
|
|
38
|
+
data: {
|
|
39
|
+
reuseTab: true,
|
|
40
|
+
sypg_page_code: "core_designation_list"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
path: 'grade-level',
|
|
45
|
+
loadComponent: () => Promise.resolve().then(function () { return gradeLevelList_component; }).then(c => c.GradeLevelListComponent),
|
|
46
|
+
title: 'Grade Level Management',
|
|
47
|
+
data: {
|
|
48
|
+
reuseTab: true,
|
|
49
|
+
sypg_page_code: "core_grade_level_list"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
path: 'page',
|
|
54
|
+
loadComponent: () => Promise.resolve().then(function () { return pageList_component; }).then(c => c.PageListComponent),
|
|
55
|
+
title: 'Page Management',
|
|
56
|
+
data: {
|
|
57
|
+
reuseTab: true,
|
|
58
|
+
sypg_page_code: "core_page_management"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
path: 'page-form',
|
|
63
|
+
loadComponent: () => import('./cloud-ide-core-page-form.component-vfE-LkTS.mjs').then(c => c.PageFormComponent),
|
|
64
|
+
title: 'Page Form',
|
|
65
|
+
data: {
|
|
66
|
+
reuseTab: true,
|
|
67
|
+
sypg_page_code: "core_page_management"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
path: 'page-form/:query',
|
|
72
|
+
loadComponent: () => import('./cloud-ide-core-page-form.component-vfE-LkTS.mjs').then(c => c.PageFormComponent),
|
|
73
|
+
title: 'Page Form',
|
|
74
|
+
data: {
|
|
75
|
+
reuseTab: true,
|
|
76
|
+
sypg_page_code: "core_page_management"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
path: 'page-theme',
|
|
81
|
+
loadComponent: () => Promise.resolve().then(function () { return pageTheme_component; }).then(c => c.PageThemeComponent),
|
|
82
|
+
title: 'Page Theme Management',
|
|
83
|
+
data: {
|
|
84
|
+
reuseTab: true,
|
|
85
|
+
sypg_page_code: "core_page_theme"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
path: 'page-theme/:query',
|
|
90
|
+
loadComponent: () => Promise.resolve().then(function () { return pageTheme_component; }).then(c => c.PageThemeComponent),
|
|
91
|
+
title: 'Page Theme Management',
|
|
92
|
+
data: {
|
|
93
|
+
reuseTab: true,
|
|
94
|
+
sypg_page_code: "core_page_theme"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
path: 'page-controls',
|
|
99
|
+
loadComponent: () => Promise.resolve().then(function () { return pageControls_component; }).then(c => c.PageControlsComponent),
|
|
100
|
+
title: 'Page Controls Management',
|
|
101
|
+
data: {
|
|
102
|
+
reuseTab: true,
|
|
103
|
+
sypg_page_code: "core_page_controls"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
path: 'page-controls/:query',
|
|
108
|
+
loadComponent: () => Promise.resolve().then(function () { return pageControls_component; }).then(c => c.PageControlsComponent),
|
|
109
|
+
title: 'Page Controls Management',
|
|
110
|
+
data: {
|
|
111
|
+
reuseTab: true,
|
|
112
|
+
sypg_page_code: "core_page_controls"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
path: 'general_master_entry',
|
|
117
|
+
loadComponent: () => import('./cloud-ide-core-general-master.component-CFGGHinl.mjs').then(c => c.GeneralMasterComponent),
|
|
118
|
+
title: 'General Master Entry',
|
|
119
|
+
data: {
|
|
120
|
+
reuseTab: true,
|
|
121
|
+
sypg_page_code: "core_general_master"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
path: 'general_master_entry/:query',
|
|
126
|
+
loadComponent: () => import('./cloud-ide-core-general-master.component-CFGGHinl.mjs').then(c => c.GeneralMasterComponent),
|
|
127
|
+
title: 'General Master Entry',
|
|
128
|
+
data: {
|
|
129
|
+
reuseTab: true,
|
|
130
|
+
sypg_page_code: "core_general_master"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
path: 'general_type_entry',
|
|
135
|
+
loadComponent: () => import('./cloud-ide-core-general-master-type.component-BNYoP_bS.mjs').then(c => c.GeneralMasterTypeComponent),
|
|
136
|
+
title: 'General Type Entry',
|
|
137
|
+
data: {
|
|
138
|
+
reuseTab: true,
|
|
139
|
+
sypg_page_code: "core_general_master_type"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
path: 'general_type_entry/:query',
|
|
144
|
+
loadComponent: () => import('./cloud-ide-core-general-master-type.component-BNYoP_bS.mjs').then(c => c.GeneralMasterTypeComponent),
|
|
145
|
+
title: 'General Type Entry',
|
|
146
|
+
data: {
|
|
147
|
+
reuseTab: true,
|
|
148
|
+
sypg_page_code: "core_general_master_type"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
];
|
|
152
|
+
|
|
16
153
|
class CloudIdeCoreService {
|
|
17
154
|
constructor() { }
|
|
18
|
-
static
|
|
19
|
-
static
|
|
155
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CloudIdeCoreService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
156
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CloudIdeCoreService, providedIn: 'root' });
|
|
20
157
|
}
|
|
21
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
158
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CloudIdeCoreService, decorators: [{
|
|
22
159
|
type: Injectable,
|
|
23
160
|
args: [{
|
|
24
161
|
providedIn: 'root'
|
|
@@ -26,14 +163,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
26
163
|
}], ctorParameters: () => [] });
|
|
27
164
|
|
|
28
165
|
class CloudIdeCoreComponent {
|
|
29
|
-
static
|
|
30
|
-
static
|
|
166
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CloudIdeCoreComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
167
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.7", type: CloudIdeCoreComponent, isStandalone: true, selector: "cide-core", ngImport: i0, template: `
|
|
31
168
|
<p>
|
|
32
169
|
cloud-ide-core works!
|
|
33
170
|
</p>
|
|
34
|
-
`, isInline: true, styles: [""] });
|
|
171
|
+
`, isInline: true, styles: [""] });
|
|
35
172
|
}
|
|
36
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
173
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CloudIdeCoreComponent, decorators: [{
|
|
37
174
|
type: Component,
|
|
38
175
|
args: [{ selector: 'cide-core', standalone: true, imports: [], template: `
|
|
39
176
|
<p>
|
|
@@ -359,11 +496,12 @@ var mockMenuData = {
|
|
|
359
496
|
};
|
|
360
497
|
|
|
361
498
|
class MenuManagementService {
|
|
499
|
+
http;
|
|
500
|
+
apiUrl = `${coreRoutesUrl?.getSidebarMenues}`;
|
|
501
|
+
menuListSubject = new BehaviorSubject([]);
|
|
502
|
+
menuList$ = this.menuListSubject.asObservable();
|
|
362
503
|
constructor(http) {
|
|
363
504
|
this.http = http;
|
|
364
|
-
this.apiUrl = `${coreRoutesUrl?.getSidebarMenues}`;
|
|
365
|
-
this.menuListSubject = new BehaviorSubject([]);
|
|
366
|
-
this.menuList$ = this.menuListSubject.asObservable();
|
|
367
505
|
console.log('MenuManagementService initialized - using real API');
|
|
368
506
|
}
|
|
369
507
|
/**
|
|
@@ -571,10 +709,10 @@ class MenuManagementService {
|
|
|
571
709
|
console.error('Menu Management Service Error:', errorMessage);
|
|
572
710
|
return throwError(() => new Error(errorMessage));
|
|
573
711
|
}
|
|
574
|
-
static
|
|
575
|
-
static
|
|
712
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: MenuManagementService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
713
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: MenuManagementService, providedIn: 'root' });
|
|
576
714
|
}
|
|
577
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
715
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: MenuManagementService, decorators: [{
|
|
578
716
|
type: Injectable,
|
|
579
717
|
args: [{
|
|
580
718
|
providedIn: 'root'
|
|
@@ -582,6 +720,188 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
582
720
|
}], ctorParameters: () => [{ type: i1.HttpClient }] });
|
|
583
721
|
|
|
584
722
|
class MenuListComponent {
|
|
723
|
+
// Dependency injection
|
|
724
|
+
destroyRef = inject(DestroyRef);
|
|
725
|
+
menuService = inject(MenuManagementService);
|
|
726
|
+
fb = inject(NonNullableFormBuilder);
|
|
727
|
+
router = inject(Router);
|
|
728
|
+
// Modern ViewChild signals for template renderers (Angular 20 approach)
|
|
729
|
+
menuDetailsRendererTemplate = viewChild.required('menuDetailsRendererTemplate');
|
|
730
|
+
menuTypeRendererTemplate = viewChild.required('menuTypeRendererTemplate');
|
|
731
|
+
actionsDropdownRendererTemplate = viewChild.required('actionsDropdownRendererTemplate');
|
|
732
|
+
// Make Math available in template
|
|
733
|
+
Math = Math;
|
|
734
|
+
// Signals for reactive state management
|
|
735
|
+
menuItems = signal([], ...(ngDevMode ? [{ debugName: "menuItems" }] : []));
|
|
736
|
+
loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
737
|
+
error = signal(null, ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
738
|
+
selectedItems = signal([], ...(ngDevMode ? [{ debugName: "selectedItems" }] : []));
|
|
739
|
+
searchTerm = signal('', ...(ngDevMode ? [{ debugName: "searchTerm" }] : []));
|
|
740
|
+
// Modern reactive forms with signals
|
|
741
|
+
selectedParentItem = signal(null, ...(ngDevMode ? [{ debugName: "selectedParentItem" }] : []));
|
|
742
|
+
// Retrieved menu item data
|
|
743
|
+
retrievedMenuItem = signal(null, ...(ngDevMode ? [{ debugName: "retrievedMenuItem" }] : []));
|
|
744
|
+
// Edit mode flag
|
|
745
|
+
isEditMode = signal(false, ...(ngDevMode ? [{ debugName: "isEditMode" }] : []));
|
|
746
|
+
// Drag order management
|
|
747
|
+
originalOrder = signal([], ...(ngDevMode ? [{ debugName: "originalOrder" }] : []));
|
|
748
|
+
hasOrderChanged = signal(false, ...(ngDevMode ? [{ debugName: "hasOrderChanged" }] : []));
|
|
749
|
+
// Server-side pagination state
|
|
750
|
+
currentPage = signal(1, ...(ngDevMode ? [{ debugName: "currentPage" }] : []));
|
|
751
|
+
pageSize = signal(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
|
|
752
|
+
totalItems = signal(0, ...(ngDevMode ? [{ debugName: "totalItems" }] : []));
|
|
753
|
+
// Modern reactive form with typed controls
|
|
754
|
+
quickAddForm = this.fb.group({
|
|
755
|
+
syme_title: this.fb.control('', [Validators.required, Validators.minLength(2), Validators.maxLength(100)]),
|
|
756
|
+
syme_desc: this.fb.control('', [Validators.maxLength(255)]),
|
|
757
|
+
syme_type: this.fb.control('module', [Validators.required]),
|
|
758
|
+
syme_id_syme: this.fb.control(''),
|
|
759
|
+
syme_path: this.fb.control('', [Validators.maxLength(255)]),
|
|
760
|
+
syme_icon: this.fb.control('', [Validators.maxLength(50)]),
|
|
761
|
+
syme_link: this.fb.control('', [Validators.maxLength(255)]),
|
|
762
|
+
syme_isactive: this.fb.control(true, [Validators.required]),
|
|
763
|
+
syme_order_by: this.fb.control(1, [Validators.required, Validators.min(1)])
|
|
764
|
+
});
|
|
765
|
+
// Menu type options for quick add - dynamic based on parent selection
|
|
766
|
+
menuTypeOptions = computed(() => {
|
|
767
|
+
if (this.selectedParentItem()) {
|
|
768
|
+
// When parent is selected, allow creating child types only
|
|
769
|
+
return [
|
|
770
|
+
{ value: 'section', label: 'Section' },
|
|
771
|
+
{ value: 'menu', label: 'Menu Item' },
|
|
772
|
+
{ value: 'title', label: 'Title' }
|
|
773
|
+
];
|
|
774
|
+
}
|
|
775
|
+
else {
|
|
776
|
+
// When no parent is selected, only allow module creation
|
|
777
|
+
return [
|
|
778
|
+
{ value: 'module', label: 'Module' }
|
|
779
|
+
];
|
|
780
|
+
}
|
|
781
|
+
}, ...(ngDevMode ? [{ debugName: "menuTypeOptions" }] : []));
|
|
782
|
+
// Grid configuration signal
|
|
783
|
+
gridConfig = signal({
|
|
784
|
+
id: 'menu-list-grid',
|
|
785
|
+
title: '',
|
|
786
|
+
subtitle: '',
|
|
787
|
+
columns: [
|
|
788
|
+
{
|
|
789
|
+
key: 'details',
|
|
790
|
+
header: 'Menu Item',
|
|
791
|
+
type: 'custom',
|
|
792
|
+
width: 'auto',
|
|
793
|
+
truncate: true,
|
|
794
|
+
align: 'left',
|
|
795
|
+
renderer: 'menuDetailsRenderer'
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
key: 'syme_type',
|
|
799
|
+
header: 'Type',
|
|
800
|
+
type: 'custom',
|
|
801
|
+
width: '120px',
|
|
802
|
+
truncate: false,
|
|
803
|
+
align: 'center',
|
|
804
|
+
renderer: 'menuTypeRenderer'
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
key: 'syme_path',
|
|
808
|
+
header: 'Path',
|
|
809
|
+
type: 'text',
|
|
810
|
+
width: '200px',
|
|
811
|
+
truncate: true,
|
|
812
|
+
align: 'left'
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
key: 'syme_order_by',
|
|
816
|
+
header: 'Order',
|
|
817
|
+
type: 'order',
|
|
818
|
+
width: '80px',
|
|
819
|
+
truncate: false,
|
|
820
|
+
align: 'center'
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
key: 'syme_isactive',
|
|
824
|
+
header: 'Status',
|
|
825
|
+
type: 'status',
|
|
826
|
+
width: '100px',
|
|
827
|
+
truncate: false,
|
|
828
|
+
align: 'center',
|
|
829
|
+
statusConfig: {
|
|
830
|
+
activeValue: true,
|
|
831
|
+
activeLabel: 'Active',
|
|
832
|
+
inactiveLabel: 'Inactive',
|
|
833
|
+
activeClass: 'tw-bg-green-100 tw-text-green-800',
|
|
834
|
+
inactiveClass: 'tw-bg-red-100 tw-text-red-800'
|
|
835
|
+
}
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
key: 'actions',
|
|
839
|
+
header: '',
|
|
840
|
+
type: 'custom',
|
|
841
|
+
width: '60px',
|
|
842
|
+
truncate: false,
|
|
843
|
+
align: 'center',
|
|
844
|
+
renderer: 'actionsDropdownRenderer'
|
|
845
|
+
}
|
|
846
|
+
],
|
|
847
|
+
data: [],
|
|
848
|
+
trackBy: '_id',
|
|
849
|
+
pagination: {
|
|
850
|
+
enabled: true,
|
|
851
|
+
pageSize: 10,
|
|
852
|
+
pageSizeOptions: [10, 25, 50, 100],
|
|
853
|
+
showQuickJump: true,
|
|
854
|
+
showPageInfo: true,
|
|
855
|
+
showRefresh: true
|
|
856
|
+
},
|
|
857
|
+
search: {
|
|
858
|
+
enabled: true,
|
|
859
|
+
placeholder: 'Search menu items...',
|
|
860
|
+
searchableColumns: ['syme_title', 'syme_desc', 'syme_path'],
|
|
861
|
+
debounceMs: 300
|
|
862
|
+
},
|
|
863
|
+
loading: {
|
|
864
|
+
useDefer: true,
|
|
865
|
+
skeletonRows: 5,
|
|
866
|
+
showOverlay: false
|
|
867
|
+
},
|
|
868
|
+
scroll: {
|
|
869
|
+
enabled: true,
|
|
870
|
+
maxHeight: '',
|
|
871
|
+
minHeight: '',
|
|
872
|
+
stickyHeader: true,
|
|
873
|
+
virtualScroll: false,
|
|
874
|
+
rowHeight: 50
|
|
875
|
+
},
|
|
876
|
+
dragDrop: {
|
|
877
|
+
enabled: true,
|
|
878
|
+
orderField: 'syme_order_by',
|
|
879
|
+
dragClass: 'tw-opacity-50 tw-bg-blue-50',
|
|
880
|
+
dropClass: 'tw-bg-green-50'
|
|
881
|
+
},
|
|
882
|
+
responsive: true,
|
|
883
|
+
striped: false,
|
|
884
|
+
bordered: true,
|
|
885
|
+
compact: false,
|
|
886
|
+
tableClass: 'tw-table-fixed tw-w-full tw-rounded-none',
|
|
887
|
+
onRefresh: 'onMenuItemRefresh',
|
|
888
|
+
onRowReorder: 'onRowReorder',
|
|
889
|
+
tree: {
|
|
890
|
+
enabled: true,
|
|
891
|
+
primaryKey: '_id',
|
|
892
|
+
foreignKey: 'syme_id_syme',
|
|
893
|
+
childrenKey: 'children',
|
|
894
|
+
levelKey: 'level',
|
|
895
|
+
expandedKey: 'isExpanded',
|
|
896
|
+
hasChildrenKey: 'hasChildren'
|
|
897
|
+
}
|
|
898
|
+
}, ...(ngDevMode ? [{ debugName: "gridConfig" }] : []));
|
|
899
|
+
// Template renderers using Angular best practices
|
|
900
|
+
templateRenderers = computed(() => ({
|
|
901
|
+
menuDetailsRenderer: this.menuDetailsRendererTemplate(),
|
|
902
|
+
menuTypeRenderer: this.menuTypeRendererTemplate(),
|
|
903
|
+
actionsDropdownRenderer: this.actionsDropdownRendererTemplate()
|
|
904
|
+
}), ...(ngDevMode ? [{ debugName: "templateRenderers" }] : []));
|
|
585
905
|
/**
|
|
586
906
|
* Get template renderers for data grid
|
|
587
907
|
* These templates are available for enhanced data grid components
|
|
@@ -589,6 +909,10 @@ class MenuListComponent {
|
|
|
589
909
|
getTemplateRenderers() {
|
|
590
910
|
return this.templateRenderers();
|
|
591
911
|
}
|
|
912
|
+
// Mixed renderers (templates + string functions)
|
|
913
|
+
customRenderers = computed(() => ({
|
|
914
|
+
...this.templateRenderers()
|
|
915
|
+
}), ...(ngDevMode ? [{ debugName: "customRenderers" }] : []));
|
|
592
916
|
/**
|
|
593
917
|
* Get custom renderers adapted for current data grid compatibility
|
|
594
918
|
* Uses template-based renderers converted to string functions
|
|
@@ -597,216 +921,24 @@ class MenuListComponent {
|
|
|
597
921
|
// This method is no longer needed since we're using templates directly
|
|
598
922
|
return {};
|
|
599
923
|
}
|
|
924
|
+
// Action handlers for grid actions
|
|
925
|
+
actionHandlers = {
|
|
926
|
+
onEditMenuItem: (row) => this.editMenuItem(row._id || ''),
|
|
927
|
+
onToggleMenuItem: (row) => this.toggleItemStatus(row._id || ''),
|
|
928
|
+
onDeleteMenuItem: (row) => this.deleteMenuItem(row._id || ''),
|
|
929
|
+
onMenuItemRowClick: (row) => this.onMenuItemRowClick(row),
|
|
930
|
+
onMenuItemRefresh: () => this.onMenuItemRefresh(),
|
|
931
|
+
onAddChild: (row) => this.onAddChild(row),
|
|
932
|
+
resetOrder: () => this.resetDragOrder(),
|
|
933
|
+
saveOrder: () => this.saveMenuOrder()
|
|
934
|
+
};
|
|
935
|
+
hasSelection = computed(() => this.selectedItems().length > 0, ...(ngDevMode ? [{ debugName: "hasSelection" }] : []));
|
|
936
|
+
// Pagination computed properties
|
|
937
|
+
totalPages = computed(() => Math.ceil(this.totalItems() / this.pageSize()), ...(ngDevMode ? [{ debugName: "totalPages" }] : []));
|
|
938
|
+
hasNextPage = computed(() => this.currentPage() < this.totalPages(), ...(ngDevMode ? [{ debugName: "hasNextPage" }] : []));
|
|
939
|
+
hasPreviousPage = computed(() => this.currentPage() > 1, ...(ngDevMode ? [{ debugName: "hasPreviousPage" }] : []));
|
|
600
940
|
// Modern constructor with effects for initialization
|
|
601
941
|
constructor() {
|
|
602
|
-
// Dependency injection
|
|
603
|
-
this.destroyRef = inject(DestroyRef);
|
|
604
|
-
this.menuService = inject(MenuManagementService);
|
|
605
|
-
this.fb = inject(NonNullableFormBuilder);
|
|
606
|
-
this.router = inject(Router);
|
|
607
|
-
// Modern ViewChild signals for template renderers (Angular 20 approach)
|
|
608
|
-
this.menuDetailsRendererTemplate = viewChild.required('menuDetailsRendererTemplate');
|
|
609
|
-
this.menuTypeRendererTemplate = viewChild.required('menuTypeRendererTemplate');
|
|
610
|
-
this.actionsDropdownRendererTemplate = viewChild.required('actionsDropdownRendererTemplate');
|
|
611
|
-
// Make Math available in template
|
|
612
|
-
this.Math = Math;
|
|
613
|
-
// Signals for reactive state management
|
|
614
|
-
this.menuItems = signal([]);
|
|
615
|
-
this.loading = signal(false);
|
|
616
|
-
this.error = signal(null);
|
|
617
|
-
this.selectedItems = signal([]);
|
|
618
|
-
this.searchTerm = signal('');
|
|
619
|
-
// Modern reactive forms with signals
|
|
620
|
-
this.selectedParentItem = signal(null);
|
|
621
|
-
// Retrieved menu item data
|
|
622
|
-
this.retrievedMenuItem = signal(null);
|
|
623
|
-
// Edit mode flag
|
|
624
|
-
this.isEditMode = signal(false);
|
|
625
|
-
// Drag order management
|
|
626
|
-
this.originalOrder = signal([]);
|
|
627
|
-
this.hasOrderChanged = signal(false);
|
|
628
|
-
// Server-side pagination state
|
|
629
|
-
this.currentPage = signal(1);
|
|
630
|
-
this.pageSize = signal(10);
|
|
631
|
-
this.totalItems = signal(0);
|
|
632
|
-
// Modern reactive form with typed controls
|
|
633
|
-
this.quickAddForm = this.fb.group({
|
|
634
|
-
syme_title: this.fb.control('', [Validators.required, Validators.minLength(2), Validators.maxLength(100)]),
|
|
635
|
-
syme_desc: this.fb.control('', [Validators.maxLength(255)]),
|
|
636
|
-
syme_type: this.fb.control('module', [Validators.required]),
|
|
637
|
-
syme_id_syme: this.fb.control(''),
|
|
638
|
-
syme_path: this.fb.control('', [Validators.maxLength(255)]),
|
|
639
|
-
syme_icon: this.fb.control('', [Validators.maxLength(50)]),
|
|
640
|
-
syme_link: this.fb.control('', [Validators.maxLength(255)]),
|
|
641
|
-
syme_isactive: this.fb.control(true, [Validators.required]),
|
|
642
|
-
syme_order_by: this.fb.control(1, [Validators.required, Validators.min(1)])
|
|
643
|
-
});
|
|
644
|
-
// Menu type options for quick add - dynamic based on parent selection
|
|
645
|
-
this.menuTypeOptions = computed(() => {
|
|
646
|
-
if (this.selectedParentItem()) {
|
|
647
|
-
// When parent is selected, allow creating child types only
|
|
648
|
-
return [
|
|
649
|
-
{ value: 'section', label: 'Section' },
|
|
650
|
-
{ value: 'menu', label: 'Menu Item' },
|
|
651
|
-
{ value: 'title', label: 'Title' }
|
|
652
|
-
];
|
|
653
|
-
}
|
|
654
|
-
else {
|
|
655
|
-
// When no parent is selected, only allow module creation
|
|
656
|
-
return [
|
|
657
|
-
{ value: 'module', label: 'Module' }
|
|
658
|
-
];
|
|
659
|
-
}
|
|
660
|
-
});
|
|
661
|
-
// Grid configuration signal
|
|
662
|
-
this.gridConfig = signal({
|
|
663
|
-
id: 'menu-list-grid',
|
|
664
|
-
title: '',
|
|
665
|
-
subtitle: '',
|
|
666
|
-
columns: [
|
|
667
|
-
{
|
|
668
|
-
key: 'details',
|
|
669
|
-
header: 'Menu Item',
|
|
670
|
-
type: 'custom',
|
|
671
|
-
width: 'auto',
|
|
672
|
-
truncate: true,
|
|
673
|
-
align: 'left',
|
|
674
|
-
renderer: 'menuDetailsRenderer'
|
|
675
|
-
},
|
|
676
|
-
{
|
|
677
|
-
key: 'syme_type',
|
|
678
|
-
header: 'Type',
|
|
679
|
-
type: 'custom',
|
|
680
|
-
width: '120px',
|
|
681
|
-
truncate: false,
|
|
682
|
-
align: 'center',
|
|
683
|
-
renderer: 'menuTypeRenderer'
|
|
684
|
-
},
|
|
685
|
-
{
|
|
686
|
-
key: 'syme_path',
|
|
687
|
-
header: 'Path',
|
|
688
|
-
type: 'text',
|
|
689
|
-
width: '200px',
|
|
690
|
-
truncate: true,
|
|
691
|
-
align: 'left'
|
|
692
|
-
},
|
|
693
|
-
{
|
|
694
|
-
key: 'syme_order_by',
|
|
695
|
-
header: 'Order',
|
|
696
|
-
type: 'order',
|
|
697
|
-
width: '80px',
|
|
698
|
-
truncate: false,
|
|
699
|
-
align: 'center'
|
|
700
|
-
},
|
|
701
|
-
{
|
|
702
|
-
key: 'syme_isactive',
|
|
703
|
-
header: 'Status',
|
|
704
|
-
type: 'status',
|
|
705
|
-
width: '100px',
|
|
706
|
-
truncate: false,
|
|
707
|
-
align: 'center',
|
|
708
|
-
statusConfig: {
|
|
709
|
-
activeValue: true,
|
|
710
|
-
activeLabel: 'Active',
|
|
711
|
-
inactiveLabel: 'Inactive',
|
|
712
|
-
activeClass: 'tw-bg-green-100 tw-text-green-800',
|
|
713
|
-
inactiveClass: 'tw-bg-red-100 tw-text-red-800'
|
|
714
|
-
}
|
|
715
|
-
},
|
|
716
|
-
{
|
|
717
|
-
key: 'actions',
|
|
718
|
-
header: '',
|
|
719
|
-
type: 'custom',
|
|
720
|
-
width: '60px',
|
|
721
|
-
truncate: false,
|
|
722
|
-
align: 'center',
|
|
723
|
-
renderer: 'actionsDropdownRenderer'
|
|
724
|
-
}
|
|
725
|
-
],
|
|
726
|
-
data: [],
|
|
727
|
-
trackBy: '_id',
|
|
728
|
-
pagination: {
|
|
729
|
-
enabled: true,
|
|
730
|
-
pageSize: 10,
|
|
731
|
-
pageSizeOptions: [10, 25, 50, 100],
|
|
732
|
-
showQuickJump: true,
|
|
733
|
-
showPageInfo: true,
|
|
734
|
-
showRefresh: true
|
|
735
|
-
},
|
|
736
|
-
search: {
|
|
737
|
-
enabled: true,
|
|
738
|
-
placeholder: 'Search menu items...',
|
|
739
|
-
searchableColumns: ['syme_title', 'syme_desc', 'syme_path'],
|
|
740
|
-
debounceMs: 300
|
|
741
|
-
},
|
|
742
|
-
loading: {
|
|
743
|
-
useDefer: true,
|
|
744
|
-
skeletonRows: 5,
|
|
745
|
-
showOverlay: false
|
|
746
|
-
},
|
|
747
|
-
scroll: {
|
|
748
|
-
enabled: true,
|
|
749
|
-
maxHeight: '',
|
|
750
|
-
minHeight: '',
|
|
751
|
-
stickyHeader: true,
|
|
752
|
-
virtualScroll: false,
|
|
753
|
-
rowHeight: 50
|
|
754
|
-
},
|
|
755
|
-
dragDrop: {
|
|
756
|
-
enabled: true,
|
|
757
|
-
orderField: 'syme_order_by',
|
|
758
|
-
dragClass: 'tw-opacity-50 tw-bg-blue-50',
|
|
759
|
-
dropClass: 'tw-bg-green-50'
|
|
760
|
-
},
|
|
761
|
-
responsive: true,
|
|
762
|
-
striped: false,
|
|
763
|
-
bordered: true,
|
|
764
|
-
compact: false,
|
|
765
|
-
tableClass: 'tw-table-fixed tw-w-full tw-rounded-none',
|
|
766
|
-
onRefresh: 'onMenuItemRefresh',
|
|
767
|
-
onRowReorder: 'onRowReorder',
|
|
768
|
-
tree: {
|
|
769
|
-
enabled: true,
|
|
770
|
-
primaryKey: '_id',
|
|
771
|
-
foreignKey: 'syme_id_syme',
|
|
772
|
-
childrenKey: 'children',
|
|
773
|
-
levelKey: 'level',
|
|
774
|
-
expandedKey: 'isExpanded',
|
|
775
|
-
hasChildrenKey: 'hasChildren'
|
|
776
|
-
}
|
|
777
|
-
});
|
|
778
|
-
// Template renderers using Angular best practices
|
|
779
|
-
this.templateRenderers = computed(() => ({
|
|
780
|
-
menuDetailsRenderer: this.menuDetailsRendererTemplate(),
|
|
781
|
-
menuTypeRenderer: this.menuTypeRendererTemplate(),
|
|
782
|
-
actionsDropdownRenderer: this.actionsDropdownRendererTemplate()
|
|
783
|
-
}));
|
|
784
|
-
// Mixed renderers (templates + string functions)
|
|
785
|
-
this.customRenderers = computed(() => ({
|
|
786
|
-
...this.templateRenderers()
|
|
787
|
-
}));
|
|
788
|
-
// Action handlers for grid actions
|
|
789
|
-
this.actionHandlers = {
|
|
790
|
-
onEditMenuItem: (row) => this.editMenuItem(row._id || ''),
|
|
791
|
-
onToggleMenuItem: (row) => this.toggleItemStatus(row._id || ''),
|
|
792
|
-
onDeleteMenuItem: (row) => this.deleteMenuItem(row._id || ''),
|
|
793
|
-
onMenuItemRowClick: (row) => this.onMenuItemRowClick(row),
|
|
794
|
-
onMenuItemRefresh: () => this.onMenuItemRefresh(),
|
|
795
|
-
onAddChild: (row) => this.onAddChild(row),
|
|
796
|
-
resetOrder: () => this.resetDragOrder(),
|
|
797
|
-
saveOrder: () => this.saveMenuOrder()
|
|
798
|
-
};
|
|
799
|
-
this.hasSelection = computed(() => this.selectedItems().length > 0);
|
|
800
|
-
// Pagination computed properties
|
|
801
|
-
this.totalPages = computed(() => Math.ceil(this.totalItems() / this.pageSize()));
|
|
802
|
-
this.hasNextPage = computed(() => this.currentPage() < this.totalPages());
|
|
803
|
-
this.hasPreviousPage = computed(() => this.currentPage() > 1);
|
|
804
|
-
/**
|
|
805
|
-
* Get default type based on parent selection (computed for reactivity)
|
|
806
|
-
*/
|
|
807
|
-
this.getDefaultType = computed(() => {
|
|
808
|
-
return this.selectedParentItem() ? 'section' : 'module';
|
|
809
|
-
});
|
|
810
942
|
// Initialize component once on construction
|
|
811
943
|
this.initializeComponent();
|
|
812
944
|
// Cleanup effect for event listeners
|
|
@@ -847,6 +979,12 @@ class MenuListComponent {
|
|
|
847
979
|
window.handleMenuAction = this.handleMenuAction.bind(this);
|
|
848
980
|
}
|
|
849
981
|
}
|
|
982
|
+
/**
|
|
983
|
+
* Get default type based on parent selection (computed for reactivity)
|
|
984
|
+
*/
|
|
985
|
+
getDefaultType = computed(() => {
|
|
986
|
+
return this.selectedParentItem() ? 'section' : 'module';
|
|
987
|
+
}, ...(ngDevMode ? [{ debugName: "getDefaultType" }] : []));
|
|
850
988
|
/**
|
|
851
989
|
* Load menu items from service
|
|
852
990
|
*/
|
|
@@ -1687,10 +1825,10 @@ class MenuListComponent {
|
|
|
1687
1825
|
this.updateGridData(testData);
|
|
1688
1826
|
console.log('✅ Test data loaded successfully');
|
|
1689
1827
|
}
|
|
1690
|
-
static
|
|
1691
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: MenuListComponent, isStandalone: true, selector: "cide-core-app-menu-list", viewQueries: [{ propertyName: "menuDetailsRendererTemplate", first: true, predicate: ["menuDetailsRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "menuTypeRendererTemplate", first: true, predicate: ["menuTypeRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "actionsDropdownRendererTemplate", first: true, predicate: ["actionsDropdownRendererTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Menu List 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-6 tw-py-4 tw-border-b tw-border-gray-200 tw-bg-white\">\n <div class=\"tw-flex tw-items-center tw-justify-between tw-mb-3\">\n <div class=\"tw-flex tw-items-center tw-space-x-3\">\n <cide-ele-icon class=\"tw-text-blue-600 tw-w-5 tw-h-5\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n <h6 class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-m-0\">{{ isEditMode() ? 'Edit Menu Item' : 'Quick Add Menu Item' }}</h6>\n </div>\n @if (selectedParentItem()) {\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-2 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\">{{ selectedParentItem()?.syme_title }}</span>\n </div>\n <button \n cideEleButton \n variant=\"ghost\" \n size=\"xs\" \n type=\"button\" \n (click)=\"clearSelectedParent()\" \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]=\"quickAddForm\" (ngSubmit)=\"quickAddMenuItem()\">\n <!-- First Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-4 tw-gap-3 tw-mb-3\">\n <!-- Menu Title -->\n <div>\n <cide-ele-input \n id=\"syme_title\" \n label=\"Title\" \n formControlName=\"syme_title\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Menu Type -->\n <div>\n <cide-ele-select \n label=\"Type*\" \n [options]=\"menuTypeOptions()\" \n formControlName=\"syme_type\"\n placeholder=\"Select type\"\n size=\"sm\">\n </cide-ele-select>\n </div>\n \n <!-- Icon -->\n <div>\n <cide-ele-input \n id=\"quickIcon\" \n type=\"text\"\n label=\"Icon\" \n formControlName=\"syme_icon\"\n placeholder=\"Icon name\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Active Status -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <cide-ele-input \n id=\"quickIsActive\"\n type=\"checkbox\"\n label=\"Active\"\n formControlName=\"syme_isactive\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n </div>\n \n <!-- Second Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-4 tw-gap-3 tw-items-end\">\n <!-- Description -->\n <div>\n <cide-ele-textarea \n id=\"syme_desc\" \n label=\"Description\" \n formControlName=\"syme_desc\"\n placeholder=\"Menu description\"\n rows=\"2\"\n size=\"sm\">\n </cide-ele-textarea>\n </div>\n \n <!-- Path -->\n <div>\n <cide-ele-input \n id=\"quickPath\" \n type=\"text\"\n label=\"Path\" \n formControlName=\"syme_path\"\n placeholder=\"/path/to/route\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Link -->\n <div>\n <cide-ele-input \n id=\"quickLink\" \n type=\"text\"\n label=\"Link\" \n formControlName=\"syme_link\"\n placeholder=\"External link\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Action Buttons -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <div class=\"tw-flex tw-space-x-2\">\n <button \n cideEleButton \n variant=\"primary\" \n size=\"sm\" \n type=\"submit\"\n [disabled]=\"quickAddForm.invalid\"\n class=\"tw-px-2 tw-py-1 tw-w-20\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n {{ isEditMode() ? 'Update' : 'Add' }}\n </button>\n <button \n cideEleButton \n variant=\"outline\" \n size=\"sm\" \n type=\"button\"\n (click)=\"resetQuickAddForm()\"\n class=\"tw-px-2 tw-py-1 tw-w-16\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">refresh</cide-ele-icon>\n Reset\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-6 tw-py-3 tw-border-b tw-border-gray-200 tw-bg-gray-50\">\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-justify-between tw-items-start sm:tw-items-center tw-space-y-3 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-5 tw-h-5\">menu</cide-ele-icon>\n <h5 class=\"tw-text-base tw-font-medium tw-text-gray-900 tw-m-0\">Menu Management</h5>\n </div>\n\n <!-- Actions -->\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-items-start sm:tw-items-center tw-space-y-3 sm:tw-space-y-0 sm:tw-space-x-3\">\n <!-- Actions can be added here if needed -->\n </div>\n </div>\n\n <!-- Error Message -->\n @if (error()) {\n <div class=\"tw-mt-4 tw-p-4 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-5 tw-h-5 tw-mt-0.5 tw-flex-shrink-0\"></cide-ele-icon>\n <div class=\"tw-ml-3\">\n <h3 class=\"tw-text-sm tw-font-medium tw-text-red-800 tw-m-0\">Error</h3>\n <p class=\"tw-text-sm 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 <!-- Debug Information: Uncomment for development -->\n <!--\n <div class=\"tw-p-2 tw-bg-yellow-100 tw-text-xs tw-border-b tw-flex tw-justify-between tw-items-center\">\n <span>Debug: Loading: {{ loading() }} | Items Count: {{ menuItems().length }} | Total: {{ totalItems() }} | Error: {{ error() }}</span>\n <button cideEleButton variant=\"outline\" size=\"xs\" (click)=\"loadTestData()\" class=\"tw-ml-2\">\n Load Test Data\n </button>\n </div>\n -->\n \n <!-- Data Grid Component -->\n <div class=\"tw-h-full tw-overflow-auto\">\n \n <cide-ele-data-grid \n [config]=\"gridConfig()\" \n [templateRenderers]=\"getTemplateRenderers()\"\n [actionHandlers]=\"actionHandlers\"\n [serverSidePagination]=\"true\" \n [totalServerItems]=\"totalItems()\" \n [currentServerPage]=\"currentPage()\"\n [currentServerPageSize]=\"pageSize()\" \n [dragDropEnabled]=\"true\" \n (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n </div>\n\n\n </div>\n </div>\n\n</div>\n\n<!-- \n Angular Template References for Grid Renderers (Best Practice)\n \n These ng-template elements represent the Angular best practice for custom rendering.\n They provide:\n - Type safety with template context\n - Component lifecycle integration\n - Change detection optimization\n - Proper event handling\n - Accessibility features\n \n Note: Current data grid uses string renderers for compatibility.\n Templates are maintained for future component enhancement.\n-->\n\n\n\n<!-- Menu Details Renderer Template -->\n<ng-template #menuDetailsRendererTemplate let-row=\"row\" let-value=\"value\">\n <div class=\"tw-flex tw-items-center tw-min-w-0\">\n <!-- Menu Icon -->\n <div class=\"tw-flex-shrink-0\">\n <cide-ele-icon \n class=\"tw-text-gray-400\" \n size=\"xs\">\n {{ row.syme_icon || 'folder_open' }}\n </cide-ele-icon>\n </div>\n \n <!-- Menu Details -->\n <div class=\"tw-ml-3 tw-min-w-0 tw-flex-1\">\n <div class=\"tw-text-xs tw-font-medium tw-text-gray-900 tw-truncate\" \n [title]=\"row.syme_title\">\n {{ row.syme_title || 'Untitled' }}\n </div>\n @if (row.syme_desc) {\n <div class=\"tw-text-xs tw-text-gray-500 tw-truncate\" \n [title]=\"row.syme_desc\">\n {{ row.syme_desc }}\n </div>\n }\n </div>\n </div>\n</ng-template>\n\n<!-- Menu Type Renderer Template -->\n<ng-template #menuTypeRendererTemplate let-row=\"row\" let-value=\"value\">\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 tw-whitespace-nowrap\"\n [ngClass]=\"getMenuTypeClass(row.syme_type)\">\n {{ getMenuTypeLabel(row.syme_type) }}\n </span>\n</ng-template>\n\n<!-- Actions Dropdown Renderer Template -->\n<ng-template #actionsDropdownRendererTemplate let-row=\"row\" let-value=\"value\">\n <cide-ele-dropdown \n [items]=\"getDropdownItems(row)\"\n [config]=\"{ triggerIcon: 'more_vert', triggerSize: 'sm' }\"\n (itemClick)=\"onDropdownItemClick($event, row)\">\n </cide-ele-dropdown>\n</ng-template>\n\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: CideEleDataGridComponent, selector: "cide-ele-data-grid", inputs: ["config", "customRenderers", "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: 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"], 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: 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"] }] }); }
|
|
1828
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: MenuListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1829
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: MenuListComponent, isStandalone: true, selector: "cide-core-app-menu-list", viewQueries: [{ propertyName: "menuDetailsRendererTemplate", first: true, predicate: ["menuDetailsRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "menuTypeRendererTemplate", first: true, predicate: ["menuTypeRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "actionsDropdownRendererTemplate", first: true, predicate: ["actionsDropdownRendererTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Menu List 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-6 tw-py-4 tw-border-b tw-border-gray-200 tw-bg-white\">\n <div class=\"tw-flex tw-items-center tw-justify-between tw-mb-3\">\n <div class=\"tw-flex tw-items-center tw-space-x-3\">\n <cide-ele-icon class=\"tw-text-blue-600 tw-w-5 tw-h-5\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n <h6 class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-m-0\">{{ isEditMode() ? 'Edit Menu Item' : 'Quick Add Menu Item' }}</h6>\n </div>\n @if (selectedParentItem()) {\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-2 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\">{{ selectedParentItem()?.syme_title }}</span>\n </div>\n <button \n cideEleButton \n variant=\"ghost\" \n size=\"xs\" \n type=\"button\" \n (click)=\"clearSelectedParent()\" \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]=\"quickAddForm\" (ngSubmit)=\"quickAddMenuItem()\">\n <!-- First Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-4 tw-gap-3 tw-mb-3\">\n <!-- Menu Title -->\n <div>\n <cide-ele-input \n id=\"syme_title\" \n label=\"Title\" \n formControlName=\"syme_title\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Menu Type -->\n <div>\n <cide-ele-select \n label=\"Type*\" \n [options]=\"menuTypeOptions()\" \n formControlName=\"syme_type\"\n placeholder=\"Select type\"\n size=\"sm\">\n </cide-ele-select>\n </div>\n \n <!-- Icon -->\n <div>\n <cide-ele-input \n id=\"quickIcon\" \n type=\"text\"\n label=\"Icon\" \n formControlName=\"syme_icon\"\n placeholder=\"Icon name\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Active Status -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <cide-ele-input \n id=\"quickIsActive\"\n type=\"checkbox\"\n label=\"Active\"\n formControlName=\"syme_isactive\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n </div>\n \n <!-- Second Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-4 tw-gap-3 tw-items-end\">\n <!-- Description -->\n <div>\n <cide-ele-textarea \n id=\"syme_desc\" \n label=\"Description\" \n formControlName=\"syme_desc\"\n placeholder=\"Menu description\"\n rows=\"2\"\n size=\"sm\">\n </cide-ele-textarea>\n </div>\n \n <!-- Path -->\n <div>\n <cide-ele-input \n id=\"quickPath\" \n type=\"text\"\n label=\"Path\" \n formControlName=\"syme_path\"\n placeholder=\"/path/to/route\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Link -->\n <div>\n <cide-ele-input \n id=\"quickLink\" \n type=\"text\"\n label=\"Link\" \n formControlName=\"syme_link\"\n placeholder=\"External link\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Action Buttons -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <div class=\"tw-flex tw-space-x-2\">\n <button \n cideEleButton \n variant=\"primary\" \n size=\"sm\" \n type=\"submit\"\n [disabled]=\"quickAddForm.invalid\"\n class=\"tw-px-2 tw-py-1 tw-w-20\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n {{ isEditMode() ? 'Update' : 'Add' }}\n </button>\n <button \n cideEleButton \n variant=\"outline\" \n size=\"sm\" \n type=\"button\"\n (click)=\"resetQuickAddForm()\"\n class=\"tw-px-2 tw-py-1 tw-w-16\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">refresh</cide-ele-icon>\n Reset\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-6 tw-py-3 tw-border-b tw-border-gray-200 tw-bg-gray-50\">\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-justify-between tw-items-start sm:tw-items-center tw-space-y-3 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-5 tw-h-5\">menu</cide-ele-icon>\n <h5 class=\"tw-text-base tw-font-medium tw-text-gray-900 tw-m-0\">Menu Management</h5>\n </div>\n\n <!-- Actions -->\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-items-start sm:tw-items-center tw-space-y-3 sm:tw-space-y-0 sm:tw-space-x-3\">\n <!-- Actions can be added here if needed -->\n </div>\n </div>\n\n <!-- Error Message -->\n @if (error()) {\n <div class=\"tw-mt-4 tw-p-4 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-5 tw-h-5 tw-mt-0.5 tw-flex-shrink-0\"></cide-ele-icon>\n <div class=\"tw-ml-3\">\n <h3 class=\"tw-text-sm tw-font-medium tw-text-red-800 tw-m-0\">Error</h3>\n <p class=\"tw-text-sm 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 <!-- Debug Information: Uncomment for development -->\n <!--\n <div class=\"tw-p-2 tw-bg-yellow-100 tw-text-xs tw-border-b tw-flex tw-justify-between tw-items-center\">\n <span>Debug: Loading: {{ loading() }} | Items Count: {{ menuItems().length }} | Total: {{ totalItems() }} | Error: {{ error() }}</span>\n <button cideEleButton variant=\"outline\" size=\"xs\" (click)=\"loadTestData()\" class=\"tw-ml-2\">\n Load Test Data\n </button>\n </div>\n -->\n \n <!-- Data Grid Component -->\n <div class=\"tw-h-full tw-overflow-auto\">\n \n <cide-ele-data-grid \n [config]=\"gridConfig()\" \n [templateRenderers]=\"getTemplateRenderers()\"\n [actionHandlers]=\"actionHandlers\"\n [serverSidePagination]=\"true\" \n [totalServerItems]=\"totalItems()\" \n [currentServerPage]=\"currentPage()\"\n [currentServerPageSize]=\"pageSize()\" \n [dragDropEnabled]=\"true\" \n (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n </div>\n\n\n </div>\n </div>\n\n</div>\n\n<!-- \n Angular Template References for Grid Renderers (Best Practice)\n \n These ng-template elements represent the Angular best practice for custom rendering.\n They provide:\n - Type safety with template context\n - Component lifecycle integration\n - Change detection optimization\n - Proper event handling\n - Accessibility features\n \n Note: Current data grid uses string renderers for compatibility.\n Templates are maintained for future component enhancement.\n-->\n\n\n\n<!-- Menu Details Renderer Template -->\n<ng-template #menuDetailsRendererTemplate let-row=\"row\" let-value=\"value\">\n <div class=\"tw-flex tw-items-center tw-min-w-0\">\n <!-- Menu Icon -->\n <div class=\"tw-flex-shrink-0\">\n <cide-ele-icon \n class=\"tw-text-gray-400\" \n size=\"xs\">\n {{ row.syme_icon || 'folder_open' }}\n </cide-ele-icon>\n </div>\n \n <!-- Menu Details -->\n <div class=\"tw-ml-3 tw-min-w-0 tw-flex-1\">\n <div class=\"tw-text-xs tw-font-medium tw-text-gray-900 tw-truncate\" \n [title]=\"row.syme_title\">\n {{ row.syme_title || 'Untitled' }}\n </div>\n @if (row.syme_desc) {\n <div class=\"tw-text-xs tw-text-gray-500 tw-truncate\" \n [title]=\"row.syme_desc\">\n {{ row.syme_desc }}\n </div>\n }\n </div>\n </div>\n</ng-template>\n\n<!-- Menu Type Renderer Template -->\n<ng-template #menuTypeRendererTemplate let-row=\"row\" let-value=\"value\">\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 tw-whitespace-nowrap\"\n [ngClass]=\"getMenuTypeClass(row.syme_type)\">\n {{ getMenuTypeLabel(row.syme_type) }}\n </span>\n</ng-template>\n\n<!-- Actions Dropdown Renderer Template -->\n<ng-template #actionsDropdownRendererTemplate let-row=\"row\" let-value=\"value\">\n <cide-ele-dropdown \n [items]=\"getDropdownItems(row)\"\n [config]=\"{ triggerIcon: 'more_vert', triggerSize: 'sm' }\"\n (itemClick)=\"onDropdownItemClick($event, row)\">\n </cide-ele-dropdown>\n</ng-template>\n\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: CideEleDataGridComponent, selector: "cide-ele-data-grid", inputs: ["config", "customRenderers", "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: 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"], 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: 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"] }] });
|
|
1692
1830
|
}
|
|
1693
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1831
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: MenuListComponent, decorators: [{
|
|
1694
1832
|
type: Component,
|
|
1695
1833
|
args: [{ selector: 'cide-core-app-menu-list', standalone: true, imports: [
|
|
1696
1834
|
CommonModule,
|
|
@@ -1706,6 +1844,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
1706
1844
|
], template: "<!-- Menu List 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-6 tw-py-4 tw-border-b tw-border-gray-200 tw-bg-white\">\n <div class=\"tw-flex tw-items-center tw-justify-between tw-mb-3\">\n <div class=\"tw-flex tw-items-center tw-space-x-3\">\n <cide-ele-icon class=\"tw-text-blue-600 tw-w-5 tw-h-5\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n <h6 class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-m-0\">{{ isEditMode() ? 'Edit Menu Item' : 'Quick Add Menu Item' }}</h6>\n </div>\n @if (selectedParentItem()) {\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-2 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\">{{ selectedParentItem()?.syme_title }}</span>\n </div>\n <button \n cideEleButton \n variant=\"ghost\" \n size=\"xs\" \n type=\"button\" \n (click)=\"clearSelectedParent()\" \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]=\"quickAddForm\" (ngSubmit)=\"quickAddMenuItem()\">\n <!-- First Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-4 tw-gap-3 tw-mb-3\">\n <!-- Menu Title -->\n <div>\n <cide-ele-input \n id=\"syme_title\" \n label=\"Title\" \n formControlName=\"syme_title\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Menu Type -->\n <div>\n <cide-ele-select \n label=\"Type*\" \n [options]=\"menuTypeOptions()\" \n formControlName=\"syme_type\"\n placeholder=\"Select type\"\n size=\"sm\">\n </cide-ele-select>\n </div>\n \n <!-- Icon -->\n <div>\n <cide-ele-input \n id=\"quickIcon\" \n type=\"text\"\n label=\"Icon\" \n formControlName=\"syme_icon\"\n placeholder=\"Icon name\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Active Status -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <cide-ele-input \n id=\"quickIsActive\"\n type=\"checkbox\"\n label=\"Active\"\n formControlName=\"syme_isactive\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n </div>\n \n <!-- Second Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-4 tw-gap-3 tw-items-end\">\n <!-- Description -->\n <div>\n <cide-ele-textarea \n id=\"syme_desc\" \n label=\"Description\" \n formControlName=\"syme_desc\"\n placeholder=\"Menu description\"\n rows=\"2\"\n size=\"sm\">\n </cide-ele-textarea>\n </div>\n \n <!-- Path -->\n <div>\n <cide-ele-input \n id=\"quickPath\" \n type=\"text\"\n label=\"Path\" \n formControlName=\"syme_path\"\n placeholder=\"/path/to/route\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Link -->\n <div>\n <cide-ele-input \n id=\"quickLink\" \n type=\"text\"\n label=\"Link\" \n formControlName=\"syme_link\"\n placeholder=\"External link\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Action Buttons -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <div class=\"tw-flex tw-space-x-2\">\n <button \n cideEleButton \n variant=\"primary\" \n size=\"sm\" \n type=\"submit\"\n [disabled]=\"quickAddForm.invalid\"\n class=\"tw-px-2 tw-py-1 tw-w-20\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n {{ isEditMode() ? 'Update' : 'Add' }}\n </button>\n <button \n cideEleButton \n variant=\"outline\" \n size=\"sm\" \n type=\"button\"\n (click)=\"resetQuickAddForm()\"\n class=\"tw-px-2 tw-py-1 tw-w-16\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">refresh</cide-ele-icon>\n Reset\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-6 tw-py-3 tw-border-b tw-border-gray-200 tw-bg-gray-50\">\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-justify-between tw-items-start sm:tw-items-center tw-space-y-3 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-5 tw-h-5\">menu</cide-ele-icon>\n <h5 class=\"tw-text-base tw-font-medium tw-text-gray-900 tw-m-0\">Menu Management</h5>\n </div>\n\n <!-- Actions -->\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-items-start sm:tw-items-center tw-space-y-3 sm:tw-space-y-0 sm:tw-space-x-3\">\n <!-- Actions can be added here if needed -->\n </div>\n </div>\n\n <!-- Error Message -->\n @if (error()) {\n <div class=\"tw-mt-4 tw-p-4 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-5 tw-h-5 tw-mt-0.5 tw-flex-shrink-0\"></cide-ele-icon>\n <div class=\"tw-ml-3\">\n <h3 class=\"tw-text-sm tw-font-medium tw-text-red-800 tw-m-0\">Error</h3>\n <p class=\"tw-text-sm 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 <!-- Debug Information: Uncomment for development -->\n <!--\n <div class=\"tw-p-2 tw-bg-yellow-100 tw-text-xs tw-border-b tw-flex tw-justify-between tw-items-center\">\n <span>Debug: Loading: {{ loading() }} | Items Count: {{ menuItems().length }} | Total: {{ totalItems() }} | Error: {{ error() }}</span>\n <button cideEleButton variant=\"outline\" size=\"xs\" (click)=\"loadTestData()\" class=\"tw-ml-2\">\n Load Test Data\n </button>\n </div>\n -->\n \n <!-- Data Grid Component -->\n <div class=\"tw-h-full tw-overflow-auto\">\n \n <cide-ele-data-grid \n [config]=\"gridConfig()\" \n [templateRenderers]=\"getTemplateRenderers()\"\n [actionHandlers]=\"actionHandlers\"\n [serverSidePagination]=\"true\" \n [totalServerItems]=\"totalItems()\" \n [currentServerPage]=\"currentPage()\"\n [currentServerPageSize]=\"pageSize()\" \n [dragDropEnabled]=\"true\" \n (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n </div>\n\n\n </div>\n </div>\n\n</div>\n\n<!-- \n Angular Template References for Grid Renderers (Best Practice)\n \n These ng-template elements represent the Angular best practice for custom rendering.\n They provide:\n - Type safety with template context\n - Component lifecycle integration\n - Change detection optimization\n - Proper event handling\n - Accessibility features\n \n Note: Current data grid uses string renderers for compatibility.\n Templates are maintained for future component enhancement.\n-->\n\n\n\n<!-- Menu Details Renderer Template -->\n<ng-template #menuDetailsRendererTemplate let-row=\"row\" let-value=\"value\">\n <div class=\"tw-flex tw-items-center tw-min-w-0\">\n <!-- Menu Icon -->\n <div class=\"tw-flex-shrink-0\">\n <cide-ele-icon \n class=\"tw-text-gray-400\" \n size=\"xs\">\n {{ row.syme_icon || 'folder_open' }}\n </cide-ele-icon>\n </div>\n \n <!-- Menu Details -->\n <div class=\"tw-ml-3 tw-min-w-0 tw-flex-1\">\n <div class=\"tw-text-xs tw-font-medium tw-text-gray-900 tw-truncate\" \n [title]=\"row.syme_title\">\n {{ row.syme_title || 'Untitled' }}\n </div>\n @if (row.syme_desc) {\n <div class=\"tw-text-xs tw-text-gray-500 tw-truncate\" \n [title]=\"row.syme_desc\">\n {{ row.syme_desc }}\n </div>\n }\n </div>\n </div>\n</ng-template>\n\n<!-- Menu Type Renderer Template -->\n<ng-template #menuTypeRendererTemplate let-row=\"row\" let-value=\"value\">\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 tw-whitespace-nowrap\"\n [ngClass]=\"getMenuTypeClass(row.syme_type)\">\n {{ getMenuTypeLabel(row.syme_type) }}\n </span>\n</ng-template>\n\n<!-- Actions Dropdown Renderer Template -->\n<ng-template #actionsDropdownRendererTemplate let-row=\"row\" let-value=\"value\">\n <cide-ele-dropdown \n [items]=\"getDropdownItems(row)\"\n [config]=\"{ triggerIcon: 'more_vert', triggerSize: 'sm' }\"\n (itemClick)=\"onDropdownItemClick($event, row)\">\n </cide-ele-dropdown>\n</ng-template>\n\n" }]
|
|
1707
1845
|
}], ctorParameters: () => [] });
|
|
1708
1846
|
|
|
1847
|
+
var menuList_component = /*#__PURE__*/Object.freeze({
|
|
1848
|
+
__proto__: null,
|
|
1849
|
+
MenuListComponent: MenuListComponent
|
|
1850
|
+
});
|
|
1851
|
+
|
|
1709
1852
|
/**
|
|
1710
1853
|
* Menu Type Options
|
|
1711
1854
|
* Available menu types for selection
|
|
@@ -1723,10 +1866,11 @@ const MENU_TYPES = [
|
|
|
1723
1866
|
// Components
|
|
1724
1867
|
|
|
1725
1868
|
class DepartmentManagementService {
|
|
1869
|
+
http;
|
|
1870
|
+
departmentListSubject = new BehaviorSubject([]);
|
|
1871
|
+
departmentList$ = this.departmentListSubject.asObservable();
|
|
1726
1872
|
constructor(http) {
|
|
1727
1873
|
this.http = http;
|
|
1728
|
-
this.departmentListSubject = new BehaviorSubject([]);
|
|
1729
|
-
this.departmentList$ = this.departmentListSubject.asObservable();
|
|
1730
1874
|
console.log('DepartmentManagementService initialized - using real API');
|
|
1731
1875
|
}
|
|
1732
1876
|
/**
|
|
@@ -1893,10 +2037,10 @@ class DepartmentManagementService {
|
|
|
1893
2037
|
console.error('Department Management Service Error:', errorMessage);
|
|
1894
2038
|
return throwError(() => new Error(errorMessage));
|
|
1895
2039
|
}
|
|
1896
|
-
static
|
|
1897
|
-
static
|
|
2040
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: DepartmentManagementService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2041
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: DepartmentManagementService, providedIn: 'root' });
|
|
1898
2042
|
}
|
|
1899
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2043
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: DepartmentManagementService, decorators: [{
|
|
1900
2044
|
type: Injectable,
|
|
1901
2045
|
args: [{
|
|
1902
2046
|
providedIn: 'root'
|
|
@@ -1904,182 +2048,182 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
1904
2048
|
}], ctorParameters: () => [{ type: i1.HttpClient }] });
|
|
1905
2049
|
|
|
1906
2050
|
class DepartmentListComponent {
|
|
2051
|
+
// Dependency injection
|
|
2052
|
+
destroyRef = inject(DestroyRef);
|
|
2053
|
+
departmentService = inject(DepartmentManagementService);
|
|
2054
|
+
appState = inject(AppStateHelperService);
|
|
2055
|
+
fb = inject(NonNullableFormBuilder);
|
|
2056
|
+
router = inject(Router);
|
|
2057
|
+
confirmationService = inject(ConfirmationService);
|
|
2058
|
+
notificationService = inject(NotificationService);
|
|
2059
|
+
// Modern ViewChild signals for template renderers (Angular 20 approach)
|
|
2060
|
+
departmentDetailsRendererTemplate = viewChild.required('departmentDetailsRendererTemplate');
|
|
2061
|
+
departmentStatusRendererTemplate = viewChild.required('departmentStatusRendererTemplate');
|
|
2062
|
+
actionsDropdownRendererTemplate = viewChild.required('actionsDropdownRendererTemplate');
|
|
2063
|
+
// Make Math available in template
|
|
2064
|
+
Math = Math;
|
|
2065
|
+
// Signals for reactive state management
|
|
2066
|
+
departments = signal([], ...(ngDevMode ? [{ debugName: "departments" }] : []));
|
|
2067
|
+
loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
2068
|
+
error = signal(null, ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
2069
|
+
selectedItems = signal([], ...(ngDevMode ? [{ debugName: "selectedItems" }] : []));
|
|
2070
|
+
searchTerm = signal('', ...(ngDevMode ? [{ debugName: "searchTerm" }] : []));
|
|
2071
|
+
// Modern reactive forms with signals
|
|
2072
|
+
selectedParentDepartment = signal(null, ...(ngDevMode ? [{ debugName: "selectedParentDepartment" }] : []));
|
|
2073
|
+
// Retrieved department data
|
|
2074
|
+
retrievedDepartment = signal(null, ...(ngDevMode ? [{ debugName: "retrievedDepartment" }] : []));
|
|
2075
|
+
// Edit mode flag
|
|
2076
|
+
isEditMode = signal(false, ...(ngDevMode ? [{ debugName: "isEditMode" }] : []));
|
|
2077
|
+
// Server-side pagination state
|
|
2078
|
+
currentPage = signal(1, ...(ngDevMode ? [{ debugName: "currentPage" }] : []));
|
|
2079
|
+
pageSize = signal(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
|
|
2080
|
+
totalItems = signal(0, ...(ngDevMode ? [{ debugName: "totalItems" }] : []));
|
|
2081
|
+
// Modern reactive form with typed controls
|
|
2082
|
+
quickAddForm = this.fb.group({
|
|
2083
|
+
sydept_code: this.fb.control('', []),
|
|
2084
|
+
sydept_name: this.fb.control('', []),
|
|
2085
|
+
sydept_description: this.fb.control('', []),
|
|
2086
|
+
sydept_isactive: this.fb.control(true, []),
|
|
2087
|
+
sydept_department_id_sydept: this.fb.control(''),
|
|
2088
|
+
sydept_entity_id_syen: this.fb.control(this.appState.getActiveEntityId() || '', [])
|
|
2089
|
+
});
|
|
2090
|
+
// Grid configuration signal
|
|
2091
|
+
gridConfig = signal({
|
|
2092
|
+
id: 'department-list-grid',
|
|
2093
|
+
title: '',
|
|
2094
|
+
subtitle: '',
|
|
2095
|
+
columns: [
|
|
2096
|
+
{
|
|
2097
|
+
key: 'details',
|
|
2098
|
+
header: 'Department',
|
|
2099
|
+
type: 'custom',
|
|
2100
|
+
width: 'auto',
|
|
2101
|
+
truncate: true,
|
|
2102
|
+
align: 'left',
|
|
2103
|
+
renderer: 'departmentDetailsRenderer'
|
|
2104
|
+
},
|
|
2105
|
+
{
|
|
2106
|
+
key: 'sydept_code',
|
|
2107
|
+
header: 'Code',
|
|
2108
|
+
type: 'text',
|
|
2109
|
+
width: '120px',
|
|
2110
|
+
truncate: true,
|
|
2111
|
+
align: 'left'
|
|
2112
|
+
},
|
|
2113
|
+
{
|
|
2114
|
+
key: 'sydept_isactive',
|
|
2115
|
+
header: 'Status',
|
|
2116
|
+
type: 'custom',
|
|
2117
|
+
width: '100px',
|
|
2118
|
+
truncate: false,
|
|
2119
|
+
align: 'center',
|
|
2120
|
+
renderer: 'departmentStatusRenderer'
|
|
2121
|
+
},
|
|
2122
|
+
{
|
|
2123
|
+
key: 'actions',
|
|
2124
|
+
header: '',
|
|
2125
|
+
type: 'custom',
|
|
2126
|
+
width: '60px',
|
|
2127
|
+
truncate: false,
|
|
2128
|
+
align: 'center',
|
|
2129
|
+
renderer: 'actionsDropdownRenderer'
|
|
2130
|
+
}
|
|
2131
|
+
],
|
|
2132
|
+
data: [],
|
|
2133
|
+
tree: {
|
|
2134
|
+
enabled: true,
|
|
2135
|
+
primaryKey: '_id',
|
|
2136
|
+
foreignKey: 'sydept_department_id_sydept',
|
|
2137
|
+
childrenKey: 'children',
|
|
2138
|
+
levelKey: 'level',
|
|
2139
|
+
expandedKey: 'expanded',
|
|
2140
|
+
hasChildrenKey: 'hasChildren'
|
|
2141
|
+
},
|
|
2142
|
+
trackBy: '_id',
|
|
2143
|
+
pagination: {
|
|
2144
|
+
enabled: false,
|
|
2145
|
+
pageSize: 10,
|
|
2146
|
+
pageSizeOptions: [10, 25, 50, 100],
|
|
2147
|
+
showQuickJump: true,
|
|
2148
|
+
showPageInfo: true,
|
|
2149
|
+
showRefresh: true
|
|
2150
|
+
},
|
|
2151
|
+
search: {
|
|
2152
|
+
enabled: true,
|
|
2153
|
+
placeholder: 'Search departments...',
|
|
2154
|
+
searchableColumns: ['sydept_name', 'sydept_code', 'sydept_description'],
|
|
2155
|
+
debounceMs: 300
|
|
2156
|
+
},
|
|
2157
|
+
loading: {
|
|
2158
|
+
useDefer: true,
|
|
2159
|
+
skeletonRows: 5,
|
|
2160
|
+
showOverlay: false
|
|
2161
|
+
},
|
|
2162
|
+
scroll: {
|
|
2163
|
+
enabled: true,
|
|
2164
|
+
maxHeight: '',
|
|
2165
|
+
minHeight: '',
|
|
2166
|
+
stickyHeader: true,
|
|
2167
|
+
virtualScroll: false,
|
|
2168
|
+
rowHeight: 50
|
|
2169
|
+
},
|
|
2170
|
+
responsive: true,
|
|
2171
|
+
striped: false,
|
|
2172
|
+
bordered: true,
|
|
2173
|
+
compact: false,
|
|
2174
|
+
tableClass: 'tw-table-fixed tw-w-full tw-rounded-none',
|
|
2175
|
+
onRefresh: 'onDepartmentRefresh'
|
|
2176
|
+
}, ...(ngDevMode ? [{ debugName: "gridConfig" }] : []));
|
|
2177
|
+
// Template renderers using Angular best practices
|
|
2178
|
+
templateRenderers = computed(() => ({
|
|
2179
|
+
departmentDetailsRenderer: this.departmentDetailsRendererTemplate(),
|
|
2180
|
+
departmentStatusRenderer: this.departmentStatusRendererTemplate(),
|
|
2181
|
+
actionsDropdownRenderer: this.actionsDropdownRendererTemplate()
|
|
2182
|
+
}), ...(ngDevMode ? [{ debugName: "templateRenderers" }] : []));
|
|
1907
2183
|
/**
|
|
1908
2184
|
* Get template renderers for data grid
|
|
1909
2185
|
*/
|
|
1910
2186
|
getTemplateRenderers() {
|
|
1911
2187
|
return this.templateRenderers();
|
|
1912
2188
|
}
|
|
2189
|
+
// Mixed renderers (templates + string functions)
|
|
2190
|
+
customRenderers = computed(() => ({
|
|
2191
|
+
...this.templateRenderers()
|
|
2192
|
+
}), ...(ngDevMode ? [{ debugName: "customRenderers" }] : []));
|
|
1913
2193
|
/**
|
|
1914
2194
|
* Get custom renderers adapted for current data grid compatibility
|
|
1915
2195
|
*/
|
|
1916
2196
|
getCustomRenderers() {
|
|
1917
2197
|
return {};
|
|
1918
2198
|
}
|
|
2199
|
+
// Action handlers for grid actions
|
|
2200
|
+
actionHandlers = {
|
|
2201
|
+
onEditDepartment: (row) => this.editDepartment(row._id || ''),
|
|
2202
|
+
onToggleDepartment: (row) => this.toggleDepartmentStatus(row._id || ''),
|
|
2203
|
+
onDeleteDepartment: (row) => this.deleteDepartment(row._id || ''),
|
|
2204
|
+
onDepartmentRowClick: (row) => this.onDepartmentRowClick(row),
|
|
2205
|
+
onDepartmentRefresh: () => this.onDepartmentRefresh(),
|
|
2206
|
+
onAddChild: (row) => this.onAddChild(row)
|
|
2207
|
+
};
|
|
2208
|
+
// Computed properties
|
|
2209
|
+
filteredItems = computed(() => {
|
|
2210
|
+
const items = this.departments();
|
|
2211
|
+
const search = this.searchTerm()?.toLowerCase();
|
|
2212
|
+
if (!search)
|
|
2213
|
+
return items;
|
|
2214
|
+
return items.filter(item => {
|
|
2215
|
+
return item.sydept_name?.toLowerCase().includes(search) ||
|
|
2216
|
+
item.sydept_code?.toLowerCase().includes(search) ||
|
|
2217
|
+
item.sydept_description?.toLowerCase().includes(search);
|
|
2218
|
+
});
|
|
2219
|
+
}, ...(ngDevMode ? [{ debugName: "filteredItems" }] : []));
|
|
2220
|
+
hasSelection = computed(() => this.selectedItems().length > 0, ...(ngDevMode ? [{ debugName: "hasSelection" }] : []));
|
|
2221
|
+
// Pagination computed properties
|
|
2222
|
+
totalPages = computed(() => Math.ceil(this.totalItems() / this.pageSize()), ...(ngDevMode ? [{ debugName: "totalPages" }] : []));
|
|
2223
|
+
hasNextPage = computed(() => this.currentPage() < this.totalPages(), ...(ngDevMode ? [{ debugName: "hasNextPage" }] : []));
|
|
2224
|
+
hasPreviousPage = computed(() => this.currentPage() > 1, ...(ngDevMode ? [{ debugName: "hasPreviousPage" }] : []));
|
|
1919
2225
|
// Modern constructor with effects for initialization
|
|
1920
2226
|
constructor() {
|
|
1921
|
-
// Dependency injection
|
|
1922
|
-
this.destroyRef = inject(DestroyRef);
|
|
1923
|
-
this.departmentService = inject(DepartmentManagementService);
|
|
1924
|
-
this.appState = inject(AppStateHelperService);
|
|
1925
|
-
this.fb = inject(NonNullableFormBuilder);
|
|
1926
|
-
this.router = inject(Router);
|
|
1927
|
-
this.confirmationService = inject(ConfirmationService);
|
|
1928
|
-
this.notificationService = inject(NotificationService);
|
|
1929
|
-
// Modern ViewChild signals for template renderers (Angular 20 approach)
|
|
1930
|
-
this.departmentDetailsRendererTemplate = viewChild.required('departmentDetailsRendererTemplate');
|
|
1931
|
-
this.departmentStatusRendererTemplate = viewChild.required('departmentStatusRendererTemplate');
|
|
1932
|
-
this.actionsDropdownRendererTemplate = viewChild.required('actionsDropdownRendererTemplate');
|
|
1933
|
-
// Make Math available in template
|
|
1934
|
-
this.Math = Math;
|
|
1935
|
-
// Signals for reactive state management
|
|
1936
|
-
this.departments = signal([]);
|
|
1937
|
-
this.loading = signal(false);
|
|
1938
|
-
this.error = signal(null);
|
|
1939
|
-
this.selectedItems = signal([]);
|
|
1940
|
-
this.searchTerm = signal('');
|
|
1941
|
-
// Modern reactive forms with signals
|
|
1942
|
-
this.selectedParentDepartment = signal(null);
|
|
1943
|
-
// Retrieved department data
|
|
1944
|
-
this.retrievedDepartment = signal(null);
|
|
1945
|
-
// Edit mode flag
|
|
1946
|
-
this.isEditMode = signal(false);
|
|
1947
|
-
// Server-side pagination state
|
|
1948
|
-
this.currentPage = signal(1);
|
|
1949
|
-
this.pageSize = signal(10);
|
|
1950
|
-
this.totalItems = signal(0);
|
|
1951
|
-
// Modern reactive form with typed controls
|
|
1952
|
-
this.quickAddForm = this.fb.group({
|
|
1953
|
-
sydept_code: this.fb.control('', []),
|
|
1954
|
-
sydept_name: this.fb.control('', []),
|
|
1955
|
-
sydept_description: this.fb.control('', []),
|
|
1956
|
-
sydept_isactive: this.fb.control(true, []),
|
|
1957
|
-
sydept_department_id_sydept: this.fb.control(''),
|
|
1958
|
-
sydept_entity_id_syen: this.fb.control(this.appState.getActiveEntityId() || '', [])
|
|
1959
|
-
});
|
|
1960
|
-
// Grid configuration signal
|
|
1961
|
-
this.gridConfig = signal({
|
|
1962
|
-
id: 'department-list-grid',
|
|
1963
|
-
title: '',
|
|
1964
|
-
subtitle: '',
|
|
1965
|
-
columns: [
|
|
1966
|
-
{
|
|
1967
|
-
key: 'details',
|
|
1968
|
-
header: 'Department',
|
|
1969
|
-
type: 'custom',
|
|
1970
|
-
width: 'auto',
|
|
1971
|
-
truncate: true,
|
|
1972
|
-
align: 'left',
|
|
1973
|
-
renderer: 'departmentDetailsRenderer'
|
|
1974
|
-
},
|
|
1975
|
-
{
|
|
1976
|
-
key: 'sydept_code',
|
|
1977
|
-
header: 'Code',
|
|
1978
|
-
type: 'text',
|
|
1979
|
-
width: '120px',
|
|
1980
|
-
truncate: true,
|
|
1981
|
-
align: 'left'
|
|
1982
|
-
},
|
|
1983
|
-
{
|
|
1984
|
-
key: 'sydept_isactive',
|
|
1985
|
-
header: 'Status',
|
|
1986
|
-
type: 'custom',
|
|
1987
|
-
width: '100px',
|
|
1988
|
-
truncate: false,
|
|
1989
|
-
align: 'center',
|
|
1990
|
-
renderer: 'departmentStatusRenderer'
|
|
1991
|
-
},
|
|
1992
|
-
{
|
|
1993
|
-
key: 'actions',
|
|
1994
|
-
header: '',
|
|
1995
|
-
type: 'custom',
|
|
1996
|
-
width: '60px',
|
|
1997
|
-
truncate: false,
|
|
1998
|
-
align: 'center',
|
|
1999
|
-
renderer: 'actionsDropdownRenderer'
|
|
2000
|
-
}
|
|
2001
|
-
],
|
|
2002
|
-
data: [],
|
|
2003
|
-
tree: {
|
|
2004
|
-
enabled: true,
|
|
2005
|
-
primaryKey: '_id',
|
|
2006
|
-
foreignKey: 'sydept_department_id_sydept',
|
|
2007
|
-
childrenKey: 'children',
|
|
2008
|
-
levelKey: 'level',
|
|
2009
|
-
expandedKey: 'expanded',
|
|
2010
|
-
hasChildrenKey: 'hasChildren'
|
|
2011
|
-
},
|
|
2012
|
-
trackBy: '_id',
|
|
2013
|
-
pagination: {
|
|
2014
|
-
enabled: false,
|
|
2015
|
-
pageSize: 10,
|
|
2016
|
-
pageSizeOptions: [10, 25, 50, 100],
|
|
2017
|
-
showQuickJump: true,
|
|
2018
|
-
showPageInfo: true,
|
|
2019
|
-
showRefresh: true
|
|
2020
|
-
},
|
|
2021
|
-
search: {
|
|
2022
|
-
enabled: true,
|
|
2023
|
-
placeholder: 'Search departments...',
|
|
2024
|
-
searchableColumns: ['sydept_name', 'sydept_code', 'sydept_description'],
|
|
2025
|
-
debounceMs: 300
|
|
2026
|
-
},
|
|
2027
|
-
loading: {
|
|
2028
|
-
useDefer: true,
|
|
2029
|
-
skeletonRows: 5,
|
|
2030
|
-
showOverlay: false
|
|
2031
|
-
},
|
|
2032
|
-
scroll: {
|
|
2033
|
-
enabled: true,
|
|
2034
|
-
maxHeight: '',
|
|
2035
|
-
minHeight: '',
|
|
2036
|
-
stickyHeader: true,
|
|
2037
|
-
virtualScroll: false,
|
|
2038
|
-
rowHeight: 50
|
|
2039
|
-
},
|
|
2040
|
-
responsive: true,
|
|
2041
|
-
striped: false,
|
|
2042
|
-
bordered: true,
|
|
2043
|
-
compact: false,
|
|
2044
|
-
tableClass: 'tw-table-fixed tw-w-full tw-rounded-none',
|
|
2045
|
-
onRefresh: 'onDepartmentRefresh'
|
|
2046
|
-
});
|
|
2047
|
-
// Template renderers using Angular best practices
|
|
2048
|
-
this.templateRenderers = computed(() => ({
|
|
2049
|
-
departmentDetailsRenderer: this.departmentDetailsRendererTemplate(),
|
|
2050
|
-
departmentStatusRenderer: this.departmentStatusRendererTemplate(),
|
|
2051
|
-
actionsDropdownRenderer: this.actionsDropdownRendererTemplate()
|
|
2052
|
-
}));
|
|
2053
|
-
// Mixed renderers (templates + string functions)
|
|
2054
|
-
this.customRenderers = computed(() => ({
|
|
2055
|
-
...this.templateRenderers()
|
|
2056
|
-
}));
|
|
2057
|
-
// Action handlers for grid actions
|
|
2058
|
-
this.actionHandlers = {
|
|
2059
|
-
onEditDepartment: (row) => this.editDepartment(row._id || ''),
|
|
2060
|
-
onToggleDepartment: (row) => this.toggleDepartmentStatus(row._id || ''),
|
|
2061
|
-
onDeleteDepartment: (row) => this.deleteDepartment(row._id || ''),
|
|
2062
|
-
onDepartmentRowClick: (row) => this.onDepartmentRowClick(row),
|
|
2063
|
-
onDepartmentRefresh: () => this.onDepartmentRefresh(),
|
|
2064
|
-
onAddChild: (row) => this.onAddChild(row)
|
|
2065
|
-
};
|
|
2066
|
-
// Computed properties
|
|
2067
|
-
this.filteredItems = computed(() => {
|
|
2068
|
-
const items = this.departments();
|
|
2069
|
-
const search = this.searchTerm()?.toLowerCase();
|
|
2070
|
-
if (!search)
|
|
2071
|
-
return items;
|
|
2072
|
-
return items.filter(item => {
|
|
2073
|
-
return item.sydept_name?.toLowerCase().includes(search) ||
|
|
2074
|
-
item.sydept_code?.toLowerCase().includes(search) ||
|
|
2075
|
-
item.sydept_description?.toLowerCase().includes(search);
|
|
2076
|
-
});
|
|
2077
|
-
});
|
|
2078
|
-
this.hasSelection = computed(() => this.selectedItems().length > 0);
|
|
2079
|
-
// Pagination computed properties
|
|
2080
|
-
this.totalPages = computed(() => Math.ceil(this.totalItems() / this.pageSize()));
|
|
2081
|
-
this.hasNextPage = computed(() => this.currentPage() < this.totalPages());
|
|
2082
|
-
this.hasPreviousPage = computed(() => this.currentPage() > 1);
|
|
2083
2227
|
this.initializeComponent();
|
|
2084
2228
|
this.destroyRef.onDestroy(() => {
|
|
2085
2229
|
this.cleanupEventListeners();
|
|
@@ -2641,10 +2785,10 @@ class DepartmentListComponent {
|
|
|
2641
2785
|
trackByItemId(index, item) {
|
|
2642
2786
|
return item._id || '';
|
|
2643
2787
|
}
|
|
2644
|
-
static
|
|
2645
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: DepartmentListComponent, isStandalone: true, selector: "cide-core-app-department-list", viewQueries: [{ propertyName: "departmentDetailsRendererTemplate", first: true, predicate: ["departmentDetailsRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "departmentStatusRendererTemplate", first: true, predicate: ["departmentStatusRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "actionsDropdownRendererTemplate", first: true, predicate: ["actionsDropdownRendererTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Department List Container -->\n<div class=\"tw-table tw-w-full tw-h-full\">\n\n<!-- Global Notifications -->\n<cide-ele-global-notifications></cide-ele-global-notifications>\n\n <!-- Quick Add Form Section -->\n <div class=\"tw-table-row tw-h-0\">\n <div class=\"tw-table-cell tw-px-6 tw-py-4 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-5 tw-h-5\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n <h6 class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-m-0\">{{ isEditMode() ? 'Edit Department' : 'Quick Add Department' }}</h6>\n </div>\n @if (selectedParentDepartment()) {\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\">{{ selectedParentDepartment()?.sydept_name }}</span>\n </div>\n <button \n cideEleButton \n variant=\"ghost\" \n size=\"xs\" \n type=\"button\" \n (click)=\"clearSelectedParent()\" \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]=\"quickAddForm\" (ngSubmit)=\"quickAddDepartment()\">\n <!-- First Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-4 tw-gap-3 tw-mb-3\">\n <!-- Department Code -->\n <div>\n <cide-ele-input \n id=\"sydept_code\" \n label=\"Code*\" \n formControlName=\"sydept_code\"\n placeholder=\"DEPT001\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Department Name -->\n <div>\n <cide-ele-input \n id=\"sydept_name\" \n label=\"Name*\" \n formControlName=\"sydept_name\"\n placeholder=\"Department name\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n\n \n <!-- Active Status -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <cide-ele-input \n id=\"sydept_isactive\"\n type=\"checkbox\"\n label=\"Active\"\n formControlName=\"sydept_isactive\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n </div>\n \n <!-- Second Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-4 tw-gap-3 tw-items-end\">\n <!-- Description -->\n <div>\n <cide-ele-textarea \n id=\"sydept_description\" \n label=\"Description\" \n formControlName=\"sydept_description\"\n placeholder=\"Department description\"\n rows=\"2\"\n size=\"sm\">\n </cide-ele-textarea>\n </div>\n \n\n \n <!-- Action Buttons -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <div class=\"tw-flex tw-space-x-2\">\n <button \n cideEleButton \n variant=\"primary\" \n size=\"sm\" \n type=\"submit\"\n [disabled]=\"quickAddForm.invalid\"\n class=\"tw-px-2 tw-py-1 tw-w-20\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n {{ isEditMode() ? 'Update' : 'Add' }}\n </button>\n <button \n cideEleButton \n variant=\"outline\" \n size=\"sm\" \n type=\"button\"\n (click)=\"resetQuickAddForm()\"\n class=\"tw-px-2 tw-py-1 tw-w-16\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">refresh</cide-ele-icon>\n Reset\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-6 tw-py-3 tw-border-b tw-border-gray-200 tw-bg-gray-50\">\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-justify-between tw-items-start sm:tw-items-center tw-space-y-3 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-5 tw-h-5\">business</cide-ele-icon>\n <h5 class=\"tw-text-base tw-font-medium tw-text-gray-900 tw-m-0\">Department Management</h5>\n </div>\n\n <!-- Actions -->\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-items-start sm:tw-items-center tw-space-y-3 sm:tw-space-y-0 sm:tw-space-x-3\">\n <!-- Search functionality is handled by the data grid -->\n </div>\n </div>\n\n <!-- Error Message -->\n @if (error()) {\n <div class=\"tw-mt-4 tw-p-4 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-5 tw-h-5 tw-mt-0.5 tw-flex-shrink-0\"></cide-ele-icon>\n <div class=\"tw-ml-3\">\n <h3 class=\"tw-text-sm tw-font-medium tw-text-red-800 tw-m-0\">Error</h3>\n <p class=\"tw-text-sm 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 \n <cide-ele-data-grid \n [config]=\"gridConfig()\" \n [templateRenderers]=\"getTemplateRenderers()\"\n [actionHandlers]=\"actionHandlers\"\n [serverSidePagination]=\"true\" \n [totalServerItems]=\"totalItems()\" \n [currentServerPage]=\"currentPage()\"\n [currentServerPageSize]=\"pageSize()\" \n (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n </div>\n\n </div>\n </div>\n\n</div>\n\n<!-- Department Details Renderer Template -->\n<ng-template #departmentDetailsRendererTemplate let-row=\"row\" let-value=\"value\">\n <div class=\"tw-flex tw-items-center tw-min-w-0\">\n <!-- Department Icon -->\n <div class=\"tw-flex-shrink-0\">\n <cide-ele-icon \n class=\"tw-text-gray-400\" \n size=\"xs\">\n business\n </cide-ele-icon>\n </div>\n \n <!-- Department Details -->\n <div class=\"tw-ml-3 tw-min-w-0 tw-flex-1\">\n <div class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\" \n [title]=\"row.sydept_name\">\n {{ row.sydept_name || 'Untitled' }}\n </div>\n @if (row.sydept_description) {\n <div class=\"tw-text-xs tw-text-gray-500 tw-truncate\" \n [title]=\"row.sydept_description\">\n {{ row.sydept_description }}\n </div>\n }\n </div>\n </div>\n</ng-template>\n\n<!-- Department Status Renderer Template -->\n<ng-template #departmentStatusRendererTemplate let-row=\"row\" let-value=\"value\">\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 tw-whitespace-nowrap\"\n [ngClass]=\"getStatusClass(row.sydept_isactive)\">\n {{ getStatusDisplay(row.sydept_isactive) }}\n </span>\n</ng-template>\n\n<!-- Actions Dropdown Renderer Template -->\n<ng-template #actionsDropdownRendererTemplate let-row=\"row\" let-value=\"value\">\n <cide-ele-dropdown \n [items]=\"getDropdownItems(row)\"\n [config]=\"{ triggerIcon: 'more_vert', triggerSize: 'sm' }\"\n (itemClick)=\"onDropdownItemClick($event, row)\">\n </cide-ele-dropdown>\n</ng-template> ", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: CideEleDataGridComponent, selector: "cide-ele-data-grid", inputs: ["config", "customRenderers", "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: CideEleGlobalNotificationsComponent, selector: "cide-ele-global-notifications" }] }); }
|
|
2788
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: DepartmentListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2789
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: DepartmentListComponent, isStandalone: true, selector: "cide-core-app-department-list", viewQueries: [{ propertyName: "departmentDetailsRendererTemplate", first: true, predicate: ["departmentDetailsRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "departmentStatusRendererTemplate", first: true, predicate: ["departmentStatusRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "actionsDropdownRendererTemplate", first: true, predicate: ["actionsDropdownRendererTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Department List Container -->\n<div class=\"tw-table tw-w-full tw-h-full\">\n\n<!-- Global Notifications -->\n<cide-ele-global-notifications></cide-ele-global-notifications>\n\n <!-- Quick Add Form Section -->\n <div class=\"tw-table-row tw-h-0\">\n <div class=\"tw-table-cell tw-px-6 tw-py-4 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-5 tw-h-5\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n <h6 class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-m-0\">{{ isEditMode() ? 'Edit Department' : 'Quick Add Department' }}</h6>\n </div>\n @if (selectedParentDepartment()) {\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\">{{ selectedParentDepartment()?.sydept_name }}</span>\n </div>\n <button \n cideEleButton \n variant=\"ghost\" \n size=\"xs\" \n type=\"button\" \n (click)=\"clearSelectedParent()\" \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]=\"quickAddForm\" (ngSubmit)=\"quickAddDepartment()\">\n <!-- First Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-4 tw-gap-3 tw-mb-3\">\n <!-- Department Code -->\n <div>\n <cide-ele-input \n id=\"sydept_code\" \n label=\"Code*\" \n formControlName=\"sydept_code\"\n placeholder=\"DEPT001\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Department Name -->\n <div>\n <cide-ele-input \n id=\"sydept_name\" \n label=\"Name*\" \n formControlName=\"sydept_name\"\n placeholder=\"Department name\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n\n \n <!-- Active Status -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <cide-ele-input \n id=\"sydept_isactive\"\n type=\"checkbox\"\n label=\"Active\"\n formControlName=\"sydept_isactive\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n </div>\n \n <!-- Second Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-4 tw-gap-3 tw-items-end\">\n <!-- Description -->\n <div>\n <cide-ele-textarea \n id=\"sydept_description\" \n label=\"Description\" \n formControlName=\"sydept_description\"\n placeholder=\"Department description\"\n rows=\"2\"\n size=\"sm\">\n </cide-ele-textarea>\n </div>\n \n\n \n <!-- Action Buttons -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <div class=\"tw-flex tw-space-x-2\">\n <button \n cideEleButton \n variant=\"primary\" \n size=\"sm\" \n type=\"submit\"\n [disabled]=\"quickAddForm.invalid\"\n class=\"tw-px-2 tw-py-1 tw-w-20\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n {{ isEditMode() ? 'Update' : 'Add' }}\n </button>\n <button \n cideEleButton \n variant=\"outline\" \n size=\"sm\" \n type=\"button\"\n (click)=\"resetQuickAddForm()\"\n class=\"tw-px-2 tw-py-1 tw-w-16\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">refresh</cide-ele-icon>\n Reset\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-6 tw-py-3 tw-border-b tw-border-gray-200 tw-bg-gray-50\">\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-justify-between tw-items-start sm:tw-items-center tw-space-y-3 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-5 tw-h-5\">business</cide-ele-icon>\n <h5 class=\"tw-text-base tw-font-medium tw-text-gray-900 tw-m-0\">Department Management</h5>\n </div>\n\n <!-- Actions -->\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-items-start sm:tw-items-center tw-space-y-3 sm:tw-space-y-0 sm:tw-space-x-3\">\n <!-- Search functionality is handled by the data grid -->\n </div>\n </div>\n\n <!-- Error Message -->\n @if (error()) {\n <div class=\"tw-mt-4 tw-p-4 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-5 tw-h-5 tw-mt-0.5 tw-flex-shrink-0\"></cide-ele-icon>\n <div class=\"tw-ml-3\">\n <h3 class=\"tw-text-sm tw-font-medium tw-text-red-800 tw-m-0\">Error</h3>\n <p class=\"tw-text-sm 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 \n <cide-ele-data-grid \n [config]=\"gridConfig()\" \n [templateRenderers]=\"getTemplateRenderers()\"\n [actionHandlers]=\"actionHandlers\"\n [serverSidePagination]=\"true\" \n [totalServerItems]=\"totalItems()\" \n [currentServerPage]=\"currentPage()\"\n [currentServerPageSize]=\"pageSize()\" \n (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n </div>\n\n </div>\n </div>\n\n</div>\n\n<!-- Department Details Renderer Template -->\n<ng-template #departmentDetailsRendererTemplate let-row=\"row\" let-value=\"value\">\n <div class=\"tw-flex tw-items-center tw-min-w-0\">\n <!-- Department Icon -->\n <div class=\"tw-flex-shrink-0\">\n <cide-ele-icon \n class=\"tw-text-gray-400\" \n size=\"xs\">\n business\n </cide-ele-icon>\n </div>\n \n <!-- Department Details -->\n <div class=\"tw-ml-3 tw-min-w-0 tw-flex-1\">\n <div class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\" \n [title]=\"row.sydept_name\">\n {{ row.sydept_name || 'Untitled' }}\n </div>\n @if (row.sydept_description) {\n <div class=\"tw-text-xs tw-text-gray-500 tw-truncate\" \n [title]=\"row.sydept_description\">\n {{ row.sydept_description }}\n </div>\n }\n </div>\n </div>\n</ng-template>\n\n<!-- Department Status Renderer Template -->\n<ng-template #departmentStatusRendererTemplate let-row=\"row\" let-value=\"value\">\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 tw-whitespace-nowrap\"\n [ngClass]=\"getStatusClass(row.sydept_isactive)\">\n {{ getStatusDisplay(row.sydept_isactive) }}\n </span>\n</ng-template>\n\n<!-- Actions Dropdown Renderer Template -->\n<ng-template #actionsDropdownRendererTemplate let-row=\"row\" let-value=\"value\">\n <cide-ele-dropdown \n [items]=\"getDropdownItems(row)\"\n [config]=\"{ triggerIcon: 'more_vert', triggerSize: 'sm' }\"\n (itemClick)=\"onDropdownItemClick($event, row)\">\n </cide-ele-dropdown>\n</ng-template> ", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: CideEleDataGridComponent, selector: "cide-ele-data-grid", inputs: ["config", "customRenderers", "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: CideEleGlobalNotificationsComponent, selector: "cide-ele-global-notifications" }] });
|
|
2646
2790
|
}
|
|
2647
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2791
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: DepartmentListComponent, decorators: [{
|
|
2648
2792
|
type: Component,
|
|
2649
2793
|
args: [{ selector: 'cide-core-app-department-list', standalone: true, imports: [
|
|
2650
2794
|
CommonModule,
|
|
@@ -2660,14 +2804,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
2660
2804
|
], template: "<!-- Department List Container -->\n<div class=\"tw-table tw-w-full tw-h-full\">\n\n<!-- Global Notifications -->\n<cide-ele-global-notifications></cide-ele-global-notifications>\n\n <!-- Quick Add Form Section -->\n <div class=\"tw-table-row tw-h-0\">\n <div class=\"tw-table-cell tw-px-6 tw-py-4 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-5 tw-h-5\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n <h6 class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-m-0\">{{ isEditMode() ? 'Edit Department' : 'Quick Add Department' }}</h6>\n </div>\n @if (selectedParentDepartment()) {\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\">{{ selectedParentDepartment()?.sydept_name }}</span>\n </div>\n <button \n cideEleButton \n variant=\"ghost\" \n size=\"xs\" \n type=\"button\" \n (click)=\"clearSelectedParent()\" \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]=\"quickAddForm\" (ngSubmit)=\"quickAddDepartment()\">\n <!-- First Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-4 tw-gap-3 tw-mb-3\">\n <!-- Department Code -->\n <div>\n <cide-ele-input \n id=\"sydept_code\" \n label=\"Code*\" \n formControlName=\"sydept_code\"\n placeholder=\"DEPT001\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Department Name -->\n <div>\n <cide-ele-input \n id=\"sydept_name\" \n label=\"Name*\" \n formControlName=\"sydept_name\"\n placeholder=\"Department name\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n\n \n <!-- Active Status -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <cide-ele-input \n id=\"sydept_isactive\"\n type=\"checkbox\"\n label=\"Active\"\n formControlName=\"sydept_isactive\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n </div>\n \n <!-- Second Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-4 tw-gap-3 tw-items-end\">\n <!-- Description -->\n <div>\n <cide-ele-textarea \n id=\"sydept_description\" \n label=\"Description\" \n formControlName=\"sydept_description\"\n placeholder=\"Department description\"\n rows=\"2\"\n size=\"sm\">\n </cide-ele-textarea>\n </div>\n \n\n \n <!-- Action Buttons -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <div class=\"tw-flex tw-space-x-2\">\n <button \n cideEleButton \n variant=\"primary\" \n size=\"sm\" \n type=\"submit\"\n [disabled]=\"quickAddForm.invalid\"\n class=\"tw-px-2 tw-py-1 tw-w-20\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n {{ isEditMode() ? 'Update' : 'Add' }}\n </button>\n <button \n cideEleButton \n variant=\"outline\" \n size=\"sm\" \n type=\"button\"\n (click)=\"resetQuickAddForm()\"\n class=\"tw-px-2 tw-py-1 tw-w-16\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">refresh</cide-ele-icon>\n Reset\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-6 tw-py-3 tw-border-b tw-border-gray-200 tw-bg-gray-50\">\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-justify-between tw-items-start sm:tw-items-center tw-space-y-3 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-5 tw-h-5\">business</cide-ele-icon>\n <h5 class=\"tw-text-base tw-font-medium tw-text-gray-900 tw-m-0\">Department Management</h5>\n </div>\n\n <!-- Actions -->\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-items-start sm:tw-items-center tw-space-y-3 sm:tw-space-y-0 sm:tw-space-x-3\">\n <!-- Search functionality is handled by the data grid -->\n </div>\n </div>\n\n <!-- Error Message -->\n @if (error()) {\n <div class=\"tw-mt-4 tw-p-4 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-5 tw-h-5 tw-mt-0.5 tw-flex-shrink-0\"></cide-ele-icon>\n <div class=\"tw-ml-3\">\n <h3 class=\"tw-text-sm tw-font-medium tw-text-red-800 tw-m-0\">Error</h3>\n <p class=\"tw-text-sm 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 \n <cide-ele-data-grid \n [config]=\"gridConfig()\" \n [templateRenderers]=\"getTemplateRenderers()\"\n [actionHandlers]=\"actionHandlers\"\n [serverSidePagination]=\"true\" \n [totalServerItems]=\"totalItems()\" \n [currentServerPage]=\"currentPage()\"\n [currentServerPageSize]=\"pageSize()\" \n (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n </div>\n\n </div>\n </div>\n\n</div>\n\n<!-- Department Details Renderer Template -->\n<ng-template #departmentDetailsRendererTemplate let-row=\"row\" let-value=\"value\">\n <div class=\"tw-flex tw-items-center tw-min-w-0\">\n <!-- Department Icon -->\n <div class=\"tw-flex-shrink-0\">\n <cide-ele-icon \n class=\"tw-text-gray-400\" \n size=\"xs\">\n business\n </cide-ele-icon>\n </div>\n \n <!-- Department Details -->\n <div class=\"tw-ml-3 tw-min-w-0 tw-flex-1\">\n <div class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\" \n [title]=\"row.sydept_name\">\n {{ row.sydept_name || 'Untitled' }}\n </div>\n @if (row.sydept_description) {\n <div class=\"tw-text-xs tw-text-gray-500 tw-truncate\" \n [title]=\"row.sydept_description\">\n {{ row.sydept_description }}\n </div>\n }\n </div>\n </div>\n</ng-template>\n\n<!-- Department Status Renderer Template -->\n<ng-template #departmentStatusRendererTemplate let-row=\"row\" let-value=\"value\">\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 tw-whitespace-nowrap\"\n [ngClass]=\"getStatusClass(row.sydept_isactive)\">\n {{ getStatusDisplay(row.sydept_isactive) }}\n </span>\n</ng-template>\n\n<!-- Actions Dropdown Renderer Template -->\n<ng-template #actionsDropdownRendererTemplate let-row=\"row\" let-value=\"value\">\n <cide-ele-dropdown \n [items]=\"getDropdownItems(row)\"\n [config]=\"{ triggerIcon: 'more_vert', triggerSize: 'sm' }\"\n (itemClick)=\"onDropdownItemClick($event, row)\">\n </cide-ele-dropdown>\n</ng-template> " }]
|
|
2661
2805
|
}], ctorParameters: () => [] });
|
|
2662
2806
|
|
|
2807
|
+
var departmentList_component = /*#__PURE__*/Object.freeze({
|
|
2808
|
+
__proto__: null,
|
|
2809
|
+
DepartmentListComponent: DepartmentListComponent
|
|
2810
|
+
});
|
|
2811
|
+
|
|
2663
2812
|
// Department Management Components
|
|
2664
2813
|
|
|
2665
2814
|
class DesignationManagementService {
|
|
2815
|
+
http;
|
|
2816
|
+
apiUrl = `${coreRoutesUrl?.designation}`;
|
|
2817
|
+
designationListSubject = new BehaviorSubject([]);
|
|
2818
|
+
designationList$ = this.designationListSubject.asObservable();
|
|
2666
2819
|
constructor(http) {
|
|
2667
2820
|
this.http = http;
|
|
2668
|
-
this.apiUrl = `${coreRoutesUrl?.designation}`;
|
|
2669
|
-
this.designationListSubject = new BehaviorSubject([]);
|
|
2670
|
-
this.designationList$ = this.designationListSubject.asObservable();
|
|
2671
2821
|
console.log('DesignationManagementService initialized - using real API');
|
|
2672
2822
|
}
|
|
2673
2823
|
/**
|
|
@@ -2840,10 +2990,10 @@ class DesignationManagementService {
|
|
|
2840
2990
|
console.error('Designation Management Service Error:', errorMessage);
|
|
2841
2991
|
return throwError(() => new Error(errorMessage));
|
|
2842
2992
|
}
|
|
2843
|
-
static
|
|
2844
|
-
static
|
|
2993
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: DesignationManagementService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2994
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: DesignationManagementService, providedIn: 'root' });
|
|
2845
2995
|
}
|
|
2846
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2996
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: DesignationManagementService, decorators: [{
|
|
2847
2997
|
type: Injectable,
|
|
2848
2998
|
args: [{
|
|
2849
2999
|
providedIn: 'root'
|
|
@@ -2851,11 +3001,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
2851
3001
|
}], ctorParameters: () => [{ type: i1.HttpClient }] });
|
|
2852
3002
|
|
|
2853
3003
|
class GradeLevelManagementService {
|
|
3004
|
+
http;
|
|
3005
|
+
apiUrl = `${coreRoutesUrl?.gradeLevel}`;
|
|
3006
|
+
gradeLevelListSubject = new BehaviorSubject([]);
|
|
3007
|
+
gradeLevelList$ = this.gradeLevelListSubject.asObservable();
|
|
2854
3008
|
constructor(http) {
|
|
2855
3009
|
this.http = http;
|
|
2856
|
-
this.apiUrl = `${coreRoutesUrl?.gradeLevel}`;
|
|
2857
|
-
this.gradeLevelListSubject = new BehaviorSubject([]);
|
|
2858
|
-
this.gradeLevelList$ = this.gradeLevelListSubject.asObservable();
|
|
2859
3010
|
console.log('GradeLevelManagementService initialized - using real API');
|
|
2860
3011
|
}
|
|
2861
3012
|
/**
|
|
@@ -3006,10 +3157,10 @@ class GradeLevelManagementService {
|
|
|
3006
3157
|
console.error('Grade Level Management Service Error:', errorMessage);
|
|
3007
3158
|
return throwError(() => new Error(errorMessage));
|
|
3008
3159
|
}
|
|
3009
|
-
static
|
|
3010
|
-
static
|
|
3160
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: GradeLevelManagementService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3161
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: GradeLevelManagementService, providedIn: 'root' });
|
|
3011
3162
|
}
|
|
3012
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3163
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: GradeLevelManagementService, decorators: [{
|
|
3013
3164
|
type: Injectable,
|
|
3014
3165
|
args: [{
|
|
3015
3166
|
providedIn: 'root'
|
|
@@ -3017,209 +3168,209 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
3017
3168
|
}], ctorParameters: () => [{ type: i1.HttpClient }] });
|
|
3018
3169
|
|
|
3019
3170
|
class DesignationListComponent {
|
|
3171
|
+
// Dependency injection
|
|
3172
|
+
destroyRef = inject(DestroyRef);
|
|
3173
|
+
designationService = inject(DesignationManagementService);
|
|
3174
|
+
gradeLevelService = inject(GradeLevelManagementService);
|
|
3175
|
+
departmentService = inject(DepartmentManagementService);
|
|
3176
|
+
appState = inject(AppStateHelperService);
|
|
3177
|
+
fb = inject(NonNullableFormBuilder);
|
|
3178
|
+
router = inject(Router);
|
|
3179
|
+
// Modern ViewChild signals for template renderers (Angular 20 approach)
|
|
3180
|
+
designationDetailsRendererTemplate = viewChild.required('designationDetailsRendererTemplate');
|
|
3181
|
+
designationStatusRendererTemplate = viewChild.required('designationStatusRendererTemplate');
|
|
3182
|
+
actionsDropdownRendererTemplate = viewChild.required('actionsDropdownRendererTemplate');
|
|
3183
|
+
// Make Math available in template
|
|
3184
|
+
Math = Math;
|
|
3185
|
+
// Signals for reactive state management
|
|
3186
|
+
designations = signal([], ...(ngDevMode ? [{ debugName: "designations" }] : []));
|
|
3187
|
+
departments = signal([], ...(ngDevMode ? [{ debugName: "departments" }] : []));
|
|
3188
|
+
gradeLevels = signal([], ...(ngDevMode ? [{ debugName: "gradeLevels" }] : []));
|
|
3189
|
+
loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
3190
|
+
error = signal(null, ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
3191
|
+
selectedItems = signal([], ...(ngDevMode ? [{ debugName: "selectedItems" }] : []));
|
|
3192
|
+
searchTerm = signal('', ...(ngDevMode ? [{ debugName: "searchTerm" }] : []));
|
|
3193
|
+
// Modern reactive forms with signals
|
|
3194
|
+
selectedParentDesignation = signal(null, ...(ngDevMode ? [{ debugName: "selectedParentDesignation" }] : []));
|
|
3195
|
+
selectedParentDepartment = signal(null, ...(ngDevMode ? [{ debugName: "selectedParentDepartment" }] : []));
|
|
3196
|
+
// Retrieved designation data
|
|
3197
|
+
retrievedDesignation = signal(null, ...(ngDevMode ? [{ debugName: "retrievedDesignation" }] : []));
|
|
3198
|
+
// Edit mode flag
|
|
3199
|
+
isEditMode = signal(false, ...(ngDevMode ? [{ debugName: "isEditMode" }] : []));
|
|
3200
|
+
// Server-side pagination state
|
|
3201
|
+
currentPage = signal(1, ...(ngDevMode ? [{ debugName: "currentPage" }] : []));
|
|
3202
|
+
pageSize = signal(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
|
|
3203
|
+
totalItems = signal(0, ...(ngDevMode ? [{ debugName: "totalItems" }] : []));
|
|
3204
|
+
// Modern reactive form with typed controls
|
|
3205
|
+
quickAddForm = this.fb.group({
|
|
3206
|
+
sydsg_name: this.fb.control('', [Validators.required, Validators.minLength(1), Validators.maxLength(100)]),
|
|
3207
|
+
sydsg_code: this.fb.control('', [Validators.required, Validators.minLength(1), Validators.maxLength(20)]),
|
|
3208
|
+
sydsg_description: this.fb.control('', [Validators.maxLength(400)]),
|
|
3209
|
+
sydsg_prent_id_desg: this.fb.control(''),
|
|
3210
|
+
sydsg_department_id_sydpt: this.fb.control('', [Validators.required]),
|
|
3211
|
+
sydsg_grade_level_id_sydsgl: this.fb.control('', [Validators.required]),
|
|
3212
|
+
sydsg_isactive: this.fb.control(true, [Validators.required]),
|
|
3213
|
+
desg_entity_id_syen: this.fb.control(this.appState.getActiveEntityId() || '', [Validators.required])
|
|
3214
|
+
});
|
|
3215
|
+
// Grid configuration signal
|
|
3216
|
+
gridConfig = signal({
|
|
3217
|
+
id: 'designation-list-grid',
|
|
3218
|
+
title: '',
|
|
3219
|
+
subtitle: '',
|
|
3220
|
+
columns: [
|
|
3221
|
+
{
|
|
3222
|
+
key: 'details',
|
|
3223
|
+
header: 'Department/Designation',
|
|
3224
|
+
type: 'custom',
|
|
3225
|
+
width: 'auto',
|
|
3226
|
+
truncate: true,
|
|
3227
|
+
align: 'left',
|
|
3228
|
+
renderer: 'designationDetailsRenderer'
|
|
3229
|
+
},
|
|
3230
|
+
{
|
|
3231
|
+
key: 'code',
|
|
3232
|
+
header: 'Code',
|
|
3233
|
+
type: 'text',
|
|
3234
|
+
width: '120px',
|
|
3235
|
+
truncate: true,
|
|
3236
|
+
align: 'left'
|
|
3237
|
+
},
|
|
3238
|
+
{
|
|
3239
|
+
key: 'grade_level',
|
|
3240
|
+
header: 'Grade Level',
|
|
3241
|
+
type: 'text',
|
|
3242
|
+
width: '120px',
|
|
3243
|
+
truncate: true,
|
|
3244
|
+
align: 'left'
|
|
3245
|
+
},
|
|
3246
|
+
{
|
|
3247
|
+
key: 'status',
|
|
3248
|
+
header: 'Status',
|
|
3249
|
+
type: 'custom',
|
|
3250
|
+
width: '100px',
|
|
3251
|
+
truncate: false,
|
|
3252
|
+
align: 'center',
|
|
3253
|
+
renderer: 'designationStatusRenderer'
|
|
3254
|
+
},
|
|
3255
|
+
{
|
|
3256
|
+
key: 'actions',
|
|
3257
|
+
header: '',
|
|
3258
|
+
type: 'custom',
|
|
3259
|
+
width: '60px',
|
|
3260
|
+
truncate: false,
|
|
3261
|
+
align: 'center',
|
|
3262
|
+
renderer: 'actionsDropdownRenderer'
|
|
3263
|
+
}
|
|
3264
|
+
],
|
|
3265
|
+
data: [],
|
|
3266
|
+
trackBy: '_id',
|
|
3267
|
+
tree: {
|
|
3268
|
+
enabled: true,
|
|
3269
|
+
primaryKey: '_id',
|
|
3270
|
+
foreignKey: 'parentId',
|
|
3271
|
+
childrenKey: 'children',
|
|
3272
|
+
levelKey: 'level',
|
|
3273
|
+
expandedKey: 'expanded',
|
|
3274
|
+
hasChildrenKey: 'hasChildren'
|
|
3275
|
+
},
|
|
3276
|
+
pagination: {
|
|
3277
|
+
enabled: true,
|
|
3278
|
+
pageSize: 10,
|
|
3279
|
+
pageSizeOptions: [10, 25, 50, 100],
|
|
3280
|
+
showQuickJump: true,
|
|
3281
|
+
showPageInfo: true,
|
|
3282
|
+
showRefresh: true
|
|
3283
|
+
},
|
|
3284
|
+
search: {
|
|
3285
|
+
enabled: true,
|
|
3286
|
+
placeholder: 'Search departments and designations...',
|
|
3287
|
+
searchableColumns: ['name', 'code', 'description'],
|
|
3288
|
+
debounceMs: 300
|
|
3289
|
+
},
|
|
3290
|
+
loading: {
|
|
3291
|
+
useDefer: true,
|
|
3292
|
+
skeletonRows: 5,
|
|
3293
|
+
showOverlay: false
|
|
3294
|
+
},
|
|
3295
|
+
scroll: {
|
|
3296
|
+
enabled: true,
|
|
3297
|
+
maxHeight: '',
|
|
3298
|
+
minHeight: '',
|
|
3299
|
+
stickyHeader: true,
|
|
3300
|
+
virtualScroll: false,
|
|
3301
|
+
rowHeight: 50
|
|
3302
|
+
},
|
|
3303
|
+
responsive: true,
|
|
3304
|
+
striped: false,
|
|
3305
|
+
bordered: true,
|
|
3306
|
+
compact: false,
|
|
3307
|
+
tableClass: 'tw-table-fixed tw-w-full tw-rounded-none',
|
|
3308
|
+
onRefresh: 'onDesignationRefresh'
|
|
3309
|
+
}, ...(ngDevMode ? [{ debugName: "gridConfig" }] : []));
|
|
3310
|
+
// Template renderers using Angular best practices
|
|
3311
|
+
templateRenderers = computed(() => ({
|
|
3312
|
+
designationDetailsRenderer: this.designationDetailsRendererTemplate(),
|
|
3313
|
+
designationStatusRenderer: this.designationStatusRendererTemplate(),
|
|
3314
|
+
actionsDropdownRenderer: this.actionsDropdownRendererTemplate()
|
|
3315
|
+
}), ...(ngDevMode ? [{ debugName: "templateRenderers" }] : []));
|
|
3020
3316
|
/**
|
|
3021
3317
|
* Get template renderers for data grid
|
|
3022
3318
|
*/
|
|
3023
3319
|
getTemplateRenderers() {
|
|
3024
3320
|
return this.templateRenderers();
|
|
3025
3321
|
}
|
|
3322
|
+
// Mixed renderers (templates + string functions)
|
|
3323
|
+
customRenderers = computed(() => ({
|
|
3324
|
+
...this.templateRenderers()
|
|
3325
|
+
}), ...(ngDevMode ? [{ debugName: "customRenderers" }] : []));
|
|
3026
3326
|
/**
|
|
3027
3327
|
* Get custom renderers adapted for current data grid compatibility
|
|
3028
3328
|
*/
|
|
3029
3329
|
getCustomRenderers() {
|
|
3030
3330
|
return {};
|
|
3031
3331
|
}
|
|
3032
|
-
//
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
this.
|
|
3036
|
-
this.
|
|
3037
|
-
this.
|
|
3038
|
-
this.
|
|
3039
|
-
this.
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
this.gradeLevels = signal([]);
|
|
3052
|
-
this.loading = signal(false);
|
|
3053
|
-
this.error = signal(null);
|
|
3054
|
-
this.selectedItems = signal([]);
|
|
3055
|
-
this.searchTerm = signal('');
|
|
3056
|
-
// Modern reactive forms with signals
|
|
3057
|
-
this.selectedParentDesignation = signal(null);
|
|
3058
|
-
this.selectedParentDepartment = signal(null);
|
|
3059
|
-
// Retrieved designation data
|
|
3060
|
-
this.retrievedDesignation = signal(null);
|
|
3061
|
-
// Edit mode flag
|
|
3062
|
-
this.isEditMode = signal(false);
|
|
3063
|
-
// Server-side pagination state
|
|
3064
|
-
this.currentPage = signal(1);
|
|
3065
|
-
this.pageSize = signal(10);
|
|
3066
|
-
this.totalItems = signal(0);
|
|
3067
|
-
// Modern reactive form with typed controls
|
|
3068
|
-
this.quickAddForm = this.fb.group({
|
|
3069
|
-
sydsg_name: this.fb.control('', [Validators.required, Validators.minLength(1), Validators.maxLength(100)]),
|
|
3070
|
-
sydsg_code: this.fb.control('', [Validators.required, Validators.minLength(1), Validators.maxLength(20)]),
|
|
3071
|
-
sydsg_description: this.fb.control('', [Validators.maxLength(400)]),
|
|
3072
|
-
sydsg_prent_id_desg: this.fb.control(''),
|
|
3073
|
-
sydsg_department_id_sydpt: this.fb.control('', [Validators.required]),
|
|
3074
|
-
sydsg_grade_level_id_sydsgl: this.fb.control('', [Validators.required]),
|
|
3075
|
-
sydsg_isactive: this.fb.control(true, [Validators.required]),
|
|
3076
|
-
desg_entity_id_syen: this.fb.control(this.appState.getActiveEntityId() || '', [Validators.required])
|
|
3077
|
-
});
|
|
3078
|
-
// Grid configuration signal
|
|
3079
|
-
this.gridConfig = signal({
|
|
3080
|
-
id: 'designation-list-grid',
|
|
3081
|
-
title: '',
|
|
3082
|
-
subtitle: '',
|
|
3083
|
-
columns: [
|
|
3084
|
-
{
|
|
3085
|
-
key: 'details',
|
|
3086
|
-
header: 'Department/Designation',
|
|
3087
|
-
type: 'custom',
|
|
3088
|
-
width: 'auto',
|
|
3089
|
-
truncate: true,
|
|
3090
|
-
align: 'left',
|
|
3091
|
-
renderer: 'designationDetailsRenderer'
|
|
3092
|
-
},
|
|
3093
|
-
{
|
|
3094
|
-
key: 'code',
|
|
3095
|
-
header: 'Code',
|
|
3096
|
-
type: 'text',
|
|
3097
|
-
width: '120px',
|
|
3098
|
-
truncate: true,
|
|
3099
|
-
align: 'left'
|
|
3100
|
-
},
|
|
3101
|
-
{
|
|
3102
|
-
key: 'grade_level',
|
|
3103
|
-
header: 'Grade Level',
|
|
3104
|
-
type: 'text',
|
|
3105
|
-
width: '120px',
|
|
3106
|
-
truncate: true,
|
|
3107
|
-
align: 'left'
|
|
3108
|
-
},
|
|
3109
|
-
{
|
|
3110
|
-
key: 'status',
|
|
3111
|
-
header: 'Status',
|
|
3112
|
-
type: 'custom',
|
|
3113
|
-
width: '100px',
|
|
3114
|
-
truncate: false,
|
|
3115
|
-
align: 'center',
|
|
3116
|
-
renderer: 'designationStatusRenderer'
|
|
3117
|
-
},
|
|
3118
|
-
{
|
|
3119
|
-
key: 'actions',
|
|
3120
|
-
header: '',
|
|
3121
|
-
type: 'custom',
|
|
3122
|
-
width: '60px',
|
|
3123
|
-
truncate: false,
|
|
3124
|
-
align: 'center',
|
|
3125
|
-
renderer: 'actionsDropdownRenderer'
|
|
3126
|
-
}
|
|
3127
|
-
],
|
|
3128
|
-
data: [],
|
|
3129
|
-
trackBy: '_id',
|
|
3130
|
-
tree: {
|
|
3131
|
-
enabled: true,
|
|
3132
|
-
primaryKey: '_id',
|
|
3133
|
-
foreignKey: 'parentId',
|
|
3134
|
-
childrenKey: 'children',
|
|
3135
|
-
levelKey: 'level',
|
|
3136
|
-
expandedKey: 'expanded',
|
|
3137
|
-
hasChildrenKey: 'hasChildren'
|
|
3138
|
-
},
|
|
3139
|
-
pagination: {
|
|
3140
|
-
enabled: true,
|
|
3141
|
-
pageSize: 10,
|
|
3142
|
-
pageSizeOptions: [10, 25, 50, 100],
|
|
3143
|
-
showQuickJump: true,
|
|
3144
|
-
showPageInfo: true,
|
|
3145
|
-
showRefresh: true
|
|
3146
|
-
},
|
|
3147
|
-
search: {
|
|
3148
|
-
enabled: true,
|
|
3149
|
-
placeholder: 'Search departments and designations...',
|
|
3150
|
-
searchableColumns: ['name', 'code', 'description'],
|
|
3151
|
-
debounceMs: 300
|
|
3152
|
-
},
|
|
3153
|
-
loading: {
|
|
3154
|
-
useDefer: true,
|
|
3155
|
-
skeletonRows: 5,
|
|
3156
|
-
showOverlay: false
|
|
3157
|
-
},
|
|
3158
|
-
scroll: {
|
|
3159
|
-
enabled: true,
|
|
3160
|
-
maxHeight: '',
|
|
3161
|
-
minHeight: '',
|
|
3162
|
-
stickyHeader: true,
|
|
3163
|
-
virtualScroll: false,
|
|
3164
|
-
rowHeight: 50
|
|
3165
|
-
},
|
|
3166
|
-
responsive: true,
|
|
3167
|
-
striped: false,
|
|
3168
|
-
bordered: true,
|
|
3169
|
-
compact: false,
|
|
3170
|
-
tableClass: 'tw-table-fixed tw-w-full tw-rounded-none',
|
|
3171
|
-
onRefresh: 'onDesignationRefresh'
|
|
3332
|
+
// Action handlers for grid actions
|
|
3333
|
+
actionHandlers = {
|
|
3334
|
+
onEditDesignation: (row) => this.editDesignation(row._id || ''),
|
|
3335
|
+
onToggleDesignation: (row) => this.toggleDesignationStatus(row._id || ''),
|
|
3336
|
+
onDeleteDesignation: (row) => this.deleteDesignation(row._id || ''),
|
|
3337
|
+
onDesignationRowClick: (row) => this.onDesignationRowClick(row),
|
|
3338
|
+
onDesignationRefresh: () => this.onDesignationRefresh(),
|
|
3339
|
+
onAddChild: (row) => this.onAddChild(row)
|
|
3340
|
+
};
|
|
3341
|
+
// Computed properties
|
|
3342
|
+
filteredItems = computed(() => {
|
|
3343
|
+
const items = this.designations();
|
|
3344
|
+
const search = this.searchTerm()?.toLowerCase();
|
|
3345
|
+
if (!search)
|
|
3346
|
+
return items;
|
|
3347
|
+
return items.filter(item => {
|
|
3348
|
+
return item.sydsg_name?.toLowerCase().includes(search) ||
|
|
3349
|
+
item.sydsg_code?.toLowerCase().includes(search) ||
|
|
3350
|
+
item.sydsg_description?.toLowerCase().includes(search);
|
|
3172
3351
|
});
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3352
|
+
}, ...(ngDevMode ? [{ debugName: "filteredItems" }] : []));
|
|
3353
|
+
hasSelection = computed(() => this.selectedItems().length > 0, ...(ngDevMode ? [{ debugName: "hasSelection" }] : []));
|
|
3354
|
+
// Pagination computed properties
|
|
3355
|
+
totalPages = computed(() => Math.ceil(this.totalItems() / this.pageSize()), ...(ngDevMode ? [{ debugName: "totalPages" }] : []));
|
|
3356
|
+
hasNextPage = computed(() => this.currentPage() < this.totalPages(), ...(ngDevMode ? [{ debugName: "hasNextPage" }] : []));
|
|
3357
|
+
hasPreviousPage = computed(() => this.currentPage() > 1, ...(ngDevMode ? [{ debugName: "hasPreviousPage" }] : []));
|
|
3358
|
+
// Grade level options for dropdown
|
|
3359
|
+
gradeLevelOptions = computed(() => {
|
|
3360
|
+
return this.gradeLevels().map(gradeLevel => ({
|
|
3361
|
+
value: gradeLevel._id || '',
|
|
3362
|
+
label: gradeLevel.sydsgl_name || 'Unknown'
|
|
3178
3363
|
}));
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3364
|
+
}, ...(ngDevMode ? [{ debugName: "gradeLevelOptions" }] : []));
|
|
3365
|
+
// Department options for dropdown
|
|
3366
|
+
departmentOptions = computed(() => {
|
|
3367
|
+
return this.departments().map(department => ({
|
|
3368
|
+
value: department._id || '',
|
|
3369
|
+
label: department.sydept_name || 'Unknown'
|
|
3182
3370
|
}));
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
onToggleDesignation: (row) => this.toggleDesignationStatus(row._id || ''),
|
|
3187
|
-
onDeleteDesignation: (row) => this.deleteDesignation(row._id || ''),
|
|
3188
|
-
onDesignationRowClick: (row) => this.onDesignationRowClick(row),
|
|
3189
|
-
onDesignationRefresh: () => this.onDesignationRefresh(),
|
|
3190
|
-
onAddChild: (row) => this.onAddChild(row)
|
|
3191
|
-
};
|
|
3192
|
-
// Computed properties
|
|
3193
|
-
this.filteredItems = computed(() => {
|
|
3194
|
-
const items = this.designations();
|
|
3195
|
-
const search = this.searchTerm()?.toLowerCase();
|
|
3196
|
-
if (!search)
|
|
3197
|
-
return items;
|
|
3198
|
-
return items.filter(item => {
|
|
3199
|
-
return item.sydsg_name?.toLowerCase().includes(search) ||
|
|
3200
|
-
item.sydsg_code?.toLowerCase().includes(search) ||
|
|
3201
|
-
item.sydsg_description?.toLowerCase().includes(search);
|
|
3202
|
-
});
|
|
3203
|
-
});
|
|
3204
|
-
this.hasSelection = computed(() => this.selectedItems().length > 0);
|
|
3205
|
-
// Pagination computed properties
|
|
3206
|
-
this.totalPages = computed(() => Math.ceil(this.totalItems() / this.pageSize()));
|
|
3207
|
-
this.hasNextPage = computed(() => this.currentPage() < this.totalPages());
|
|
3208
|
-
this.hasPreviousPage = computed(() => this.currentPage() > 1);
|
|
3209
|
-
// Grade level options for dropdown
|
|
3210
|
-
this.gradeLevelOptions = computed(() => {
|
|
3211
|
-
return this.gradeLevels().map(gradeLevel => ({
|
|
3212
|
-
value: gradeLevel._id || '',
|
|
3213
|
-
label: gradeLevel.sydsgl_name || 'Unknown'
|
|
3214
|
-
}));
|
|
3215
|
-
});
|
|
3216
|
-
// Department options for dropdown
|
|
3217
|
-
this.departmentOptions = computed(() => {
|
|
3218
|
-
return this.departments().map(department => ({
|
|
3219
|
-
value: department._id || '',
|
|
3220
|
-
label: department.sydept_name || 'Unknown'
|
|
3221
|
-
}));
|
|
3222
|
-
});
|
|
3371
|
+
}, ...(ngDevMode ? [{ debugName: "departmentOptions" }] : []));
|
|
3372
|
+
// Modern constructor with effects for initialization
|
|
3373
|
+
constructor() {
|
|
3223
3374
|
this.initializeComponent();
|
|
3224
3375
|
this.destroyRef.onDestroy(() => {
|
|
3225
3376
|
this.cleanupEventListeners();
|
|
@@ -4106,10 +4257,10 @@ class DesignationListComponent {
|
|
|
4106
4257
|
trackByItemId(index, item) {
|
|
4107
4258
|
return item._id || '';
|
|
4108
4259
|
}
|
|
4109
|
-
static
|
|
4110
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: DesignationListComponent, isStandalone: true, selector: "cide-core-app-designation-list", viewQueries: [{ propertyName: "designationDetailsRendererTemplate", first: true, predicate: ["designationDetailsRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "designationStatusRendererTemplate", first: true, predicate: ["designationStatusRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "actionsDropdownRendererTemplate", first: true, predicate: ["actionsDropdownRendererTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Designation List 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-6 tw-py-4 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-5 tw-h-5\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n <h6 class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-m-0\">{{ isEditMode() ? 'Edit Designation' : 'Quick Add Designation' }}</h6>\n </div>\n @if (selectedParentDesignation()) {\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\">{{ selectedParentDesignation()?.sydsg_name }}</span>\n </div>\n <button \n cideEleButton \n variant=\"ghost\" \n size=\"xs\" \n type=\"button\" \n (click)=\"clearSelectedParent()\" \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 @if (selectedParentDepartment()) {\n <div class=\"tw-flex tw-items-center tw-space-x-3 tw-bg-green-50 tw-border tw-border-green-200 tw-px-4 tw-py-1 tw-rounded-lg\">\n <cide-ele-icon class=\"tw-text-green-600 tw-w-4 tw-h-4\">business</cide-ele-icon>\n <div class=\"tw-flex tw-items-center tw-space-x-2\">\n <span class=\"tw-text-sm tw-text-green-600 tw-font-medium\">{{ isEditMode() ? 'Department:' : 'Department:' }}</span>\n <span class=\"tw-text-sm tw-text-green-800 tw-font-semibold\">{{ selectedParentDepartment()?.sydept_name }}</span>\n </div>\n <button \n cideEleButton \n variant=\"ghost\" \n size=\"xs\" \n type=\"button\" \n (click)=\"clearSelectedParentDepartment()\" \n class=\"tw-text-green-400 hover:tw-text-green-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]=\"quickAddForm\" (ngSubmit)=\"quickAddDesignation()\">\n <!-- First Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-5 tw-gap-3 tw-mb-3\">\n <!-- Designation Name -->\n <div>\n <cide-ele-input \n id=\"sydsg_name\" \n label=\"Name*\" \n formControlName=\"sydsg_name\"\n placeholder=\"Designation name\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Designation Code -->\n <div>\n <cide-ele-input \n id=\"sydsg_code\" \n label=\"Code*\" \n formControlName=\"sydsg_code\"\n placeholder=\"DESG001\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Grade Level -->\n <div>\n <cide-ele-select \n id=\"sydsg_grade_level_id_sydsgl\"\n label=\"Grade Level*\" \n [options]=\"gradeLevelOptions()\" \n formControlName=\"sydsg_grade_level_id_sydsgl\"\n placeholder=\"Select grade level\"\n size=\"sm\">\n </cide-ele-select>\n </div>\n \n <!-- Department -->\n <div>\n <cide-ele-select \n id=\"sydsg_department_id_sydpt\"\n label=\"Department*\" \n [options]=\"departmentOptions()\" \n formControlName=\"sydsg_department_id_sydpt\"\n placeholder=\"Select department\"\n size=\"sm\">\n </cide-ele-select>\n </div>\n \n <!-- Active Status -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <cide-ele-input \n id=\"sydsg_isactive\"\n type=\"checkbox\"\n label=\"Active\"\n formControlName=\"sydsg_isactive\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n </div>\n \n <!-- Second Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-4 tw-gap-3 tw-items-end\">\n <!-- Description -->\n <div>\n <cide-ele-textarea \n id=\"sydsg_description\" \n label=\"Description\" \n formControlName=\"sydsg_description\"\n placeholder=\"Designation description\"\n rows=\"2\"\n size=\"sm\">\n </cide-ele-textarea>\n </div>\n \n <!-- Entity ID (Hidden) -->\n <div class=\"tw-hidden\">\n <cide-ele-input \n id=\"desg_entity_id_syen\" \n label=\"Entity ID*\" \n formControlName=\"desg_entity_id_syen\"\n placeholder=\"Entity ID\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Action Buttons -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <div class=\"tw-flex tw-space-x-2\">\n <button \n cideEleButton \n variant=\"primary\" \n size=\"sm\" \n type=\"submit\"\n [disabled]=\"quickAddForm.invalid\"\n class=\"tw-px-2 tw-py-1 tw-w-20\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n {{ isEditMode() ? 'Update' : 'Add' }}\n </button>\n <button \n cideEleButton \n variant=\"outline\" \n size=\"sm\" \n type=\"button\"\n (click)=\"resetQuickAddForm()\"\n class=\"tw-px-2 tw-py-1 tw-w-16\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">refresh</cide-ele-icon>\n Reset\n </button>\n </div>\n </div>\n </div>\n </form>\n </div>\n </div>\n\n\n\n <!-- Header Section with Filters -->\n <div class=\"tw-table-row tw-h-0\">\n <div class=\"tw-table-cell tw-px-6 tw-py-3 tw-border-b tw-border-gray-200 tw-bg-gray-50\">\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-justify-between tw-items-start sm:tw-items-center tw-space-y-3 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-5 tw-h-5\">work</cide-ele-icon>\n <h5 class=\"tw-text-base tw-font-medium tw-text-gray-900 tw-m-0\">Designation Management</h5>\n </div>\n\n <!-- Actions -->\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-items-start sm:tw-items-center tw-space-y-3 sm:tw-space-y-0 sm:tw-space-x-3\">\n <!-- Search functionality is handled by the data grid -->\n </div>\n </div>\n\n <!-- Error Message -->\n @if (error()) {\n <div class=\"tw-mt-4 tw-p-4 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-5 tw-h-5 tw-mt-0.5 tw-flex-shrink-0\"></cide-ele-icon>\n <div class=\"tw-ml-3\">\n <h3 class=\"tw-text-sm tw-font-medium tw-text-red-800 tw-m-0\">Error</h3>\n <p class=\"tw-text-sm 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 \n <cide-ele-data-grid \n [config]=\"gridConfig()\" \n [templateRenderers]=\"getTemplateRenderers()\"\n [actionHandlers]=\"actionHandlers\"\n [serverSidePagination]=\"true\" \n [totalServerItems]=\"totalItems()\" \n [currentServerPage]=\"currentPage()\"\n [currentServerPageSize]=\"pageSize()\" \n (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n </div>\n\n </div>\n </div>\n\n</div>\n\n<!-- Designation Details Renderer Template -->\n<ng-template #designationDetailsRendererTemplate let-row=\"row\" let-value=\"value\">\n <div class=\"tw-flex tw-items-center tw-min-w-0\">\n <!-- Dynamic Icon based on type -->\n <div class=\"tw-flex-shrink-0\">\n <cide-ele-icon \n [class]=\"row.type === 'department' ? 'tw-text-green-500' : 'tw-text-blue-500'\" \n size=\"xs\">\n {{ row.type === 'department' ? 'business' : 'work' }}\n </cide-ele-icon>\n </div>\n \n <!-- Details -->\n <div class=\"tw-ml-3 tw-min-w-0 tw-flex-1\">\n <div class=\"tw-flex tw-items-center tw-space-x-2\">\n <div class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\" \n [title]=\"row.name\">\n {{ row.name || 'Untitled' }}\n </div>\n @if (row.type === 'department') {\n <span class=\"tw-inline-flex tw-items-center tw-px-2 tw-py-0.5 tw-rounded-full tw-text-xs tw-font-medium tw-bg-green-100 tw-text-green-800\">\n Department\n </span>\n }\n </div>\n @if (row.description) {\n <div class=\"tw-text-xs tw-text-gray-500 tw-truncate\" \n [title]=\"row.description\">\n {{ row.description }}\n </div>\n }\n </div>\n </div>\n</ng-template>\n\n<!-- Designation Status Renderer Template -->\n<ng-template #designationStatusRendererTemplate let-row=\"row\" let-value=\"value\">\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 tw-whitespace-nowrap\"\n [ngClass]=\"getStatusClass(row.status)\">\n {{ getStatusDisplay(row.status) }}\n </span>\n</ng-template>\n\n<!-- Actions Dropdown Renderer Template -->\n<ng-template #actionsDropdownRendererTemplate let-row=\"row\" let-value=\"value\">\n <cide-ele-dropdown \n [items]=\"getDropdownItems(row)\"\n [config]=\"{ triggerIcon: 'more_vert', triggerSize: 'sm' }\"\n (itemClick)=\"onDropdownItemClick($event, row)\">\n </cide-ele-dropdown>\n</ng-template> ", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: CideEleDataGridComponent, selector: "cide-ele-data-grid", inputs: ["config", "customRenderers", "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: 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"], 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: 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"] }] }); }
|
|
4260
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: DesignationListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4261
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: DesignationListComponent, isStandalone: true, selector: "cide-core-app-designation-list", viewQueries: [{ propertyName: "designationDetailsRendererTemplate", first: true, predicate: ["designationDetailsRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "designationStatusRendererTemplate", first: true, predicate: ["designationStatusRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "actionsDropdownRendererTemplate", first: true, predicate: ["actionsDropdownRendererTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Designation List 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-6 tw-py-4 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-5 tw-h-5\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n <h6 class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-m-0\">{{ isEditMode() ? 'Edit Designation' : 'Quick Add Designation' }}</h6>\n </div>\n @if (selectedParentDesignation()) {\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\">{{ selectedParentDesignation()?.sydsg_name }}</span>\n </div>\n <button \n cideEleButton \n variant=\"ghost\" \n size=\"xs\" \n type=\"button\" \n (click)=\"clearSelectedParent()\" \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 @if (selectedParentDepartment()) {\n <div class=\"tw-flex tw-items-center tw-space-x-3 tw-bg-green-50 tw-border tw-border-green-200 tw-px-4 tw-py-1 tw-rounded-lg\">\n <cide-ele-icon class=\"tw-text-green-600 tw-w-4 tw-h-4\">business</cide-ele-icon>\n <div class=\"tw-flex tw-items-center tw-space-x-2\">\n <span class=\"tw-text-sm tw-text-green-600 tw-font-medium\">{{ isEditMode() ? 'Department:' : 'Department:' }}</span>\n <span class=\"tw-text-sm tw-text-green-800 tw-font-semibold\">{{ selectedParentDepartment()?.sydept_name }}</span>\n </div>\n <button \n cideEleButton \n variant=\"ghost\" \n size=\"xs\" \n type=\"button\" \n (click)=\"clearSelectedParentDepartment()\" \n class=\"tw-text-green-400 hover:tw-text-green-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]=\"quickAddForm\" (ngSubmit)=\"quickAddDesignation()\">\n <!-- First Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-5 tw-gap-3 tw-mb-3\">\n <!-- Designation Name -->\n <div>\n <cide-ele-input \n id=\"sydsg_name\" \n label=\"Name*\" \n formControlName=\"sydsg_name\"\n placeholder=\"Designation name\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Designation Code -->\n <div>\n <cide-ele-input \n id=\"sydsg_code\" \n label=\"Code*\" \n formControlName=\"sydsg_code\"\n placeholder=\"DESG001\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Grade Level -->\n <div>\n <cide-ele-select \n id=\"sydsg_grade_level_id_sydsgl\"\n label=\"Grade Level*\" \n [options]=\"gradeLevelOptions()\" \n formControlName=\"sydsg_grade_level_id_sydsgl\"\n placeholder=\"Select grade level\"\n size=\"sm\">\n </cide-ele-select>\n </div>\n \n <!-- Department -->\n <div>\n <cide-ele-select \n id=\"sydsg_department_id_sydpt\"\n label=\"Department*\" \n [options]=\"departmentOptions()\" \n formControlName=\"sydsg_department_id_sydpt\"\n placeholder=\"Select department\"\n size=\"sm\">\n </cide-ele-select>\n </div>\n \n <!-- Active Status -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <cide-ele-input \n id=\"sydsg_isactive\"\n type=\"checkbox\"\n label=\"Active\"\n formControlName=\"sydsg_isactive\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n </div>\n \n <!-- Second Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-4 tw-gap-3 tw-items-end\">\n <!-- Description -->\n <div>\n <cide-ele-textarea \n id=\"sydsg_description\" \n label=\"Description\" \n formControlName=\"sydsg_description\"\n placeholder=\"Designation description\"\n rows=\"2\"\n size=\"sm\">\n </cide-ele-textarea>\n </div>\n \n <!-- Entity ID (Hidden) -->\n <div class=\"tw-hidden\">\n <cide-ele-input \n id=\"desg_entity_id_syen\" \n label=\"Entity ID*\" \n formControlName=\"desg_entity_id_syen\"\n placeholder=\"Entity ID\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Action Buttons -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <div class=\"tw-flex tw-space-x-2\">\n <button \n cideEleButton \n variant=\"primary\" \n size=\"sm\" \n type=\"submit\"\n [disabled]=\"quickAddForm.invalid\"\n class=\"tw-px-2 tw-py-1 tw-w-20\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n {{ isEditMode() ? 'Update' : 'Add' }}\n </button>\n <button \n cideEleButton \n variant=\"outline\" \n size=\"sm\" \n type=\"button\"\n (click)=\"resetQuickAddForm()\"\n class=\"tw-px-2 tw-py-1 tw-w-16\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">refresh</cide-ele-icon>\n Reset\n </button>\n </div>\n </div>\n </div>\n </form>\n </div>\n </div>\n\n\n\n <!-- Header Section with Filters -->\n <div class=\"tw-table-row tw-h-0\">\n <div class=\"tw-table-cell tw-px-6 tw-py-3 tw-border-b tw-border-gray-200 tw-bg-gray-50\">\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-justify-between tw-items-start sm:tw-items-center tw-space-y-3 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-5 tw-h-5\">work</cide-ele-icon>\n <h5 class=\"tw-text-base tw-font-medium tw-text-gray-900 tw-m-0\">Designation Management</h5>\n </div>\n\n <!-- Actions -->\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-items-start sm:tw-items-center tw-space-y-3 sm:tw-space-y-0 sm:tw-space-x-3\">\n <!-- Search functionality is handled by the data grid -->\n </div>\n </div>\n\n <!-- Error Message -->\n @if (error()) {\n <div class=\"tw-mt-4 tw-p-4 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-5 tw-h-5 tw-mt-0.5 tw-flex-shrink-0\"></cide-ele-icon>\n <div class=\"tw-ml-3\">\n <h3 class=\"tw-text-sm tw-font-medium tw-text-red-800 tw-m-0\">Error</h3>\n <p class=\"tw-text-sm 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 \n <cide-ele-data-grid \n [config]=\"gridConfig()\" \n [templateRenderers]=\"getTemplateRenderers()\"\n [actionHandlers]=\"actionHandlers\"\n [serverSidePagination]=\"true\" \n [totalServerItems]=\"totalItems()\" \n [currentServerPage]=\"currentPage()\"\n [currentServerPageSize]=\"pageSize()\" \n (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n </div>\n\n </div>\n </div>\n\n</div>\n\n<!-- Designation Details Renderer Template -->\n<ng-template #designationDetailsRendererTemplate let-row=\"row\" let-value=\"value\">\n <div class=\"tw-flex tw-items-center tw-min-w-0\">\n <!-- Dynamic Icon based on type -->\n <div class=\"tw-flex-shrink-0\">\n <cide-ele-icon \n [class]=\"row.type === 'department' ? 'tw-text-green-500' : 'tw-text-blue-500'\" \n size=\"xs\">\n {{ row.type === 'department' ? 'business' : 'work' }}\n </cide-ele-icon>\n </div>\n \n <!-- Details -->\n <div class=\"tw-ml-3 tw-min-w-0 tw-flex-1\">\n <div class=\"tw-flex tw-items-center tw-space-x-2\">\n <div class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\" \n [title]=\"row.name\">\n {{ row.name || 'Untitled' }}\n </div>\n @if (row.type === 'department') {\n <span class=\"tw-inline-flex tw-items-center tw-px-2 tw-py-0.5 tw-rounded-full tw-text-xs tw-font-medium tw-bg-green-100 tw-text-green-800\">\n Department\n </span>\n }\n </div>\n @if (row.description) {\n <div class=\"tw-text-xs tw-text-gray-500 tw-truncate\" \n [title]=\"row.description\">\n {{ row.description }}\n </div>\n }\n </div>\n </div>\n</ng-template>\n\n<!-- Designation Status Renderer Template -->\n<ng-template #designationStatusRendererTemplate let-row=\"row\" let-value=\"value\">\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 tw-whitespace-nowrap\"\n [ngClass]=\"getStatusClass(row.status)\">\n {{ getStatusDisplay(row.status) }}\n </span>\n</ng-template>\n\n<!-- Actions Dropdown Renderer Template -->\n<ng-template #actionsDropdownRendererTemplate let-row=\"row\" let-value=\"value\">\n <cide-ele-dropdown \n [items]=\"getDropdownItems(row)\"\n [config]=\"{ triggerIcon: 'more_vert', triggerSize: 'sm' }\"\n (itemClick)=\"onDropdownItemClick($event, row)\">\n </cide-ele-dropdown>\n</ng-template> ", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: CideEleDataGridComponent, selector: "cide-ele-data-grid", inputs: ["config", "customRenderers", "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: 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"], 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: 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"] }] });
|
|
4111
4262
|
}
|
|
4112
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4263
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: DesignationListComponent, decorators: [{
|
|
4113
4264
|
type: Component,
|
|
4114
4265
|
args: [{ selector: 'cide-core-app-designation-list', standalone: true, imports: [
|
|
4115
4266
|
CommonModule,
|
|
@@ -4125,185 +4276,190 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
4125
4276
|
], template: "<!-- Designation List 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-6 tw-py-4 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-5 tw-h-5\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n <h6 class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-m-0\">{{ isEditMode() ? 'Edit Designation' : 'Quick Add Designation' }}</h6>\n </div>\n @if (selectedParentDesignation()) {\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\">{{ selectedParentDesignation()?.sydsg_name }}</span>\n </div>\n <button \n cideEleButton \n variant=\"ghost\" \n size=\"xs\" \n type=\"button\" \n (click)=\"clearSelectedParent()\" \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 @if (selectedParentDepartment()) {\n <div class=\"tw-flex tw-items-center tw-space-x-3 tw-bg-green-50 tw-border tw-border-green-200 tw-px-4 tw-py-1 tw-rounded-lg\">\n <cide-ele-icon class=\"tw-text-green-600 tw-w-4 tw-h-4\">business</cide-ele-icon>\n <div class=\"tw-flex tw-items-center tw-space-x-2\">\n <span class=\"tw-text-sm tw-text-green-600 tw-font-medium\">{{ isEditMode() ? 'Department:' : 'Department:' }}</span>\n <span class=\"tw-text-sm tw-text-green-800 tw-font-semibold\">{{ selectedParentDepartment()?.sydept_name }}</span>\n </div>\n <button \n cideEleButton \n variant=\"ghost\" \n size=\"xs\" \n type=\"button\" \n (click)=\"clearSelectedParentDepartment()\" \n class=\"tw-text-green-400 hover:tw-text-green-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]=\"quickAddForm\" (ngSubmit)=\"quickAddDesignation()\">\n <!-- First Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-5 tw-gap-3 tw-mb-3\">\n <!-- Designation Name -->\n <div>\n <cide-ele-input \n id=\"sydsg_name\" \n label=\"Name*\" \n formControlName=\"sydsg_name\"\n placeholder=\"Designation name\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Designation Code -->\n <div>\n <cide-ele-input \n id=\"sydsg_code\" \n label=\"Code*\" \n formControlName=\"sydsg_code\"\n placeholder=\"DESG001\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Grade Level -->\n <div>\n <cide-ele-select \n id=\"sydsg_grade_level_id_sydsgl\"\n label=\"Grade Level*\" \n [options]=\"gradeLevelOptions()\" \n formControlName=\"sydsg_grade_level_id_sydsgl\"\n placeholder=\"Select grade level\"\n size=\"sm\">\n </cide-ele-select>\n </div>\n \n <!-- Department -->\n <div>\n <cide-ele-select \n id=\"sydsg_department_id_sydpt\"\n label=\"Department*\" \n [options]=\"departmentOptions()\" \n formControlName=\"sydsg_department_id_sydpt\"\n placeholder=\"Select department\"\n size=\"sm\">\n </cide-ele-select>\n </div>\n \n <!-- Active Status -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <cide-ele-input \n id=\"sydsg_isactive\"\n type=\"checkbox\"\n label=\"Active\"\n formControlName=\"sydsg_isactive\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n </div>\n \n <!-- Second Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-4 tw-gap-3 tw-items-end\">\n <!-- Description -->\n <div>\n <cide-ele-textarea \n id=\"sydsg_description\" \n label=\"Description\" \n formControlName=\"sydsg_description\"\n placeholder=\"Designation description\"\n rows=\"2\"\n size=\"sm\">\n </cide-ele-textarea>\n </div>\n \n <!-- Entity ID (Hidden) -->\n <div class=\"tw-hidden\">\n <cide-ele-input \n id=\"desg_entity_id_syen\" \n label=\"Entity ID*\" \n formControlName=\"desg_entity_id_syen\"\n placeholder=\"Entity ID\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Action Buttons -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <div class=\"tw-flex tw-space-x-2\">\n <button \n cideEleButton \n variant=\"primary\" \n size=\"sm\" \n type=\"submit\"\n [disabled]=\"quickAddForm.invalid\"\n class=\"tw-px-2 tw-py-1 tw-w-20\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n {{ isEditMode() ? 'Update' : 'Add' }}\n </button>\n <button \n cideEleButton \n variant=\"outline\" \n size=\"sm\" \n type=\"button\"\n (click)=\"resetQuickAddForm()\"\n class=\"tw-px-2 tw-py-1 tw-w-16\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">refresh</cide-ele-icon>\n Reset\n </button>\n </div>\n </div>\n </div>\n </form>\n </div>\n </div>\n\n\n\n <!-- Header Section with Filters -->\n <div class=\"tw-table-row tw-h-0\">\n <div class=\"tw-table-cell tw-px-6 tw-py-3 tw-border-b tw-border-gray-200 tw-bg-gray-50\">\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-justify-between tw-items-start sm:tw-items-center tw-space-y-3 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-5 tw-h-5\">work</cide-ele-icon>\n <h5 class=\"tw-text-base tw-font-medium tw-text-gray-900 tw-m-0\">Designation Management</h5>\n </div>\n\n <!-- Actions -->\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-items-start sm:tw-items-center tw-space-y-3 sm:tw-space-y-0 sm:tw-space-x-3\">\n <!-- Search functionality is handled by the data grid -->\n </div>\n </div>\n\n <!-- Error Message -->\n @if (error()) {\n <div class=\"tw-mt-4 tw-p-4 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-5 tw-h-5 tw-mt-0.5 tw-flex-shrink-0\"></cide-ele-icon>\n <div class=\"tw-ml-3\">\n <h3 class=\"tw-text-sm tw-font-medium tw-text-red-800 tw-m-0\">Error</h3>\n <p class=\"tw-text-sm 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 \n <cide-ele-data-grid \n [config]=\"gridConfig()\" \n [templateRenderers]=\"getTemplateRenderers()\"\n [actionHandlers]=\"actionHandlers\"\n [serverSidePagination]=\"true\" \n [totalServerItems]=\"totalItems()\" \n [currentServerPage]=\"currentPage()\"\n [currentServerPageSize]=\"pageSize()\" \n (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n </div>\n\n </div>\n </div>\n\n</div>\n\n<!-- Designation Details Renderer Template -->\n<ng-template #designationDetailsRendererTemplate let-row=\"row\" let-value=\"value\">\n <div class=\"tw-flex tw-items-center tw-min-w-0\">\n <!-- Dynamic Icon based on type -->\n <div class=\"tw-flex-shrink-0\">\n <cide-ele-icon \n [class]=\"row.type === 'department' ? 'tw-text-green-500' : 'tw-text-blue-500'\" \n size=\"xs\">\n {{ row.type === 'department' ? 'business' : 'work' }}\n </cide-ele-icon>\n </div>\n \n <!-- Details -->\n <div class=\"tw-ml-3 tw-min-w-0 tw-flex-1\">\n <div class=\"tw-flex tw-items-center tw-space-x-2\">\n <div class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\" \n [title]=\"row.name\">\n {{ row.name || 'Untitled' }}\n </div>\n @if (row.type === 'department') {\n <span class=\"tw-inline-flex tw-items-center tw-px-2 tw-py-0.5 tw-rounded-full tw-text-xs tw-font-medium tw-bg-green-100 tw-text-green-800\">\n Department\n </span>\n }\n </div>\n @if (row.description) {\n <div class=\"tw-text-xs tw-text-gray-500 tw-truncate\" \n [title]=\"row.description\">\n {{ row.description }}\n </div>\n }\n </div>\n </div>\n</ng-template>\n\n<!-- Designation Status Renderer Template -->\n<ng-template #designationStatusRendererTemplate let-row=\"row\" let-value=\"value\">\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 tw-whitespace-nowrap\"\n [ngClass]=\"getStatusClass(row.status)\">\n {{ getStatusDisplay(row.status) }}\n </span>\n</ng-template>\n\n<!-- Actions Dropdown Renderer Template -->\n<ng-template #actionsDropdownRendererTemplate let-row=\"row\" let-value=\"value\">\n <cide-ele-dropdown \n [items]=\"getDropdownItems(row)\"\n [config]=\"{ triggerIcon: 'more_vert', triggerSize: 'sm' }\"\n (itemClick)=\"onDropdownItemClick($event, row)\">\n </cide-ele-dropdown>\n</ng-template> " }]
|
|
4126
4277
|
}], ctorParameters: () => [] });
|
|
4127
4278
|
|
|
4279
|
+
var designationList_component = /*#__PURE__*/Object.freeze({
|
|
4280
|
+
__proto__: null,
|
|
4281
|
+
DesignationListComponent: DesignationListComponent
|
|
4282
|
+
});
|
|
4283
|
+
|
|
4128
4284
|
// Designation Management Components
|
|
4129
4285
|
|
|
4130
4286
|
class GradeLevelListComponent {
|
|
4287
|
+
// Dependency injection
|
|
4288
|
+
destroyRef = inject(DestroyRef);
|
|
4289
|
+
gradeLevelService = inject(GradeLevelManagementService);
|
|
4290
|
+
appState = inject(AppStateHelperService);
|
|
4291
|
+
fb = inject(NonNullableFormBuilder);
|
|
4292
|
+
router = inject(Router);
|
|
4293
|
+
// Modern ViewChild signals for template renderers (Angular 20 approach)
|
|
4294
|
+
dragHandleRendererTemplate = viewChild.required('dragHandleRendererTemplate');
|
|
4295
|
+
gradeLevelDetailsRendererTemplate = viewChild.required('gradeLevelDetailsRendererTemplate');
|
|
4296
|
+
gradeLevelStatusRendererTemplate = viewChild.required('gradeLevelStatusRendererTemplate');
|
|
4297
|
+
actionsDropdownRendererTemplate = viewChild.required('actionsDropdownRendererTemplate');
|
|
4298
|
+
// Make Math available in template
|
|
4299
|
+
Math = Math;
|
|
4300
|
+
// Signals for reactive state management
|
|
4301
|
+
gradeLevels = signal([], ...(ngDevMode ? [{ debugName: "gradeLevels" }] : []));
|
|
4302
|
+
loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
4303
|
+
error = signal(null, ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
4304
|
+
selectedItems = signal([], ...(ngDevMode ? [{ debugName: "selectedItems" }] : []));
|
|
4305
|
+
searchTerm = signal('', ...(ngDevMode ? [{ debugName: "searchTerm" }] : []));
|
|
4306
|
+
// Retrieved grade level data
|
|
4307
|
+
retrievedGradeLevel = signal(null, ...(ngDevMode ? [{ debugName: "retrievedGradeLevel" }] : []));
|
|
4308
|
+
// Edit mode flag
|
|
4309
|
+
isEditMode = signal(false, ...(ngDevMode ? [{ debugName: "isEditMode" }] : []));
|
|
4310
|
+
// Drag order management
|
|
4311
|
+
originalOrder = signal([], ...(ngDevMode ? [{ debugName: "originalOrder" }] : []));
|
|
4312
|
+
hasOrderChanged = signal(false, ...(ngDevMode ? [{ debugName: "hasOrderChanged" }] : []));
|
|
4313
|
+
// Server-side pagination state
|
|
4314
|
+
currentPage = signal(1, ...(ngDevMode ? [{ debugName: "currentPage" }] : []));
|
|
4315
|
+
pageSize = signal(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
|
|
4316
|
+
totalItems = signal(0, ...(ngDevMode ? [{ debugName: "totalItems" }] : []));
|
|
4317
|
+
// Modern reactive form with typed controls
|
|
4318
|
+
quickAddForm = this.fb.group({
|
|
4319
|
+
sydsgl_name: this.fb.control('', [Validators.required, Validators.minLength(1), Validators.maxLength(20)]),
|
|
4320
|
+
sydsgl_description: this.fb.control('', [Validators.maxLength(400)]),
|
|
4321
|
+
sydsgl_order: this.fb.control(1, [Validators.required, Validators.min(1), Validators.max(100)]),
|
|
4322
|
+
sydsgl_isactive: this.fb.control(true, [Validators.required]),
|
|
4323
|
+
sydsgl_entity_id_syen: this.fb.control(this.appState.getActiveEntityId() || '', [Validators.required])
|
|
4324
|
+
});
|
|
4325
|
+
// Grid configuration signal
|
|
4326
|
+
gridConfig = signal({
|
|
4327
|
+
id: 'grade-level-list-grid',
|
|
4328
|
+
title: '',
|
|
4329
|
+
subtitle: '',
|
|
4330
|
+
columns: [
|
|
4331
|
+
{
|
|
4332
|
+
key: 'dragHandle',
|
|
4333
|
+
header: '',
|
|
4334
|
+
type: 'custom',
|
|
4335
|
+
width: '40px',
|
|
4336
|
+
truncate: false,
|
|
4337
|
+
align: 'center',
|
|
4338
|
+
renderer: 'dragHandleRenderer'
|
|
4339
|
+
},
|
|
4340
|
+
{
|
|
4341
|
+
key: 'details',
|
|
4342
|
+
header: 'Grade Level',
|
|
4343
|
+
type: 'custom',
|
|
4344
|
+
width: 'auto',
|
|
4345
|
+
truncate: true,
|
|
4346
|
+
align: 'left',
|
|
4347
|
+
renderer: 'gradeLevelDetailsRenderer'
|
|
4348
|
+
},
|
|
4349
|
+
{
|
|
4350
|
+
key: 'sydsgl_isactive',
|
|
4351
|
+
header: 'Status',
|
|
4352
|
+
type: 'custom',
|
|
4353
|
+
width: '100px',
|
|
4354
|
+
truncate: false,
|
|
4355
|
+
align: 'center',
|
|
4356
|
+
renderer: 'gradeLevelStatusRenderer'
|
|
4357
|
+
},
|
|
4358
|
+
{
|
|
4359
|
+
key: 'actions',
|
|
4360
|
+
header: '',
|
|
4361
|
+
type: 'custom',
|
|
4362
|
+
width: '60px',
|
|
4363
|
+
truncate: false,
|
|
4364
|
+
align: 'center',
|
|
4365
|
+
renderer: 'actionsDropdownRenderer'
|
|
4366
|
+
}
|
|
4367
|
+
],
|
|
4368
|
+
data: [],
|
|
4369
|
+
trackBy: '_id',
|
|
4370
|
+
dragDrop: {
|
|
4371
|
+
enabled: true,
|
|
4372
|
+
orderField: 'sydsgl_order',
|
|
4373
|
+
dragClass: 'tw-opacity-50 tw-bg-blue-50',
|
|
4374
|
+
dropClass: 'tw-bg-green-50'
|
|
4375
|
+
},
|
|
4376
|
+
pagination: {
|
|
4377
|
+
enabled: true,
|
|
4378
|
+
pageSize: 10,
|
|
4379
|
+
pageSizeOptions: [10, 25, 50, 100],
|
|
4380
|
+
showQuickJump: true,
|
|
4381
|
+
showPageInfo: true,
|
|
4382
|
+
showRefresh: true
|
|
4383
|
+
},
|
|
4384
|
+
search: {
|
|
4385
|
+
enabled: true,
|
|
4386
|
+
placeholder: 'Search grade levels...',
|
|
4387
|
+
searchableColumns: ['sydsgl_name', 'sydsgl_description'],
|
|
4388
|
+
debounceMs: 300
|
|
4389
|
+
},
|
|
4390
|
+
loading: {
|
|
4391
|
+
useDefer: true,
|
|
4392
|
+
skeletonRows: 5,
|
|
4393
|
+
showOverlay: false
|
|
4394
|
+
},
|
|
4395
|
+
scroll: {
|
|
4396
|
+
enabled: true,
|
|
4397
|
+
maxHeight: '',
|
|
4398
|
+
minHeight: '',
|
|
4399
|
+
stickyHeader: true,
|
|
4400
|
+
virtualScroll: false,
|
|
4401
|
+
rowHeight: 50
|
|
4402
|
+
},
|
|
4403
|
+
responsive: true,
|
|
4404
|
+
striped: false,
|
|
4405
|
+
bordered: true,
|
|
4406
|
+
compact: false,
|
|
4407
|
+
tableClass: 'tw-table-fixed tw-w-full tw-rounded-none',
|
|
4408
|
+
onRefresh: 'onGradeLevelRefresh'
|
|
4409
|
+
}, ...(ngDevMode ? [{ debugName: "gridConfig" }] : []));
|
|
4410
|
+
// Template renderers using Angular best practices
|
|
4411
|
+
templateRenderers = computed(() => ({
|
|
4412
|
+
dragHandleRenderer: this.dragHandleRendererTemplate(),
|
|
4413
|
+
gradeLevelDetailsRenderer: this.gradeLevelDetailsRendererTemplate(),
|
|
4414
|
+
gradeLevelStatusRenderer: this.gradeLevelStatusRendererTemplate(),
|
|
4415
|
+
actionsDropdownRenderer: this.actionsDropdownRendererTemplate()
|
|
4416
|
+
}), ...(ngDevMode ? [{ debugName: "templateRenderers" }] : []));
|
|
4131
4417
|
/**
|
|
4132
4418
|
* Get template renderers for data grid
|
|
4133
4419
|
*/
|
|
4134
4420
|
getTemplateRenderers() {
|
|
4135
4421
|
return this.templateRenderers();
|
|
4136
4422
|
}
|
|
4423
|
+
// Mixed renderers (templates + string functions)
|
|
4424
|
+
customRenderers = computed(() => ({
|
|
4425
|
+
...this.templateRenderers()
|
|
4426
|
+
}), ...(ngDevMode ? [{ debugName: "customRenderers" }] : []));
|
|
4137
4427
|
/**
|
|
4138
4428
|
* Get custom renderers adapted for current data grid compatibility
|
|
4139
4429
|
*/
|
|
4140
4430
|
getCustomRenderers() {
|
|
4141
4431
|
return {};
|
|
4142
4432
|
}
|
|
4433
|
+
// Action handlers for grid actions
|
|
4434
|
+
actionHandlers = {
|
|
4435
|
+
onEditGradeLevel: (row) => this.editGradeLevel(row._id || ''),
|
|
4436
|
+
onToggleGradeLevel: (row) => this.toggleGradeLevelStatus(row._id || ''),
|
|
4437
|
+
onDeleteGradeLevel: (row) => this.deleteGradeLevel(row._id || ''),
|
|
4438
|
+
onGradeLevelRowClick: (row) => this.onGradeLevelRowClick(row),
|
|
4439
|
+
onGradeLevelRefresh: () => this.onGradeLevelRefresh(),
|
|
4440
|
+
resetOrder: () => this.resetDragOrder(),
|
|
4441
|
+
saveOrder: () => this.saveGradeLevelOrder()
|
|
4442
|
+
};
|
|
4443
|
+
// Computed properties
|
|
4444
|
+
filteredItems = computed(() => {
|
|
4445
|
+
const items = this.gradeLevels();
|
|
4446
|
+
const search = this.searchTerm()?.toLowerCase();
|
|
4447
|
+
if (!search)
|
|
4448
|
+
return items;
|
|
4449
|
+
return items.filter(item => {
|
|
4450
|
+
return item.sydsgl_name?.toLowerCase().includes(search) ||
|
|
4451
|
+
item.sydsgl_description?.toLowerCase().includes(search);
|
|
4452
|
+
});
|
|
4453
|
+
}, ...(ngDevMode ? [{ debugName: "filteredItems" }] : []));
|
|
4454
|
+
hasSelection = computed(() => this.selectedItems().length > 0, ...(ngDevMode ? [{ debugName: "hasSelection" }] : []));
|
|
4455
|
+
// Pagination computed properties
|
|
4456
|
+
totalPages = computed(() => Math.ceil(this.totalItems() / this.pageSize()), ...(ngDevMode ? [{ debugName: "totalPages" }] : []));
|
|
4457
|
+
hasNextPage = computed(() => this.currentPage() < this.totalPages(), ...(ngDevMode ? [{ debugName: "hasNextPage" }] : []));
|
|
4458
|
+
hasPreviousPage = computed(() => this.currentPage() > 1, ...(ngDevMode ? [{ debugName: "hasPreviousPage" }] : []));
|
|
4459
|
+
// Computed property for next order
|
|
4460
|
+
nextOrder = computed(() => this.calculateNextOrder(), ...(ngDevMode ? [{ debugName: "nextOrder" }] : []));
|
|
4143
4461
|
// Modern constructor with effects for initialization
|
|
4144
4462
|
constructor() {
|
|
4145
|
-
// Dependency injection
|
|
4146
|
-
this.destroyRef = inject(DestroyRef);
|
|
4147
|
-
this.gradeLevelService = inject(GradeLevelManagementService);
|
|
4148
|
-
this.appState = inject(AppStateHelperService);
|
|
4149
|
-
this.fb = inject(NonNullableFormBuilder);
|
|
4150
|
-
this.router = inject(Router);
|
|
4151
|
-
// Modern ViewChild signals for template renderers (Angular 20 approach)
|
|
4152
|
-
this.dragHandleRendererTemplate = viewChild.required('dragHandleRendererTemplate');
|
|
4153
|
-
this.gradeLevelDetailsRendererTemplate = viewChild.required('gradeLevelDetailsRendererTemplate');
|
|
4154
|
-
this.gradeLevelStatusRendererTemplate = viewChild.required('gradeLevelStatusRendererTemplate');
|
|
4155
|
-
this.actionsDropdownRendererTemplate = viewChild.required('actionsDropdownRendererTemplate');
|
|
4156
|
-
// Make Math available in template
|
|
4157
|
-
this.Math = Math;
|
|
4158
|
-
// Signals for reactive state management
|
|
4159
|
-
this.gradeLevels = signal([]);
|
|
4160
|
-
this.loading = signal(false);
|
|
4161
|
-
this.error = signal(null);
|
|
4162
|
-
this.selectedItems = signal([]);
|
|
4163
|
-
this.searchTerm = signal('');
|
|
4164
|
-
// Retrieved grade level data
|
|
4165
|
-
this.retrievedGradeLevel = signal(null);
|
|
4166
|
-
// Edit mode flag
|
|
4167
|
-
this.isEditMode = signal(false);
|
|
4168
|
-
// Drag order management
|
|
4169
|
-
this.originalOrder = signal([]);
|
|
4170
|
-
this.hasOrderChanged = signal(false);
|
|
4171
|
-
// Server-side pagination state
|
|
4172
|
-
this.currentPage = signal(1);
|
|
4173
|
-
this.pageSize = signal(10);
|
|
4174
|
-
this.totalItems = signal(0);
|
|
4175
|
-
// Modern reactive form with typed controls
|
|
4176
|
-
this.quickAddForm = this.fb.group({
|
|
4177
|
-
sydsgl_name: this.fb.control('', [Validators.required, Validators.minLength(1), Validators.maxLength(20)]),
|
|
4178
|
-
sydsgl_description: this.fb.control('', [Validators.maxLength(400)]),
|
|
4179
|
-
sydsgl_order: this.fb.control(1, [Validators.required, Validators.min(1), Validators.max(100)]),
|
|
4180
|
-
sydsgl_isactive: this.fb.control(true, [Validators.required]),
|
|
4181
|
-
sydsgl_entity_id_syen: this.fb.control(this.appState.getActiveEntityId() || '', [Validators.required])
|
|
4182
|
-
});
|
|
4183
|
-
// Grid configuration signal
|
|
4184
|
-
this.gridConfig = signal({
|
|
4185
|
-
id: 'grade-level-list-grid',
|
|
4186
|
-
title: '',
|
|
4187
|
-
subtitle: '',
|
|
4188
|
-
columns: [
|
|
4189
|
-
{
|
|
4190
|
-
key: 'dragHandle',
|
|
4191
|
-
header: '',
|
|
4192
|
-
type: 'custom',
|
|
4193
|
-
width: '40px',
|
|
4194
|
-
truncate: false,
|
|
4195
|
-
align: 'center',
|
|
4196
|
-
renderer: 'dragHandleRenderer'
|
|
4197
|
-
},
|
|
4198
|
-
{
|
|
4199
|
-
key: 'details',
|
|
4200
|
-
header: 'Grade Level',
|
|
4201
|
-
type: 'custom',
|
|
4202
|
-
width: 'auto',
|
|
4203
|
-
truncate: true,
|
|
4204
|
-
align: 'left',
|
|
4205
|
-
renderer: 'gradeLevelDetailsRenderer'
|
|
4206
|
-
},
|
|
4207
|
-
{
|
|
4208
|
-
key: 'sydsgl_isactive',
|
|
4209
|
-
header: 'Status',
|
|
4210
|
-
type: 'custom',
|
|
4211
|
-
width: '100px',
|
|
4212
|
-
truncate: false,
|
|
4213
|
-
align: 'center',
|
|
4214
|
-
renderer: 'gradeLevelStatusRenderer'
|
|
4215
|
-
},
|
|
4216
|
-
{
|
|
4217
|
-
key: 'actions',
|
|
4218
|
-
header: '',
|
|
4219
|
-
type: 'custom',
|
|
4220
|
-
width: '60px',
|
|
4221
|
-
truncate: false,
|
|
4222
|
-
align: 'center',
|
|
4223
|
-
renderer: 'actionsDropdownRenderer'
|
|
4224
|
-
}
|
|
4225
|
-
],
|
|
4226
|
-
data: [],
|
|
4227
|
-
trackBy: '_id',
|
|
4228
|
-
dragDrop: {
|
|
4229
|
-
enabled: true,
|
|
4230
|
-
orderField: 'sydsgl_order',
|
|
4231
|
-
dragClass: 'tw-opacity-50 tw-bg-blue-50',
|
|
4232
|
-
dropClass: 'tw-bg-green-50'
|
|
4233
|
-
},
|
|
4234
|
-
pagination: {
|
|
4235
|
-
enabled: true,
|
|
4236
|
-
pageSize: 10,
|
|
4237
|
-
pageSizeOptions: [10, 25, 50, 100],
|
|
4238
|
-
showQuickJump: true,
|
|
4239
|
-
showPageInfo: true,
|
|
4240
|
-
showRefresh: true
|
|
4241
|
-
},
|
|
4242
|
-
search: {
|
|
4243
|
-
enabled: true,
|
|
4244
|
-
placeholder: 'Search grade levels...',
|
|
4245
|
-
searchableColumns: ['sydsgl_name', 'sydsgl_description'],
|
|
4246
|
-
debounceMs: 300
|
|
4247
|
-
},
|
|
4248
|
-
loading: {
|
|
4249
|
-
useDefer: true,
|
|
4250
|
-
skeletonRows: 5,
|
|
4251
|
-
showOverlay: false
|
|
4252
|
-
},
|
|
4253
|
-
scroll: {
|
|
4254
|
-
enabled: true,
|
|
4255
|
-
maxHeight: '',
|
|
4256
|
-
minHeight: '',
|
|
4257
|
-
stickyHeader: true,
|
|
4258
|
-
virtualScroll: false,
|
|
4259
|
-
rowHeight: 50
|
|
4260
|
-
},
|
|
4261
|
-
responsive: true,
|
|
4262
|
-
striped: false,
|
|
4263
|
-
bordered: true,
|
|
4264
|
-
compact: false,
|
|
4265
|
-
tableClass: 'tw-table-fixed tw-w-full tw-rounded-none',
|
|
4266
|
-
onRefresh: 'onGradeLevelRefresh'
|
|
4267
|
-
});
|
|
4268
|
-
// Template renderers using Angular best practices
|
|
4269
|
-
this.templateRenderers = computed(() => ({
|
|
4270
|
-
dragHandleRenderer: this.dragHandleRendererTemplate(),
|
|
4271
|
-
gradeLevelDetailsRenderer: this.gradeLevelDetailsRendererTemplate(),
|
|
4272
|
-
gradeLevelStatusRenderer: this.gradeLevelStatusRendererTemplate(),
|
|
4273
|
-
actionsDropdownRenderer: this.actionsDropdownRendererTemplate()
|
|
4274
|
-
}));
|
|
4275
|
-
// Mixed renderers (templates + string functions)
|
|
4276
|
-
this.customRenderers = computed(() => ({
|
|
4277
|
-
...this.templateRenderers()
|
|
4278
|
-
}));
|
|
4279
|
-
// Action handlers for grid actions
|
|
4280
|
-
this.actionHandlers = {
|
|
4281
|
-
onEditGradeLevel: (row) => this.editGradeLevel(row._id || ''),
|
|
4282
|
-
onToggleGradeLevel: (row) => this.toggleGradeLevelStatus(row._id || ''),
|
|
4283
|
-
onDeleteGradeLevel: (row) => this.deleteGradeLevel(row._id || ''),
|
|
4284
|
-
onGradeLevelRowClick: (row) => this.onGradeLevelRowClick(row),
|
|
4285
|
-
onGradeLevelRefresh: () => this.onGradeLevelRefresh(),
|
|
4286
|
-
resetOrder: () => this.resetDragOrder(),
|
|
4287
|
-
saveOrder: () => this.saveGradeLevelOrder()
|
|
4288
|
-
};
|
|
4289
|
-
// Computed properties
|
|
4290
|
-
this.filteredItems = computed(() => {
|
|
4291
|
-
const items = this.gradeLevels();
|
|
4292
|
-
const search = this.searchTerm()?.toLowerCase();
|
|
4293
|
-
if (!search)
|
|
4294
|
-
return items;
|
|
4295
|
-
return items.filter(item => {
|
|
4296
|
-
return item.sydsgl_name?.toLowerCase().includes(search) ||
|
|
4297
|
-
item.sydsgl_description?.toLowerCase().includes(search);
|
|
4298
|
-
});
|
|
4299
|
-
});
|
|
4300
|
-
this.hasSelection = computed(() => this.selectedItems().length > 0);
|
|
4301
|
-
// Pagination computed properties
|
|
4302
|
-
this.totalPages = computed(() => Math.ceil(this.totalItems() / this.pageSize()));
|
|
4303
|
-
this.hasNextPage = computed(() => this.currentPage() < this.totalPages());
|
|
4304
|
-
this.hasPreviousPage = computed(() => this.currentPage() > 1);
|
|
4305
|
-
// Computed property for next order
|
|
4306
|
-
this.nextOrder = computed(() => this.calculateNextOrder());
|
|
4307
4463
|
this.initializeComponent();
|
|
4308
4464
|
this.destroyRef.onDestroy(() => {
|
|
4309
4465
|
this.cleanupEventListeners();
|
|
@@ -4891,10 +5047,10 @@ class GradeLevelListComponent {
|
|
|
4891
5047
|
trackByItemId(index, item) {
|
|
4892
5048
|
return item._id || '';
|
|
4893
5049
|
}
|
|
4894
|
-
static
|
|
4895
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: GradeLevelListComponent, isStandalone: true, selector: "cide-core-app-grade-level-list", viewQueries: [{ propertyName: "dragHandleRendererTemplate", first: true, predicate: ["dragHandleRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "gradeLevelDetailsRendererTemplate", first: true, predicate: ["gradeLevelDetailsRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "gradeLevelStatusRendererTemplate", first: true, predicate: ["gradeLevelStatusRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "actionsDropdownRendererTemplate", first: true, predicate: ["actionsDropdownRendererTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Grade Level List 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-6 tw-py-4 tw-border-b tw-border-gray-200 tw-bg-white\">\n <div class=\"tw-flex tw-items-center tw-justify-between tw-mb-3\">\n <div class=\"tw-flex tw-items-center tw-space-x-3\">\n <cide-ele-icon class=\"tw-text-blue-600 tw-w-5 tw-h-5\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n <h6 class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-m-0\">{{ isEditMode() ? 'Edit Grade Level' : 'Quick Add Grade Level' }}</h6>\n </div>\n </div>\n \n <form [formGroup]=\"quickAddForm\" (ngSubmit)=\"quickAddGradeLevel()\">\n <!-- First Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-4 tw-gap-3 tw-mb-3\">\n <!-- Grade Level Name -->\n <div>\n <cide-ele-input \n id=\"sydsgl_name\" \n label=\"Name*\" \n formControlName=\"sydsgl_name\"\n placeholder=\"Grade level name\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Active Status -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <cide-ele-input \n id=\"sydsgl_isactive\"\n type=\"checkbox\"\n label=\"Active\"\n formControlName=\"sydsgl_isactive\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n </div>\n \n <!-- Second Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-4 tw-gap-3 tw-items-end\">\n <!-- Description -->\n <div>\n <cide-ele-textarea \n id=\"sydsgl_description\" \n label=\"Description\" \n formControlName=\"sydsgl_description\"\n placeholder=\"Grade level description\"\n rows=\"2\"\n size=\"sm\">\n </cide-ele-textarea>\n </div>\n \n <!-- Entity ID (Hidden) -->\n <div class=\"tw-hidden\">\n <cide-ele-input \n id=\"sydsgl_entity_id_syen\" \n label=\"Entity ID*\" \n formControlName=\"sydsgl_entity_id_syen\"\n placeholder=\"Entity ID\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Action Buttons -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <div class=\"tw-flex tw-space-x-2\">\n <button \n cideEleButton \n variant=\"primary\" \n size=\"sm\" \n type=\"submit\"\n [disabled]=\"quickAddForm.invalid\"\n class=\"tw-px-2 tw-py-1 tw-w-20\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n {{ isEditMode() ? 'Update' : 'Add' }}\n </button>\n <button \n cideEleButton \n variant=\"outline\" \n size=\"sm\" \n type=\"button\"\n (click)=\"resetQuickAddForm()\"\n class=\"tw-px-2 tw-py-1 tw-w-16\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">refresh</cide-ele-icon>\n Reset\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-6 tw-py-3 tw-border-b tw-border-gray-200 tw-bg-gray-50\">\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-justify-between tw-items-start sm:tw-items-center tw-space-y-3 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-5 tw-h-5\">school</cide-ele-icon>\n <h5 class=\"tw-text-base tw-font-medium tw-text-gray-900 tw-m-0\">Grade Level Management</h5>\n </div>\n\n <!-- Actions -->\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-items-start sm:tw-items-center tw-space-y-3 sm:tw-space-y-0 sm:tw-space-x-3\">\n <!-- Search functionality is handled by the data grid -->\n </div>\n </div>\n\n <!-- Error Message -->\n @if (error()) {\n <div class=\"tw-mt-4 tw-p-4 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-5 tw-h-5 tw-mt-0.5 tw-flex-shrink-0\"></cide-ele-icon>\n <div class=\"tw-ml-3\">\n <h3 class=\"tw-text-sm tw-font-medium tw-text-red-800 tw-m-0\">Error</h3>\n <p class=\"tw-text-sm 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 \n <cide-ele-data-grid \n [config]=\"gridConfig()\" \n [templateRenderers]=\"getTemplateRenderers()\"\n [actionHandlers]=\"actionHandlers\"\n [serverSidePagination]=\"true\" \n [totalServerItems]=\"totalItems()\" \n [currentServerPage]=\"currentPage()\"\n [currentServerPageSize]=\"pageSize()\" \n [dragDropEnabled]=\"true\"\n (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n </div>\n\n </div>\n </div>\n\n</div>\n\n<!-- Drag Handle Renderer Template -->\n<ng-template #dragHandleRendererTemplate let-row=\"row\" let-value=\"value\">\n <div class=\"tw-flex tw-items-center tw-justify-center tw-w-full tw-h-full tw-cursor-move drag-handle\">\n <cide-ele-icon \n class=\"tw-text-gray-400 hover:tw-text-gray-600 tw-transition-colors\" \n size=\"xs\">\n drag_indicator\n </cide-ele-icon>\n </div>\n</ng-template>\n\n<!-- Grade Level Details Renderer Template -->\n<ng-template #gradeLevelDetailsRendererTemplate let-row=\"row\" let-value=\"value\">\n <div class=\"tw-flex tw-items-center tw-min-w-0\">\n <!-- Grade Level Icon -->\n <div class=\"tw-flex-shrink-0\">\n <cide-ele-icon \n class=\"tw-text-gray-400\" \n size=\"xs\">\n school\n </cide-ele-icon>\n </div>\n \n <!-- Grade Level Details -->\n <div class=\"tw-ml-3 tw-min-w-0 tw-flex-1\">\n <div class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\" \n [title]=\"row.sydsgl_name\">\n {{ row.sydsgl_name || 'Untitled' }}\n </div>\n @if (row.sydsgl_description) {\n <div class=\"tw-text-xs tw-text-gray-500 tw-truncate\" \n [title]=\"row.sydsgl_description\">\n {{ row.sydsgl_description }}\n </div>\n }\n </div>\n </div>\n</ng-template>\n\n<!-- Grade Level Status Renderer Template -->\n<ng-template #gradeLevelStatusRendererTemplate let-row=\"row\" let-value=\"value\">\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 tw-whitespace-nowrap\"\n [ngClass]=\"getStatusClass(row.sydsgl_isactive)\">\n {{ getStatusDisplay(row.sydsgl_isactive) }}\n </span>\n</ng-template>\n\n<!-- Actions Dropdown Renderer Template -->\n<ng-template #actionsDropdownRendererTemplate let-row=\"row\" let-value=\"value\">\n <cide-ele-dropdown \n [items]=\"getDropdownItems(row)\"\n [config]=\"{ triggerIcon: 'more_vert', triggerSize: 'sm' }\"\n (itemClick)=\"onDropdownItemClick($event, row)\">\n </cide-ele-dropdown>\n</ng-template> ", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: CideEleDataGridComponent, selector: "cide-ele-data-grid", inputs: ["config", "customRenderers", "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"] }] }); }
|
|
5050
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: GradeLevelListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5051
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: GradeLevelListComponent, isStandalone: true, selector: "cide-core-app-grade-level-list", viewQueries: [{ propertyName: "dragHandleRendererTemplate", first: true, predicate: ["dragHandleRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "gradeLevelDetailsRendererTemplate", first: true, predicate: ["gradeLevelDetailsRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "gradeLevelStatusRendererTemplate", first: true, predicate: ["gradeLevelStatusRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "actionsDropdownRendererTemplate", first: true, predicate: ["actionsDropdownRendererTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Grade Level List 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-6 tw-py-4 tw-border-b tw-border-gray-200 tw-bg-white\">\n <div class=\"tw-flex tw-items-center tw-justify-between tw-mb-3\">\n <div class=\"tw-flex tw-items-center tw-space-x-3\">\n <cide-ele-icon class=\"tw-text-blue-600 tw-w-5 tw-h-5\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n <h6 class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-m-0\">{{ isEditMode() ? 'Edit Grade Level' : 'Quick Add Grade Level' }}</h6>\n </div>\n </div>\n \n <form [formGroup]=\"quickAddForm\" (ngSubmit)=\"quickAddGradeLevel()\">\n <!-- First Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-4 tw-gap-3 tw-mb-3\">\n <!-- Grade Level Name -->\n <div>\n <cide-ele-input \n id=\"sydsgl_name\" \n label=\"Name*\" \n formControlName=\"sydsgl_name\"\n placeholder=\"Grade level name\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Active Status -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <cide-ele-input \n id=\"sydsgl_isactive\"\n type=\"checkbox\"\n label=\"Active\"\n formControlName=\"sydsgl_isactive\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n </div>\n \n <!-- Second Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-4 tw-gap-3 tw-items-end\">\n <!-- Description -->\n <div>\n <cide-ele-textarea \n id=\"sydsgl_description\" \n label=\"Description\" \n formControlName=\"sydsgl_description\"\n placeholder=\"Grade level description\"\n rows=\"2\"\n size=\"sm\">\n </cide-ele-textarea>\n </div>\n \n <!-- Entity ID (Hidden) -->\n <div class=\"tw-hidden\">\n <cide-ele-input \n id=\"sydsgl_entity_id_syen\" \n label=\"Entity ID*\" \n formControlName=\"sydsgl_entity_id_syen\"\n placeholder=\"Entity ID\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Action Buttons -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <div class=\"tw-flex tw-space-x-2\">\n <button \n cideEleButton \n variant=\"primary\" \n size=\"sm\" \n type=\"submit\"\n [disabled]=\"quickAddForm.invalid\"\n class=\"tw-px-2 tw-py-1 tw-w-20\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n {{ isEditMode() ? 'Update' : 'Add' }}\n </button>\n <button \n cideEleButton \n variant=\"outline\" \n size=\"sm\" \n type=\"button\"\n (click)=\"resetQuickAddForm()\"\n class=\"tw-px-2 tw-py-1 tw-w-16\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">refresh</cide-ele-icon>\n Reset\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-6 tw-py-3 tw-border-b tw-border-gray-200 tw-bg-gray-50\">\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-justify-between tw-items-start sm:tw-items-center tw-space-y-3 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-5 tw-h-5\">school</cide-ele-icon>\n <h5 class=\"tw-text-base tw-font-medium tw-text-gray-900 tw-m-0\">Grade Level Management</h5>\n </div>\n\n <!-- Actions -->\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-items-start sm:tw-items-center tw-space-y-3 sm:tw-space-y-0 sm:tw-space-x-3\">\n <!-- Search functionality is handled by the data grid -->\n </div>\n </div>\n\n <!-- Error Message -->\n @if (error()) {\n <div class=\"tw-mt-4 tw-p-4 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-5 tw-h-5 tw-mt-0.5 tw-flex-shrink-0\"></cide-ele-icon>\n <div class=\"tw-ml-3\">\n <h3 class=\"tw-text-sm tw-font-medium tw-text-red-800 tw-m-0\">Error</h3>\n <p class=\"tw-text-sm 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 \n <cide-ele-data-grid \n [config]=\"gridConfig()\" \n [templateRenderers]=\"getTemplateRenderers()\"\n [actionHandlers]=\"actionHandlers\"\n [serverSidePagination]=\"true\" \n [totalServerItems]=\"totalItems()\" \n [currentServerPage]=\"currentPage()\"\n [currentServerPageSize]=\"pageSize()\" \n [dragDropEnabled]=\"true\"\n (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n </div>\n\n </div>\n </div>\n\n</div>\n\n<!-- Drag Handle Renderer Template -->\n<ng-template #dragHandleRendererTemplate let-row=\"row\" let-value=\"value\">\n <div class=\"tw-flex tw-items-center tw-justify-center tw-w-full tw-h-full tw-cursor-move drag-handle\">\n <cide-ele-icon \n class=\"tw-text-gray-400 hover:tw-text-gray-600 tw-transition-colors\" \n size=\"xs\">\n drag_indicator\n </cide-ele-icon>\n </div>\n</ng-template>\n\n<!-- Grade Level Details Renderer Template -->\n<ng-template #gradeLevelDetailsRendererTemplate let-row=\"row\" let-value=\"value\">\n <div class=\"tw-flex tw-items-center tw-min-w-0\">\n <!-- Grade Level Icon -->\n <div class=\"tw-flex-shrink-0\">\n <cide-ele-icon \n class=\"tw-text-gray-400\" \n size=\"xs\">\n school\n </cide-ele-icon>\n </div>\n \n <!-- Grade Level Details -->\n <div class=\"tw-ml-3 tw-min-w-0 tw-flex-1\">\n <div class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\" \n [title]=\"row.sydsgl_name\">\n {{ row.sydsgl_name || 'Untitled' }}\n </div>\n @if (row.sydsgl_description) {\n <div class=\"tw-text-xs tw-text-gray-500 tw-truncate\" \n [title]=\"row.sydsgl_description\">\n {{ row.sydsgl_description }}\n </div>\n }\n </div>\n </div>\n</ng-template>\n\n<!-- Grade Level Status Renderer Template -->\n<ng-template #gradeLevelStatusRendererTemplate let-row=\"row\" let-value=\"value\">\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 tw-whitespace-nowrap\"\n [ngClass]=\"getStatusClass(row.sydsgl_isactive)\">\n {{ getStatusDisplay(row.sydsgl_isactive) }}\n </span>\n</ng-template>\n\n<!-- Actions Dropdown Renderer Template -->\n<ng-template #actionsDropdownRendererTemplate let-row=\"row\" let-value=\"value\">\n <cide-ele-dropdown \n [items]=\"getDropdownItems(row)\"\n [config]=\"{ triggerIcon: 'more_vert', triggerSize: 'sm' }\"\n (itemClick)=\"onDropdownItemClick($event, row)\">\n </cide-ele-dropdown>\n</ng-template> ", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: CideEleDataGridComponent, selector: "cide-ele-data-grid", inputs: ["config", "customRenderers", "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"] }] });
|
|
4896
5052
|
}
|
|
4897
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
5053
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: GradeLevelListComponent, decorators: [{
|
|
4898
5054
|
type: Component,
|
|
4899
5055
|
args: [{ selector: 'cide-core-app-grade-level-list', standalone: true, imports: [
|
|
4900
5056
|
CommonModule,
|
|
@@ -4910,9 +5066,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
4910
5066
|
], template: "<!-- Grade Level List 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-6 tw-py-4 tw-border-b tw-border-gray-200 tw-bg-white\">\n <div class=\"tw-flex tw-items-center tw-justify-between tw-mb-3\">\n <div class=\"tw-flex tw-items-center tw-space-x-3\">\n <cide-ele-icon class=\"tw-text-blue-600 tw-w-5 tw-h-5\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n <h6 class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-m-0\">{{ isEditMode() ? 'Edit Grade Level' : 'Quick Add Grade Level' }}</h6>\n </div>\n </div>\n \n <form [formGroup]=\"quickAddForm\" (ngSubmit)=\"quickAddGradeLevel()\">\n <!-- First Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-4 tw-gap-3 tw-mb-3\">\n <!-- Grade Level Name -->\n <div>\n <cide-ele-input \n id=\"sydsgl_name\" \n label=\"Name*\" \n formControlName=\"sydsgl_name\"\n placeholder=\"Grade level name\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Active Status -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <cide-ele-input \n id=\"sydsgl_isactive\"\n type=\"checkbox\"\n label=\"Active\"\n formControlName=\"sydsgl_isactive\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n </div>\n \n <!-- Second Row -->\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-4 tw-gap-3 tw-items-end\">\n <!-- Description -->\n <div>\n <cide-ele-textarea \n id=\"sydsgl_description\" \n label=\"Description\" \n formControlName=\"sydsgl_description\"\n placeholder=\"Grade level description\"\n rows=\"2\"\n size=\"sm\">\n </cide-ele-textarea>\n </div>\n \n <!-- Entity ID (Hidden) -->\n <div class=\"tw-hidden\">\n <cide-ele-input \n id=\"sydsgl_entity_id_syen\" \n label=\"Entity ID*\" \n formControlName=\"sydsgl_entity_id_syen\"\n placeholder=\"Entity ID\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n \n <!-- Action Buttons -->\n <div class=\"tw-flex tw-flex-col tw-justify-end\">\n <div class=\"tw-flex tw-space-x-2\">\n <button \n cideEleButton \n variant=\"primary\" \n size=\"sm\" \n type=\"submit\"\n [disabled]=\"quickAddForm.invalid\"\n class=\"tw-px-2 tw-py-1 tw-w-20\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n {{ isEditMode() ? 'Update' : 'Add' }}\n </button>\n <button \n cideEleButton \n variant=\"outline\" \n size=\"sm\" \n type=\"button\"\n (click)=\"resetQuickAddForm()\"\n class=\"tw-px-2 tw-py-1 tw-w-16\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-4 tw-h-4 tw-mr-1\">refresh</cide-ele-icon>\n Reset\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-6 tw-py-3 tw-border-b tw-border-gray-200 tw-bg-gray-50\">\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-justify-between tw-items-start sm:tw-items-center tw-space-y-3 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-5 tw-h-5\">school</cide-ele-icon>\n <h5 class=\"tw-text-base tw-font-medium tw-text-gray-900 tw-m-0\">Grade Level Management</h5>\n </div>\n\n <!-- Actions -->\n <div\n class=\"tw-flex tw-flex-col sm:tw-flex-row tw-items-start sm:tw-items-center tw-space-y-3 sm:tw-space-y-0 sm:tw-space-x-3\">\n <!-- Search functionality is handled by the data grid -->\n </div>\n </div>\n\n <!-- Error Message -->\n @if (error()) {\n <div class=\"tw-mt-4 tw-p-4 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-5 tw-h-5 tw-mt-0.5 tw-flex-shrink-0\"></cide-ele-icon>\n <div class=\"tw-ml-3\">\n <h3 class=\"tw-text-sm tw-font-medium tw-text-red-800 tw-m-0\">Error</h3>\n <p class=\"tw-text-sm 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 \n <cide-ele-data-grid \n [config]=\"gridConfig()\" \n [templateRenderers]=\"getTemplateRenderers()\"\n [actionHandlers]=\"actionHandlers\"\n [serverSidePagination]=\"true\" \n [totalServerItems]=\"totalItems()\" \n [currentServerPage]=\"currentPage()\"\n [currentServerPageSize]=\"pageSize()\" \n [dragDropEnabled]=\"true\"\n (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n </div>\n\n </div>\n </div>\n\n</div>\n\n<!-- Drag Handle Renderer Template -->\n<ng-template #dragHandleRendererTemplate let-row=\"row\" let-value=\"value\">\n <div class=\"tw-flex tw-items-center tw-justify-center tw-w-full tw-h-full tw-cursor-move drag-handle\">\n <cide-ele-icon \n class=\"tw-text-gray-400 hover:tw-text-gray-600 tw-transition-colors\" \n size=\"xs\">\n drag_indicator\n </cide-ele-icon>\n </div>\n</ng-template>\n\n<!-- Grade Level Details Renderer Template -->\n<ng-template #gradeLevelDetailsRendererTemplate let-row=\"row\" let-value=\"value\">\n <div class=\"tw-flex tw-items-center tw-min-w-0\">\n <!-- Grade Level Icon -->\n <div class=\"tw-flex-shrink-0\">\n <cide-ele-icon \n class=\"tw-text-gray-400\" \n size=\"xs\">\n school\n </cide-ele-icon>\n </div>\n \n <!-- Grade Level Details -->\n <div class=\"tw-ml-3 tw-min-w-0 tw-flex-1\">\n <div class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\" \n [title]=\"row.sydsgl_name\">\n {{ row.sydsgl_name || 'Untitled' }}\n </div>\n @if (row.sydsgl_description) {\n <div class=\"tw-text-xs tw-text-gray-500 tw-truncate\" \n [title]=\"row.sydsgl_description\">\n {{ row.sydsgl_description }}\n </div>\n }\n </div>\n </div>\n</ng-template>\n\n<!-- Grade Level Status Renderer Template -->\n<ng-template #gradeLevelStatusRendererTemplate let-row=\"row\" let-value=\"value\">\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 tw-whitespace-nowrap\"\n [ngClass]=\"getStatusClass(row.sydsgl_isactive)\">\n {{ getStatusDisplay(row.sydsgl_isactive) }}\n </span>\n</ng-template>\n\n<!-- Actions Dropdown Renderer Template -->\n<ng-template #actionsDropdownRendererTemplate let-row=\"row\" let-value=\"value\">\n <cide-ele-dropdown \n [items]=\"getDropdownItems(row)\"\n [config]=\"{ triggerIcon: 'more_vert', triggerSize: 'sm' }\"\n (itemClick)=\"onDropdownItemClick($event, row)\">\n </cide-ele-dropdown>\n</ng-template> " }]
|
|
4911
5067
|
}], ctorParameters: () => [] });
|
|
4912
5068
|
|
|
5069
|
+
var gradeLevelList_component = /*#__PURE__*/Object.freeze({
|
|
5070
|
+
__proto__: null,
|
|
5071
|
+
GradeLevelListComponent: GradeLevelListComponent
|
|
5072
|
+
});
|
|
5073
|
+
|
|
4913
5074
|
// Grade Level Management Components
|
|
4914
5075
|
|
|
4915
5076
|
class PageManagementService {
|
|
5077
|
+
http;
|
|
4916
5078
|
constructor(http) {
|
|
4917
5079
|
this.http = http;
|
|
4918
5080
|
}
|
|
@@ -4994,10 +5156,10 @@ class PageManagementService {
|
|
|
4994
5156
|
console.error('Page Management Service Error:', errorMessage);
|
|
4995
5157
|
return throwError(() => new Error(errorMessage));
|
|
4996
5158
|
}
|
|
4997
|
-
static
|
|
4998
|
-
static
|
|
5159
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PageManagementService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5160
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PageManagementService, providedIn: 'root' });
|
|
4999
5161
|
}
|
|
5000
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
5162
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PageManagementService, decorators: [{
|
|
5001
5163
|
type: Injectable,
|
|
5002
5164
|
args: [{
|
|
5003
5165
|
providedIn: 'root'
|
|
@@ -5005,110 +5167,110 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
5005
5167
|
}], ctorParameters: () => [{ type: i1.HttpClient }] });
|
|
5006
5168
|
|
|
5007
5169
|
class PageListComponent {
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
renderer: 'pageDetailsRenderer'
|
|
5042
|
-
},
|
|
5043
|
-
{
|
|
5044
|
-
key: 'sypg_page_code',
|
|
5045
|
-
header: 'Page Code',
|
|
5046
|
-
type: 'text',
|
|
5047
|
-
width: '150px',
|
|
5048
|
-
truncate: true,
|
|
5049
|
-
align: 'left'
|
|
5050
|
-
},
|
|
5051
|
-
{
|
|
5052
|
-
key: 'sypg_isactive',
|
|
5053
|
-
header: 'Status',
|
|
5054
|
-
type: 'custom',
|
|
5055
|
-
width: '100px',
|
|
5056
|
-
truncate: false,
|
|
5057
|
-
align: 'center',
|
|
5058
|
-
renderer: 'pageStatusRenderer'
|
|
5059
|
-
},
|
|
5060
|
-
{
|
|
5061
|
-
key: 'actions',
|
|
5062
|
-
header: '',
|
|
5063
|
-
type: 'custom',
|
|
5064
|
-
width: '120px',
|
|
5065
|
-
truncate: false,
|
|
5066
|
-
align: 'center',
|
|
5067
|
-
renderer: 'actionsDropdownRenderer'
|
|
5068
|
-
}
|
|
5069
|
-
],
|
|
5070
|
-
data: [],
|
|
5071
|
-
trackBy: '_id',
|
|
5072
|
-
pagination: {
|
|
5073
|
-
enabled: true,
|
|
5074
|
-
pageSize: 10,
|
|
5075
|
-
pageSizeOptions: [10, 25, 50, 100],
|
|
5076
|
-
showQuickJump: true,
|
|
5077
|
-
showPageInfo: true,
|
|
5078
|
-
showRefresh: true
|
|
5079
|
-
},
|
|
5080
|
-
search: {
|
|
5081
|
-
enabled: true,
|
|
5082
|
-
placeholder: 'Search pages...',
|
|
5083
|
-
searchableColumns: ['sypg_title', 'sypg_desc', 'sypg_page_code'],
|
|
5084
|
-
debounceMs: 300
|
|
5170
|
+
// Dependency injection
|
|
5171
|
+
destroyRef = inject(DestroyRef);
|
|
5172
|
+
pageService = inject(PageManagementService);
|
|
5173
|
+
appState = inject(AppStateHelperService);
|
|
5174
|
+
router = inject(Router);
|
|
5175
|
+
// Modern ViewChild signals for template renderers (Angular 20 approach)
|
|
5176
|
+
pageDetailsRendererTemplate = viewChild.required('pageDetailsRendererTemplate');
|
|
5177
|
+
pageStatusRendererTemplate = viewChild.required('pageStatusRendererTemplate');
|
|
5178
|
+
actionsDropdownRendererTemplate = viewChild.required('actionsDropdownRendererTemplate');
|
|
5179
|
+
// Make Math available in template
|
|
5180
|
+
Math = Math;
|
|
5181
|
+
// Signals for reactive state management
|
|
5182
|
+
pages = signal([], ...(ngDevMode ? [{ debugName: "pages" }] : []));
|
|
5183
|
+
loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
5184
|
+
error = signal(null, ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
5185
|
+
selectedItems = signal([], ...(ngDevMode ? [{ debugName: "selectedItems" }] : []));
|
|
5186
|
+
searchTerm = signal('', ...(ngDevMode ? [{ debugName: "searchTerm" }] : []));
|
|
5187
|
+
// Pagination signals
|
|
5188
|
+
currentPage = signal(1, ...(ngDevMode ? [{ debugName: "currentPage" }] : []));
|
|
5189
|
+
pageSize = signal(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
|
|
5190
|
+
totalItems = signal(0, ...(ngDevMode ? [{ debugName: "totalItems" }] : []));
|
|
5191
|
+
// Grid configuration signal
|
|
5192
|
+
gridConfig = signal({
|
|
5193
|
+
id: 'page-list-grid',
|
|
5194
|
+
columns: [
|
|
5195
|
+
{
|
|
5196
|
+
key: 'details',
|
|
5197
|
+
header: 'Page Details',
|
|
5198
|
+
type: 'custom',
|
|
5199
|
+
width: 'auto',
|
|
5200
|
+
truncate: true,
|
|
5201
|
+
align: 'left',
|
|
5202
|
+
renderer: 'pageDetailsRenderer'
|
|
5085
5203
|
},
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5204
|
+
{
|
|
5205
|
+
key: 'sypg_page_code',
|
|
5206
|
+
header: 'Page Code',
|
|
5207
|
+
type: 'text',
|
|
5208
|
+
width: '150px',
|
|
5209
|
+
truncate: true,
|
|
5210
|
+
align: 'left'
|
|
5090
5211
|
},
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5212
|
+
{
|
|
5213
|
+
key: 'sypg_isactive',
|
|
5214
|
+
header: 'Status',
|
|
5215
|
+
type: 'custom',
|
|
5216
|
+
width: '100px',
|
|
5217
|
+
truncate: false,
|
|
5218
|
+
align: 'center',
|
|
5219
|
+
renderer: 'pageStatusRenderer'
|
|
5098
5220
|
},
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5221
|
+
{
|
|
5222
|
+
key: 'actions',
|
|
5223
|
+
header: '',
|
|
5224
|
+
type: 'custom',
|
|
5225
|
+
width: '120px',
|
|
5226
|
+
truncate: false,
|
|
5227
|
+
align: 'center',
|
|
5228
|
+
renderer: 'actionsDropdownRenderer'
|
|
5229
|
+
}
|
|
5230
|
+
],
|
|
5231
|
+
data: [],
|
|
5232
|
+
trackBy: '_id',
|
|
5233
|
+
pagination: {
|
|
5234
|
+
enabled: true,
|
|
5235
|
+
pageSize: 10,
|
|
5236
|
+
pageSizeOptions: [10, 25, 50, 100],
|
|
5237
|
+
showQuickJump: true,
|
|
5238
|
+
showPageInfo: true,
|
|
5239
|
+
showRefresh: true
|
|
5240
|
+
},
|
|
5241
|
+
search: {
|
|
5242
|
+
enabled: true,
|
|
5243
|
+
placeholder: 'Search pages...',
|
|
5244
|
+
searchableColumns: ['sypg_title', 'sypg_desc', 'sypg_page_code'],
|
|
5245
|
+
debounceMs: 300
|
|
5246
|
+
},
|
|
5247
|
+
loading: {
|
|
5248
|
+
useDefer: true,
|
|
5249
|
+
skeletonRows: 5,
|
|
5250
|
+
showOverlay: false
|
|
5251
|
+
},
|
|
5252
|
+
scroll: {
|
|
5253
|
+
enabled: true,
|
|
5254
|
+
maxHeight: '',
|
|
5255
|
+
minHeight: '',
|
|
5256
|
+
stickyHeader: true,
|
|
5257
|
+
virtualScroll: false,
|
|
5258
|
+
rowHeight: 50
|
|
5259
|
+
},
|
|
5260
|
+
responsive: true,
|
|
5261
|
+
striped: false,
|
|
5262
|
+
bordered: true,
|
|
5263
|
+
compact: false
|
|
5264
|
+
}, ...(ngDevMode ? [{ debugName: "gridConfig" }] : []));
|
|
5265
|
+
// Action handlers for grid
|
|
5266
|
+
actionHandlers = {
|
|
5267
|
+
onEdit: (item) => this.editPage(item),
|
|
5268
|
+
onDelete: (item) => this.deletePage(item),
|
|
5269
|
+
onToggleStatus: (item) => this.togglePageStatus(item),
|
|
5270
|
+
onManageThemes: (item) => this.manageThemes(item),
|
|
5271
|
+
onManageControls: (item) => this.manageControls(item)
|
|
5272
|
+
};
|
|
5273
|
+
constructor() {
|
|
5112
5274
|
this.initializeComponent();
|
|
5113
5275
|
}
|
|
5114
5276
|
/**
|
|
@@ -5373,10 +5535,10 @@ class PageListComponent {
|
|
|
5373
5535
|
const event = new MouseEvent('click', { bubbles: true });
|
|
5374
5536
|
document.dispatchEvent(event);
|
|
5375
5537
|
}
|
|
5376
|
-
static
|
|
5377
|
-
static
|
|
5538
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PageListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5539
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: PageListComponent, isStandalone: true, selector: "cide-core-app-page-list", viewQueries: [{ propertyName: "pageDetailsRendererTemplate", first: true, predicate: ["pageDetailsRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "pageStatusRendererTemplate", first: true, predicate: ["pageStatusRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "actionsDropdownRendererTemplate", first: true, predicate: ["actionsDropdownRendererTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Page List Container -->\n<div class=\"tw-table tw-w-full tw-h-full\">\n\n <!-- Header Section with Filters -->\n <div class=\"tw-table-row tw-h-0\">\n <div class=\"tw-table-cell tw-px-6 tw-py-3 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-3 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-5 tw-h-5\">web</cide-ele-icon>\n <h5 class=\"tw-text-base tw-font-medium tw-text-gray-900 tw-m-0\">Page 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-3 sm:tw-space-y-0 sm:tw-space-x-3\">\n <!-- Add Page Button -->\n <button\n cideEleButton\n variant=\"primary\"\n size=\"sm\"\n (click)=\"createPage()\"\n leftIcon=\"add\"\n class=\"tw-whitespace-nowrap tw-flex tw-items-center tw-gap-2\">\n Create New Page\n </button>\n </div>\n </div>\n\n <!-- Error Message -->\n @if (error()) {\n <div class=\"tw-mt-4 tw-p-4 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 class=\"tw-text-red-400 tw-w-5 tw-h-5 tw-mt-0.5 tw-flex-shrink-0\">error</cide-ele-icon>\n <div class=\"tw-ml-3\">\n <h3 class=\"tw-text-sm tw-font-medium tw-text-red-800 tw-m-0\">Error</h3>\n <p class=\"tw-text-sm 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]=\"getTemplateRenderers()\"\n [actionHandlers]=\"actionHandlers\"\n [serverSidePagination]=\"true\"\n [totalServerItems]=\"totalItems()\"\n [currentServerPage]=\"currentPage()\"\n [currentServerPageSize]=\"pageSize()\"\n (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n </div>\n\n </div>\n </div>\n\n</div>\n\n<!-- Page Details Renderer Template -->\n<ng-template #pageDetailsRendererTemplate let-row=\"row\" let-value=\"value\">\n <div class=\"tw-flex tw-items-center tw-min-w-0\">\n <!-- Page Icon -->\n <div class=\"tw-flex-shrink-0\">\n <cide-ele-icon class=\"tw-text-gray-400 tw-w-4 tw-h-4\">web</cide-ele-icon>\n </div>\n \n <!-- Page Details -->\n <div class=\"tw-ml-3 tw-min-w-0 tw-flex-1\">\n <div class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\" \n [title]=\"row.sypg_title\">\n {{ row.sypg_title || 'Untitled' }}\n </div>\n @if (row.sypg_desc) {\n <div class=\"tw-text-xs tw-text-gray-500 tw-truncate\" \n [title]=\"row.sypg_desc\">\n {{ row.sypg_desc }}\n </div>\n }\n </div>\n </div>\n</ng-template>\n\n<!-- Page Status Renderer Template -->\n<ng-template #pageStatusRendererTemplate let-row=\"row\" let-value=\"value\">\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 tw-whitespace-nowrap\"\n [ngClass]=\"row.sypg_isactive ? 'tw-bg-green-100 tw-text-green-800' : 'tw-bg-red-100 tw-text-red-800'\">\n {{ row.sypg_isactive ? 'Active' : 'Inactive' }}\n </span>\n</ng-template>\n\n<!-- Actions Dropdown Renderer Template -->\n<ng-template #actionsDropdownRendererTemplate let-row=\"row\" let-value=\"value\">\n <cide-ele-dropdown\n [items]=\"getActionDropdownItems(row)\"\n [config]=\"{ triggerIcon: 'more_vert', triggerSize: 'sm' }\"\n (itemClick)=\"onDropdownItemClick($event, row)\">\n </cide-ele-dropdown>\n</ng-template> ", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: CideEleDataGridComponent, selector: "cide-ele-data-grid", inputs: ["config", "customRenderers", "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: 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"] }] });
|
|
5378
5540
|
}
|
|
5379
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
5541
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PageListComponent, decorators: [{
|
|
5380
5542
|
type: Component,
|
|
5381
5543
|
args: [{ selector: 'cide-core-app-page-list', standalone: true, imports: [
|
|
5382
5544
|
CommonModule,
|
|
@@ -5387,10 +5549,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
5387
5549
|
], template: "<!-- Page List Container -->\n<div class=\"tw-table tw-w-full tw-h-full\">\n\n <!-- Header Section with Filters -->\n <div class=\"tw-table-row tw-h-0\">\n <div class=\"tw-table-cell tw-px-6 tw-py-3 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-3 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-5 tw-h-5\">web</cide-ele-icon>\n <h5 class=\"tw-text-base tw-font-medium tw-text-gray-900 tw-m-0\">Page 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-3 sm:tw-space-y-0 sm:tw-space-x-3\">\n <!-- Add Page Button -->\n <button\n cideEleButton\n variant=\"primary\"\n size=\"sm\"\n (click)=\"createPage()\"\n leftIcon=\"add\"\n class=\"tw-whitespace-nowrap tw-flex tw-items-center tw-gap-2\">\n Create New Page\n </button>\n </div>\n </div>\n\n <!-- Error Message -->\n @if (error()) {\n <div class=\"tw-mt-4 tw-p-4 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 class=\"tw-text-red-400 tw-w-5 tw-h-5 tw-mt-0.5 tw-flex-shrink-0\">error</cide-ele-icon>\n <div class=\"tw-ml-3\">\n <h3 class=\"tw-text-sm tw-font-medium tw-text-red-800 tw-m-0\">Error</h3>\n <p class=\"tw-text-sm 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]=\"getTemplateRenderers()\"\n [actionHandlers]=\"actionHandlers\"\n [serverSidePagination]=\"true\"\n [totalServerItems]=\"totalItems()\"\n [currentServerPage]=\"currentPage()\"\n [currentServerPageSize]=\"pageSize()\"\n (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n </div>\n\n </div>\n </div>\n\n</div>\n\n<!-- Page Details Renderer Template -->\n<ng-template #pageDetailsRendererTemplate let-row=\"row\" let-value=\"value\">\n <div class=\"tw-flex tw-items-center tw-min-w-0\">\n <!-- Page Icon -->\n <div class=\"tw-flex-shrink-0\">\n <cide-ele-icon class=\"tw-text-gray-400 tw-w-4 tw-h-4\">web</cide-ele-icon>\n </div>\n \n <!-- Page Details -->\n <div class=\"tw-ml-3 tw-min-w-0 tw-flex-1\">\n <div class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\" \n [title]=\"row.sypg_title\">\n {{ row.sypg_title || 'Untitled' }}\n </div>\n @if (row.sypg_desc) {\n <div class=\"tw-text-xs tw-text-gray-500 tw-truncate\" \n [title]=\"row.sypg_desc\">\n {{ row.sypg_desc }}\n </div>\n }\n </div>\n </div>\n</ng-template>\n\n<!-- Page Status Renderer Template -->\n<ng-template #pageStatusRendererTemplate let-row=\"row\" let-value=\"value\">\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 tw-whitespace-nowrap\"\n [ngClass]=\"row.sypg_isactive ? 'tw-bg-green-100 tw-text-green-800' : 'tw-bg-red-100 tw-text-red-800'\">\n {{ row.sypg_isactive ? 'Active' : 'Inactive' }}\n </span>\n</ng-template>\n\n<!-- Actions Dropdown Renderer Template -->\n<ng-template #actionsDropdownRendererTemplate let-row=\"row\" let-value=\"value\">\n <cide-ele-dropdown\n [items]=\"getActionDropdownItems(row)\"\n [config]=\"{ triggerIcon: 'more_vert', triggerSize: 'sm' }\"\n (itemClick)=\"onDropdownItemClick($event, row)\">\n </cide-ele-dropdown>\n</ng-template> " }]
|
|
5388
5550
|
}], ctorParameters: () => [] });
|
|
5389
5551
|
|
|
5552
|
+
var pageList_component = /*#__PURE__*/Object.freeze({
|
|
5553
|
+
__proto__: null,
|
|
5554
|
+
PageListComponent: PageListComponent
|
|
5555
|
+
});
|
|
5556
|
+
|
|
5390
5557
|
class PageThemeService {
|
|
5558
|
+
http;
|
|
5559
|
+
apiUrl = `${coreRoutesUrl?.pageTheme}`;
|
|
5391
5560
|
constructor(http) {
|
|
5392
5561
|
this.http = http;
|
|
5393
|
-
this.apiUrl = `${coreRoutesUrl?.pageTheme}`;
|
|
5394
5562
|
console.log('PageThemeService initialized - using real API');
|
|
5395
5563
|
}
|
|
5396
5564
|
/**
|
|
@@ -5478,10 +5646,10 @@ class PageThemeService {
|
|
|
5478
5646
|
console.error('Page Theme Service Error:', errorMessage);
|
|
5479
5647
|
return throwError(() => new Error(errorMessage));
|
|
5480
5648
|
}
|
|
5481
|
-
static
|
|
5482
|
-
static
|
|
5649
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PageThemeService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5650
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PageThemeService, providedIn: 'root' });
|
|
5483
5651
|
}
|
|
5484
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
5652
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PageThemeService, decorators: [{
|
|
5485
5653
|
type: Injectable,
|
|
5486
5654
|
args: [{
|
|
5487
5655
|
providedIn: 'root'
|
|
@@ -5489,171 +5657,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
5489
5657
|
}], ctorParameters: () => [{ type: i1.HttpClient }] });
|
|
5490
5658
|
|
|
5491
5659
|
class PageThemeComponent {
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
return title.includes(q) || code.includes(q) || desc.includes(q);
|
|
5523
|
-
});
|
|
5524
|
-
});
|
|
5525
|
-
// Page information
|
|
5526
|
-
this.pageId = signal('');
|
|
5527
|
-
this.pageTitle = signal('');
|
|
5528
|
-
// Form state
|
|
5529
|
-
this.isEditMode = signal(false);
|
|
5530
|
-
this.editingThemeId = signal(null);
|
|
5531
|
-
this.retrievedTheme = signal(null);
|
|
5532
|
-
// Pagination signals
|
|
5533
|
-
this.currentPage = signal(1);
|
|
5534
|
-
this.pageSize = signal(10);
|
|
5535
|
-
this.totalItems = signal(0);
|
|
5536
|
-
// Modern reactive forms with signals
|
|
5537
|
-
this.themeForm = this.fb.group({
|
|
5538
|
-
sytm_title: ['', [Validators.required]],
|
|
5539
|
-
sytm_desc: [''],
|
|
5540
|
-
sytm_theme_code: ['', [Validators.required]],
|
|
5541
|
-
sytm_preview_id_fm: [''],
|
|
5542
|
-
sytm_sub_title: [''],
|
|
5543
|
-
sytm_configuration: ['{}'],
|
|
5544
|
-
sytm_entity_id_syen: [''],
|
|
5545
|
-
sytm_isselected: [false],
|
|
5546
|
-
sytm_layout: this.fb.group({
|
|
5547
|
-
sytm_layout_sidebar: this.fb.group({ status: [true] }),
|
|
5548
|
-
sytm_layout_header: this.fb.group({ status: [true] }),
|
|
5549
|
-
sytm_layout_footer: this.fb.group({ status: [false] }),
|
|
5550
|
-
sytm_layout_breadcrumb: this.fb.group({ status: [true] }),
|
|
5551
|
-
sytm_layout_console: this.fb.group({ status: [false] }),
|
|
5552
|
-
sytm_layout_request: this.fb.group({ status: [false] }),
|
|
5553
|
-
sytm_layout_drawer: this.fb.array([])
|
|
5554
|
-
}),
|
|
5555
|
-
sytm_isactive: [true]
|
|
5556
|
-
});
|
|
5557
|
-
// Computed values
|
|
5558
|
-
this.isFormDirty = computed(() => this.themeForm.dirty);
|
|
5559
|
-
// Multi-select options for layout sections
|
|
5560
|
-
this.layoutOptions = [
|
|
5561
|
-
{ value: 'sidebar', label: 'Sidebar' },
|
|
5562
|
-
{ value: 'header', label: 'Header' },
|
|
5563
|
-
{ value: 'footer', label: 'Footer' },
|
|
5564
|
-
{ value: 'breadcrumb', label: 'Breadcrumb' },
|
|
5565
|
-
{ value: 'console', label: 'Console' },
|
|
5566
|
-
{ value: 'request', label: 'Request' }
|
|
5567
|
-
];
|
|
5568
|
-
// Grid configuration signal
|
|
5569
|
-
this.gridConfig = signal({
|
|
5570
|
-
id: 'theme-list-grid',
|
|
5571
|
-
title: '',
|
|
5572
|
-
subtitle: '',
|
|
5573
|
-
columns: [
|
|
5574
|
-
{
|
|
5575
|
-
key: 'details',
|
|
5576
|
-
header: 'Theme Details',
|
|
5577
|
-
type: 'custom',
|
|
5578
|
-
width: 'auto',
|
|
5579
|
-
truncate: true,
|
|
5580
|
-
align: 'left',
|
|
5581
|
-
renderer: 'themeDetailsRenderer'
|
|
5582
|
-
},
|
|
5583
|
-
{
|
|
5584
|
-
key: 'sytm_theme_code',
|
|
5585
|
-
header: 'Theme Code',
|
|
5586
|
-
type: 'text',
|
|
5587
|
-
width: '150px',
|
|
5588
|
-
truncate: true,
|
|
5589
|
-
align: 'left'
|
|
5590
|
-
},
|
|
5591
|
-
{
|
|
5592
|
-
key: 'sytm_isactive',
|
|
5593
|
-
header: 'Status',
|
|
5594
|
-
type: 'custom',
|
|
5595
|
-
width: '100px',
|
|
5596
|
-
truncate: false,
|
|
5597
|
-
align: 'center',
|
|
5598
|
-
renderer: 'themeStatusRenderer'
|
|
5599
|
-
},
|
|
5600
|
-
{
|
|
5601
|
-
key: 'actions',
|
|
5602
|
-
header: '',
|
|
5603
|
-
type: 'custom',
|
|
5604
|
-
width: '120px',
|
|
5605
|
-
truncate: false,
|
|
5606
|
-
align: 'center',
|
|
5607
|
-
renderer: 'actionsDropdownRenderer'
|
|
5608
|
-
}
|
|
5609
|
-
],
|
|
5610
|
-
data: [],
|
|
5611
|
-
trackBy: '_id',
|
|
5612
|
-
pagination: {
|
|
5613
|
-
enabled: true,
|
|
5614
|
-
pageSize: 10,
|
|
5615
|
-
pageSizeOptions: [10, 25, 50, 100],
|
|
5616
|
-
showQuickJump: true,
|
|
5617
|
-
showPageInfo: true,
|
|
5618
|
-
showRefresh: true
|
|
5619
|
-
},
|
|
5620
|
-
search: {
|
|
5621
|
-
enabled: true,
|
|
5622
|
-
placeholder: 'Search themes...',
|
|
5623
|
-
searchableColumns: ['sytm_title', 'sytm_desc', 'sytm_theme_code'],
|
|
5624
|
-
debounceMs: 300
|
|
5625
|
-
},
|
|
5626
|
-
loading: {
|
|
5627
|
-
useDefer: true,
|
|
5628
|
-
skeletonRows: 5,
|
|
5629
|
-
showOverlay: false
|
|
5630
|
-
},
|
|
5631
|
-
scroll: {
|
|
5632
|
-
enabled: true,
|
|
5633
|
-
maxHeight: '',
|
|
5634
|
-
minHeight: '',
|
|
5635
|
-
stickyHeader: true,
|
|
5636
|
-
virtualScroll: false,
|
|
5637
|
-
rowHeight: 50
|
|
5638
|
-
},
|
|
5639
|
-
responsive: true,
|
|
5640
|
-
striped: false,
|
|
5641
|
-
bordered: true,
|
|
5642
|
-
compact: false,
|
|
5643
|
-
tableClass: 'tw-table-fixed tw-w-full tw-rounded-none'
|
|
5660
|
+
// Dependency injection
|
|
5661
|
+
destroyRef = inject(DestroyRef);
|
|
5662
|
+
themeService = inject(PageThemeService);
|
|
5663
|
+
appState = inject(AppStateHelperService);
|
|
5664
|
+
fb = inject(NonNullableFormBuilder);
|
|
5665
|
+
router = inject(Router);
|
|
5666
|
+
route = inject(ActivatedRoute);
|
|
5667
|
+
// Modern ViewChild signals for template renderers (Angular 20 approach)
|
|
5668
|
+
themeDetailsRendererTemplate = viewChild.required('themeDetailsRendererTemplate');
|
|
5669
|
+
themeStatusRendererTemplate = viewChild.required('themeStatusRendererTemplate');
|
|
5670
|
+
actionsDropdownRendererTemplate = viewChild.required('actionsDropdownRendererTemplate');
|
|
5671
|
+
// Make Math available in template
|
|
5672
|
+
Math = Math;
|
|
5673
|
+
// Signals for reactive state management
|
|
5674
|
+
themes = signal([], ...(ngDevMode ? [{ debugName: "themes" }] : []));
|
|
5675
|
+
loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
5676
|
+
error = signal(null, ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
5677
|
+
selectedItems = signal([], ...(ngDevMode ? [{ debugName: "selectedItems" }] : []));
|
|
5678
|
+
searchTerm = signal('', ...(ngDevMode ? [{ debugName: "searchTerm" }] : []));
|
|
5679
|
+
// Derived list filtered by searchTerm
|
|
5680
|
+
filteredThemes = computed(() => {
|
|
5681
|
+
const q = (this.searchTerm() || '').toLowerCase().trim();
|
|
5682
|
+
const items = this.themes() || [];
|
|
5683
|
+
if (!q)
|
|
5684
|
+
return items;
|
|
5685
|
+
return items.filter(t => {
|
|
5686
|
+
const title = (t.sytm_title || '').toLowerCase();
|
|
5687
|
+
const code = (t.sytm_theme_code || '').toLowerCase();
|
|
5688
|
+
const desc = (t.sytm_desc || '').toLowerCase();
|
|
5689
|
+
return title.includes(q) || code.includes(q) || desc.includes(q);
|
|
5644
5690
|
});
|
|
5645
|
-
|
|
5646
|
-
this.actionHandlers = {
|
|
5647
|
-
onEdit: (item) => this.editTheme(item),
|
|
5648
|
-
onDelete: (item) => this.deleteTheme(item),
|
|
5649
|
-
onToggleStatus: (item) => this.toggleThemeStatus(item)
|
|
5650
|
-
};
|
|
5651
|
-
// ===== Drawer (sytm_layout_drawer) helpers =====
|
|
5652
|
-
this.drawerConfigOptions = [
|
|
5653
|
-
{ value: 'drawer_notes', label: 'Drawer Notes' },
|
|
5654
|
-
{ value: 'drawer_theme', label: 'Drawer Theme' }
|
|
5655
|
-
];
|
|
5656
|
-
}
|
|
5691
|
+
}, ...(ngDevMode ? [{ debugName: "filteredThemes" }] : []));
|
|
5657
5692
|
// Helper to resolve preview image URL safely
|
|
5658
5693
|
getPreviewUrl(theme) {
|
|
5659
5694
|
const id = theme?.sytm_preview_id_fm || '';
|
|
@@ -5673,6 +5708,49 @@ class PageThemeComponent {
|
|
|
5673
5708
|
const target = event.target;
|
|
5674
5709
|
this.searchTerm.set(target?.value ?? '');
|
|
5675
5710
|
}
|
|
5711
|
+
// Page information
|
|
5712
|
+
pageId = signal('', ...(ngDevMode ? [{ debugName: "pageId" }] : []));
|
|
5713
|
+
pageTitle = signal('', ...(ngDevMode ? [{ debugName: "pageTitle" }] : []));
|
|
5714
|
+
// Form state
|
|
5715
|
+
isEditMode = signal(false, ...(ngDevMode ? [{ debugName: "isEditMode" }] : []));
|
|
5716
|
+
editingThemeId = signal(null, ...(ngDevMode ? [{ debugName: "editingThemeId" }] : []));
|
|
5717
|
+
retrievedTheme = signal(null, ...(ngDevMode ? [{ debugName: "retrievedTheme" }] : []));
|
|
5718
|
+
// Pagination signals
|
|
5719
|
+
currentPage = signal(1, ...(ngDevMode ? [{ debugName: "currentPage" }] : []));
|
|
5720
|
+
pageSize = signal(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
|
|
5721
|
+
totalItems = signal(0, ...(ngDevMode ? [{ debugName: "totalItems" }] : []));
|
|
5722
|
+
// Modern reactive forms with signals
|
|
5723
|
+
themeForm = this.fb.group({
|
|
5724
|
+
sytm_title: ['', [Validators.required]],
|
|
5725
|
+
sytm_desc: [''],
|
|
5726
|
+
sytm_theme_code: ['', [Validators.required]],
|
|
5727
|
+
sytm_preview_id_fm: [''],
|
|
5728
|
+
sytm_sub_title: [''],
|
|
5729
|
+
sytm_configuration: ['{}'],
|
|
5730
|
+
sytm_entity_id_syen: [''],
|
|
5731
|
+
sytm_isselected: [false],
|
|
5732
|
+
sytm_layout: this.fb.group({
|
|
5733
|
+
sytm_layout_sidebar: this.fb.group({ status: [true] }),
|
|
5734
|
+
sytm_layout_header: this.fb.group({ status: [true] }),
|
|
5735
|
+
sytm_layout_footer: this.fb.group({ status: [false] }),
|
|
5736
|
+
sytm_layout_breadcrumb: this.fb.group({ status: [true] }),
|
|
5737
|
+
sytm_layout_console: this.fb.group({ status: [false] }),
|
|
5738
|
+
sytm_layout_request: this.fb.group({ status: [false] }),
|
|
5739
|
+
sytm_layout_drawer: this.fb.array([])
|
|
5740
|
+
}),
|
|
5741
|
+
sytm_isactive: [true]
|
|
5742
|
+
});
|
|
5743
|
+
// Computed values
|
|
5744
|
+
isFormDirty = computed(() => this.themeForm.dirty, ...(ngDevMode ? [{ debugName: "isFormDirty" }] : []));
|
|
5745
|
+
// Multi-select options for layout sections
|
|
5746
|
+
layoutOptions = [
|
|
5747
|
+
{ value: 'sidebar', label: 'Sidebar' },
|
|
5748
|
+
{ value: 'header', label: 'Header' },
|
|
5749
|
+
{ value: 'footer', label: 'Footer' },
|
|
5750
|
+
{ value: 'breadcrumb', label: 'Breadcrumb' },
|
|
5751
|
+
{ value: 'console', label: 'Console' },
|
|
5752
|
+
{ value: 'request', label: 'Request' }
|
|
5753
|
+
];
|
|
5676
5754
|
// Read enabled selections from form values
|
|
5677
5755
|
enabledLayoutSelections() {
|
|
5678
5756
|
const layout = this.themeForm.get('sytm_layout');
|
|
@@ -5705,6 +5783,89 @@ class PageThemeComponent {
|
|
|
5705
5783
|
setBool('sytm_layout.sytm_layout_console.status', selected.has('console'));
|
|
5706
5784
|
setBool('sytm_layout.sytm_layout_request.status', selected.has('request'));
|
|
5707
5785
|
}
|
|
5786
|
+
// Grid configuration signal
|
|
5787
|
+
gridConfig = signal({
|
|
5788
|
+
id: 'theme-list-grid',
|
|
5789
|
+
title: '',
|
|
5790
|
+
subtitle: '',
|
|
5791
|
+
columns: [
|
|
5792
|
+
{
|
|
5793
|
+
key: 'details',
|
|
5794
|
+
header: 'Theme Details',
|
|
5795
|
+
type: 'custom',
|
|
5796
|
+
width: 'auto',
|
|
5797
|
+
truncate: true,
|
|
5798
|
+
align: 'left',
|
|
5799
|
+
renderer: 'themeDetailsRenderer'
|
|
5800
|
+
},
|
|
5801
|
+
{
|
|
5802
|
+
key: 'sytm_theme_code',
|
|
5803
|
+
header: 'Theme Code',
|
|
5804
|
+
type: 'text',
|
|
5805
|
+
width: '150px',
|
|
5806
|
+
truncate: true,
|
|
5807
|
+
align: 'left'
|
|
5808
|
+
},
|
|
5809
|
+
{
|
|
5810
|
+
key: 'sytm_isactive',
|
|
5811
|
+
header: 'Status',
|
|
5812
|
+
type: 'custom',
|
|
5813
|
+
width: '100px',
|
|
5814
|
+
truncate: false,
|
|
5815
|
+
align: 'center',
|
|
5816
|
+
renderer: 'themeStatusRenderer'
|
|
5817
|
+
},
|
|
5818
|
+
{
|
|
5819
|
+
key: 'actions',
|
|
5820
|
+
header: '',
|
|
5821
|
+
type: 'custom',
|
|
5822
|
+
width: '120px',
|
|
5823
|
+
truncate: false,
|
|
5824
|
+
align: 'center',
|
|
5825
|
+
renderer: 'actionsDropdownRenderer'
|
|
5826
|
+
}
|
|
5827
|
+
],
|
|
5828
|
+
data: [],
|
|
5829
|
+
trackBy: '_id',
|
|
5830
|
+
pagination: {
|
|
5831
|
+
enabled: true,
|
|
5832
|
+
pageSize: 10,
|
|
5833
|
+
pageSizeOptions: [10, 25, 50, 100],
|
|
5834
|
+
showQuickJump: true,
|
|
5835
|
+
showPageInfo: true,
|
|
5836
|
+
showRefresh: true
|
|
5837
|
+
},
|
|
5838
|
+
search: {
|
|
5839
|
+
enabled: true,
|
|
5840
|
+
placeholder: 'Search themes...',
|
|
5841
|
+
searchableColumns: ['sytm_title', 'sytm_desc', 'sytm_theme_code'],
|
|
5842
|
+
debounceMs: 300
|
|
5843
|
+
},
|
|
5844
|
+
loading: {
|
|
5845
|
+
useDefer: true,
|
|
5846
|
+
skeletonRows: 5,
|
|
5847
|
+
showOverlay: false
|
|
5848
|
+
},
|
|
5849
|
+
scroll: {
|
|
5850
|
+
enabled: true,
|
|
5851
|
+
maxHeight: '',
|
|
5852
|
+
minHeight: '',
|
|
5853
|
+
stickyHeader: true,
|
|
5854
|
+
virtualScroll: false,
|
|
5855
|
+
rowHeight: 50
|
|
5856
|
+
},
|
|
5857
|
+
responsive: true,
|
|
5858
|
+
striped: false,
|
|
5859
|
+
bordered: true,
|
|
5860
|
+
compact: false,
|
|
5861
|
+
tableClass: 'tw-table-fixed tw-w-full tw-rounded-none'
|
|
5862
|
+
}, ...(ngDevMode ? [{ debugName: "gridConfig" }] : []));
|
|
5863
|
+
// Action handlers for grid
|
|
5864
|
+
actionHandlers = {
|
|
5865
|
+
onEdit: (item) => this.editTheme(item),
|
|
5866
|
+
onDelete: (item) => this.deleteTheme(item),
|
|
5867
|
+
onToggleStatus: (item) => this.toggleThemeStatus(item)
|
|
5868
|
+
};
|
|
5708
5869
|
ngOnInit() {
|
|
5709
5870
|
this.initializeComponent();
|
|
5710
5871
|
}
|
|
@@ -6155,6 +6316,11 @@ class PageThemeComponent {
|
|
|
6155
6316
|
const event = new MouseEvent('click', { bubbles: true });
|
|
6156
6317
|
document.dispatchEvent(event);
|
|
6157
6318
|
}
|
|
6319
|
+
// ===== Drawer (sytm_layout_drawer) helpers =====
|
|
6320
|
+
drawerConfigOptions = [
|
|
6321
|
+
{ value: 'drawer_notes', label: 'Drawer Notes' },
|
|
6322
|
+
{ value: 'drawer_theme', label: 'Drawer Theme' }
|
|
6323
|
+
];
|
|
6158
6324
|
get drawerArray() {
|
|
6159
6325
|
return this.themeForm.get('sytm_layout.sytm_layout_drawer');
|
|
6160
6326
|
}
|
|
@@ -6222,10 +6388,10 @@ class PageThemeComponent {
|
|
|
6222
6388
|
error: () => { this.loading.set(false); }
|
|
6223
6389
|
});
|
|
6224
6390
|
}
|
|
6225
|
-
static
|
|
6226
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: PageThemeComponent, isStandalone: true, selector: "cide-core-app-page-theme", viewQueries: [{ propertyName: "themeDetailsRendererTemplate", first: true, predicate: ["themeDetailsRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "themeStatusRendererTemplate", first: true, predicate: ["themeStatusRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "actionsDropdownRendererTemplate", first: true, predicate: ["actionsDropdownRendererTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Page Theme Container -->\r\n<div class=\"tw-flex tw-h-full tw-w-full\">\r\n \r\n <!-- Left: Form and header (60%) -->\r\n <div class=\"tw-w-full lg:tw-w-3/5 tw-flex tw-flex-col tw-border-r tw-border-gray-200\">\r\n\r\n <!-- Header Section -->\r\n <div class=\"tw-px-6 tw-py-3 tw-border-b tw-border-gray-200 tw-bg-gray-50\">\r\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-3 sm:tw-space-y-0\">\r\n\r\n <!-- Title and Back Button -->\r\n <div class=\"tw-flex tw-items-center tw-space-x-4\">\r\n <button cideEleButton variant=\"ghost\" size=\"sm\" (click)=\"goBack()\" class=\"tw-text-gray-600 hover:tw-text-gray-900\">\r\n <cide-ele-icon class=\"tw-w-4 tw-h-4\">arrow_back</cide-ele-icon>\r\n </button>\r\n <div class=\"tw-flex tw-items-center tw-space-x-2\">\r\n <cide-ele-icon class=\"tw-text-blue-600 tw-w-5 tw-h-5\">palette</cide-ele-icon>\r\n <div>\r\n <h5 class=\"tw-text-base tw-font-medium tw-text-gray-900 tw-m-0\">Theme Management</h5>\r\n <p class=\"tw-text-sm tw-text-gray-500 tw-m-0\">Page: {{ pageTitle() }}</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Error Message -->\r\n @if (error()) {\r\n <div class=\"tw-mt-4 tw-p-4 tw-bg-red-50 tw-border tw-border-red-200 tw-rounded-md\">\r\n <div class=\"tw-flex tw-items-start\">\r\n <cide-ele-icon name=\"error\" class=\"tw-text-red-400 tw-w-5 tw-h-5 tw-mt-0.5 tw-flex-shrink-0\"></cide-ele-icon>\r\n <div class=\"tw-ml-3\">\r\n <h3 class=\"tw-text-sm tw-font-medium tw-text-red-800 tw-m-0\">Error</h3>\r\n <p class=\"tw-text-sm tw-text-red-700 tw-mt-1 tw-m-0\">{{ error() }}</p>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Quick Add/Edit Form Section -->\r\n <div class=\"tw-px-6 tw-py-4 tw-bg-white tw-overflow-auto\">\r\n <div class=\"tw-flex tw-items-center tw-justify-between tw-mb-3\">\r\n <div class=\"tw-flex tw-items-center tw-space-x-3\">\r\n <cide-ele-icon class=\"tw-text-blue-600 tw-w-5 tw-h-5\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\r\n <h6 class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-m-0\">{{ isEditMode() ? 'Edit Theme' : 'Quick Add Theme' }}</h6>\r\n </div>\r\n </div>\r\n\r\n <!-- Form (kept as-is) -->\r\n <form [formGroup]=\"themeForm\" (ngSubmit)=\"saveTheme()\" class=\"tw-space-y-4\">\r\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-3 tw-gap-4\">\r\n <!-- Theme Title -->\r\n <div class=\"tw-space-y-2\">\r\n <cide-ele-input id=\"sytm_title\" formControlName=\"sytm_title\" placeholder=\"Enter theme title\" label=\"Theme Title*\" size=\"sm\"></cide-ele-input>\r\n </div>\r\n <!-- Theme Code -->\r\n <div class=\"tw-space-y-2\">\r\n <cide-ele-input id=\"sytm_theme_code\" formControlName=\"sytm_theme_code\" placeholder=\"Enter theme code\" label=\"Theme Code*\" size=\"sm\"></cide-ele-input>\r\n </div>\r\n <!-- Status -->\r\n <div class=\"tw-space-y-2\">\r\n <cide-ele-input\r\n id=\"sytm_isactive_cb\"\r\n type=\"checkbox\"\r\n label=\"Active\"\r\n size=\"sm\"\r\n formControlName=\"sytm_isactive\">\r\n </cide-ele-input>\r\n </div>\r\n <!-- Sub Title -->\r\n <div class=\"tw-space-y-2\">\r\n <cide-ele-input id=\"sytm_sub_title\" formControlName=\"sytm_sub_title\" placeholder=\"Enter sub title\" label=\"Sub Title\" size=\"sm\"></cide-ele-input>\r\n </div>\r\n <!-- Preview ID -->\r\n <div class=\"tw-space-y-2\">\r\n <cide-ele-input id=\"sytm_preview_id_fm\" formControlName=\"sytm_preview_id_fm\" placeholder=\"Enter preview image ID\" label=\"Preview Image ID\" size=\"sm\"></cide-ele-input>\r\n </div>\r\n <!-- Description -->\r\n <div class=\"tw-space-y-2 md:tw-col-span-2\">\r\n <cide-ele-textarea id=\"sytm_desc\" formControlName=\"sytm_desc\" placeholder=\"Enter theme description\" rows=\"2\" label=\"Description\" size=\"sm\"></cide-ele-textarea>\r\n </div>\r\n <!-- Configuration JSON -->\r\n <div class=\"tw-space-y-2 md:tw-col-span-3\">\r\n <cide-ele-json-editor label=\"Configuration JSON\" formControlName=\"sytm_configuration\" [required]=\"true\" [config]=\"{\r\n showLineNumbers: true,\r\n autoFormat: true,\r\n validateOnChange: true,\r\n minHeight: 150,\r\n maxHeight: 300,\r\n placeholder: 'Enter theme configuration JSON...'\r\n }\" helperText=\"Enter valid JSON configuration for the theme\"></cide-ele-json-editor>\r\n </div>\r\n <!-- Layout Configuration + Selection: right-side checkbox list -->\r\n <div class=\"lg:tw-col-span-1 tw-space-y-2\">\r\n <div class=\"tw-text-sm tw-font-medium tw-text-gray-700\">Layout & Selection</div>\r\n <!-- Selected toggle -->\r\n <div class=\"tw-bg-white tw-border tw-border-gray-200 tw-rounded-md tw-px-3 tw-py-2\">\r\n <cide-ele-input\r\n id=\"sytm_isselected\"\r\n type=\"checkbox\"\r\n label=\"Selected (Default)\"\r\n size=\"sm\"\r\n formControlName=\"sytm_isselected\">\r\n </cide-ele-input>\r\n </div>\r\n <div formGroupName=\"sytm_layout\" class=\"tw-bg-white tw-border tw-border-gray-200 tw-rounded-md tw-divide-y tw-overflow-hidden\">\r\n <!-- Sidebar -->\r\n <div class=\"tw-px-3 tw-py-2\" formGroupName=\"sytm_layout_sidebar\">\r\n <cide-ele-input id=\"layout_sidebar_status\" type=\"checkbox\" label=\"Sidebar\" size=\"sm\" formControlName=\"status\"></cide-ele-input>\r\n </div>\r\n <!-- Header -->\r\n <div class=\"tw-px-3 tw-py-2\" formGroupName=\"sytm_layout_header\">\r\n <cide-ele-input id=\"layout_header_status\" type=\"checkbox\" label=\"Header\" size=\"sm\" formControlName=\"status\"></cide-ele-input>\r\n </div>\r\n <!-- Footer -->\r\n <div class=\"tw-px-3 tw-py-2\" formGroupName=\"sytm_layout_footer\">\r\n <cide-ele-input id=\"layout_footer_status\" type=\"checkbox\" label=\"Footer\" size=\"sm\" formControlName=\"status\"></cide-ele-input>\r\n </div>\r\n <!-- Breadcrumb -->\r\n <div class=\"tw-px-3 tw-py-2\" formGroupName=\"sytm_layout_breadcrumb\">\r\n <cide-ele-input id=\"layout_breadcrumb_status\" type=\"checkbox\" label=\"Breadcrumb\" size=\"sm\" formControlName=\"status\"></cide-ele-input>\r\n </div>\r\n <!-- Console -->\r\n <div class=\"tw-px-3 tw-py-2\" formGroupName=\"sytm_layout_console\">\r\n <cide-ele-input id=\"layout_console_status\" type=\"checkbox\" label=\"Console\" size=\"sm\" formControlName=\"status\"></cide-ele-input>\r\n </div>\r\n <!-- Request -->\r\n <div class=\"tw-px-3 tw-py-2\" formGroupName=\"sytm_layout_request\">\r\n <cide-ele-input id=\"layout_request_status\" type=\"checkbox\" label=\"Request\" size=\"sm\" formControlName=\"status\"></cide-ele-input>\r\n </div>\r\n </div>\r\n <p class=\"tw-text-xs tw-text-gray-500 tw-pt-1\">Toggle active sections. Only one theme can be selected as default. More options can be added here later.</p>\r\n </div>\r\n <!-- Drawer Configuration -->\r\n <div class=\"tw-space-y-2 md:tw-col-span-3\">\r\n <div class=\"tw-flex tw-items-center tw-justify-between\">\r\n <div class=\"tw-text-sm tw-font-medium tw-text-gray-700\">Drawers</div>\r\n <button cideEleButton type=\"button\" size=\"xs\" variant=\"outline\" (click)=\"addDrawer()\">\r\n Add Drawer\r\n </button>\r\n </div>\r\n\r\n <div formGroupName=\"sytm_layout\">\r\n <div class=\"tw-space-y-2\" formArrayName=\"sytm_layout_drawer\">\r\n <div *ngFor=\"let drawerGrp of drawerArray.controls; let i = index\" [formGroupName]=\"i\" class=\"tw-border tw-border-gray-200 tw-rounded-md tw-p-3 tw-flex tw-items-center tw-gap-3\">\r\n <cide-ele-input id=\"drawer_active_{{i}}\" type=\"checkbox\" label=\"Active\" size=\"sm\" formControlName=\"syth_status\"></cide-ele-input>\r\n <div class=\"tw-flex-1\">\r\n <cide-ele-select\r\n id=\"drawer_config_{{i}}\"\r\n label=\"Drawer For\"\r\n size=\"sm\"\r\n [options]=\"drawerConfigOptions\"\r\n formControlName=\"syth_config_syco_for\">\r\n </cide-ele-select>\r\n </div>\r\n <button cideEleButton type=\"button\" size=\"xs\" variant=\"ghost\" (click)=\"removeDrawer(i)\">\r\n <cide-ele-icon class=\"tw-w-4 tw-h-4\">delete</cide-ele-icon>\r\n </button>\r\n </div>\r\n <p class=\"tw-text-xs tw-text-gray-500\">Configure multiple drawers as needed.</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Form Actions -->\r\n <div class=\"tw-flex tw-flex-col tw-gap-2 tw-pt-4 tw-border-t tw-border-gray-200\">\r\n <div class=\"tw-flex tw-items-center tw-justify-end tw-space-x-3\">\r\n <button cideEleButton type=\"button\" variant=\"outline\" (click)=\"cancelForm()\" [disabled]=\"loading()\">Cancel</button>\r\n <button cideEleButton type=\"submit\" variant=\"primary\" leftIcon=\"add\" [disabled]=\"!themeForm.valid || loading()\" [loading]=\"loading()\">\r\n {{ isEditMode() ? 'Update Theme' : 'Create Theme' }}\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n\r\n <!-- Right: Theme gallery (40%) -->\r\n <div class=\"tw-hidden lg:tw-flex tw-w-2/5 tw-flex-col\">\r\n <!-- (Header consolidated above) -->\r\n\r\n <!-- Gallery list -->\r\n <div class=\"tw-flex-1 tw-overflow-auto tw-bg-gray-50\">\r\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-3 tw-p-4\">\r\n @for (theme of filteredThemes(); track theme._id) {\r\n <div class=\"tw-rounded-md tw-transition tw-cursor-pointer tw-relative\"\r\n [ngClass]=\"theme.sytm_isselected\r\n ? 'tw-border tw-border-blue-500 tw-ring-2 tw-ring-blue-200 tw-bg-blue-50/50'\r\n : 'tw-bg-white tw-border tw-border-gray-200 hover:tw-shadow-sm'\"\r\n (click)=\"editTheme(theme)\"\r\n role=\"button\"\r\n tabindex=\"0\"\r\n [attr.aria-selected]=\"theme.sytm_isselected ? 'true' : 'false'\"\r\n [attr.aria-label]=\"'Edit theme ' + (theme.sytm_title || theme.sytm_theme_code)\"\r\n (keydown.enter)=\"editTheme(theme)\"\r\n (keydown.space)=\"$event.preventDefault(); editTheme(theme)\">\r\n\r\n <!-- Selected badge -->\r\n <div *ngIf=\"theme.sytm_isselected\"\r\n class=\"tw-absolute tw-top-2 tw-right-2 tw-flex tw-items-center tw-justify-center tw-w-6 tw-h-6 tw-rounded-full tw-bg-blue-600 tw-text-white\">\r\n <cide-ele-icon class=\"tw-w-4 tw-h-4\">check</cide-ele-icon>\r\n </div>\r\n \r\n <div class=\"tw-aspect-[16/9] tw-bg-gray-100 tw-rounded-t-md tw-overflow-hidden tw-flex tw-items-center tw-justify-center\">\r\n @if (getPreviewUrl(theme)) {\r\n <img [src]=\"getPreviewUrl(theme)\" class=\"tw-w-full tw-h-full tw-object-cover\" alt=\"Preview\" />\r\n } @else {\r\n <div class=\"tw-text-gray-400 tw-text-xs\">No preview</div>\r\n }\r\n </div>\r\n <div class=\"tw-p-3 tw-space-y-1\">\r\n <div class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\" [title]=\"theme.sytm_title\">{{ theme.sytm_title || 'Untitled Theme' }}</div>\r\n <div class=\"tw-text-xs tw-text-gray-500 tw-truncate\" [title]=\"theme.sytm_theme_code\">{{ theme.sytm_theme_code }}</div>\r\n <div class=\"tw-flex tw-items-center tw-justify-between tw-pt-1\">\r\n <span class=\"tw-inline-flex tw-items-center tw-gap-1 tw-text-xs\" [ngClass]=\"theme.sytm_isactive ? 'tw-text-green-700' : 'tw-text-red-700'\">\r\n <span class=\"tw-w-1.5 tw-h-1.5 tw-rounded-full\" [ngClass]=\"theme.sytm_isactive ? 'tw-bg-green-500' : 'tw-bg-red-500'\"></span>\r\n {{ theme.sytm_isactive ? 'Active' : 'Inactive' }}\r\n </span>\r\n <div class=\"tw-flex tw-items-center tw-gap-1\">\r\n <!-- Set Selected Button - Clear and Simple -->\r\n @if (theme.sytm_isselected) {\r\n <span class=\"tw-inline-flex tw-items-center tw-gap-1 tw-px-2 tw-py-1 tw-bg-green-100 tw-text-green-800 tw-rounded-md tw-text-xs tw-font-medium\">\r\n <cide-ele-icon class=\"tw-w-3 tw-h-3\">check</cide-ele-icon>\r\n Selected\r\n </span>\r\n } @else {\r\n <button cideEleButton \r\n variant=\"outline\" \r\n size=\"xs\"\r\n (click)=\"$event.stopPropagation(); setSelectedTheme(theme)\"\r\n [attr.aria-label]=\"'Select ' + (theme.sytm_title || theme.sytm_theme_code) + ' theme'\"\r\n class=\"tw-text-xs\">\r\n Select\r\n </button>\r\n }\r\n <button cideEleButton variant=\"ghost\" size=\"xs\" (click)=\"$event.stopPropagation(); editTheme(theme)\"\r\n [attr.aria-label]=\"'Edit theme ' + (theme.sytm_title || theme.sytm_theme_code)\">\r\n <cide-ele-icon class=\"tw-w-4 tw-h-4\">edit</cide-ele-icon>\r\n </button>\r\n <button cideEleButton variant=\"ghost\" size=\"xs\" (click)=\"$event.stopPropagation(); deleteTheme(theme)\"\r\n [attr.aria-label]=\"'Delete theme ' + (theme.sytm_title || theme.sytm_theme_code)\">\r\n <cide-ele-icon class=\"tw-w-4 tw-h-4\">delete</cide-ele-icon>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n\r\n @if (!loading() && filteredThemes().length === 0) {\r\n <div class=\"tw-col-span-full tw-text-center tw-text-xs tw-text-gray-500 tw-py-8\">No themes found</div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- \r\n Angular Template References for Grid Renderers (Best Practice)\r\n \r\n These ng-template elements represent the Angular best practice for custom rendering.\r\n They provide:\r\n - Type safety with template context\r\n - Component lifecycle integration\r\n - Change detection optimization\r\n - Proper event handling\r\n - Accessibility features\r\n \r\n Note: Current data grid uses string renderers for compatibility.\r\n Templates are maintained for future component enhancement.\r\n-->\r\n\r\n<!-- Theme Details Renderer Template -->\r\n<ng-template #themeDetailsRendererTemplate let-row=\"row\" let-value=\"value\">\r\n <div class=\"tw-flex tw-items-center tw-min-w-0\">\r\n <!-- Theme Icon -->\r\n <div class=\"tw-flex-shrink-0\">\r\n <cide-ele-icon \r\n class=\"tw-text-purple-600\" \r\n size=\"xs\">\r\n palette\r\n </cide-ele-icon>\r\n </div>\r\n \r\n <!-- Theme Details -->\r\n <div class=\"tw-ml-3 tw-min-w-0 tw-flex-1\">\r\n <div class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\" \r\n [title]=\"row.sytm_title\">\r\n {{ row.sytm_title || 'Untitled' }}\r\n </div>\r\n @if (row.sytm_desc) {\r\n <div class=\"tw-text-xs tw-text-gray-500 tw-truncate\" \r\n [title]=\"row.sytm_desc\">\r\n {{ row.sytm_desc }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Theme Status Renderer Template -->\r\n<ng-template #themeStatusRendererTemplate let-row=\"row\" let-value=\"value\">\r\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 tw-whitespace-nowrap\"\r\n [ngClass]=\"row.sytm_isactive ? 'tw-bg-green-100 tw-text-green-800' : 'tw-bg-red-100 tw-text-red-800'\">\r\n {{ row.sytm_isactive ? 'Active' : 'Inactive' }}\r\n </span>\r\n</ng-template>\r\n\r\n<!-- Actions Dropdown Renderer Template -->\r\n<ng-template #actionsDropdownRendererTemplate let-row=\"row\" let-value=\"value\">\r\n <cide-ele-dropdown \r\n [items]=\"getActionDropdownItems(row)\"\r\n [config]=\"{ triggerIcon: 'more_vert', triggerSize: 'sm' }\"\r\n (itemClick)=\"onDropdownItemClick($event, row)\">\r\n </cide-ele-dropdown>\r\n</ng-template> ", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i2.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "ngmodule", type: FormsModule }, { 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: 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"], 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: 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"] }] }); }
|
|
6391
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PageThemeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6392
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: PageThemeComponent, isStandalone: true, selector: "cide-core-app-page-theme", viewQueries: [{ propertyName: "themeDetailsRendererTemplate", first: true, predicate: ["themeDetailsRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "themeStatusRendererTemplate", first: true, predicate: ["themeStatusRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "actionsDropdownRendererTemplate", first: true, predicate: ["actionsDropdownRendererTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Page Theme Container -->\r\n<div class=\"tw-flex tw-h-full tw-w-full\">\r\n \r\n <!-- Left: Form and header (60%) -->\r\n <div class=\"tw-w-full lg:tw-w-3/5 tw-flex tw-flex-col tw-border-r tw-border-gray-200\">\r\n\r\n <!-- Header Section -->\r\n <div class=\"tw-px-6 tw-py-3 tw-border-b tw-border-gray-200 tw-bg-gray-50\">\r\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-3 sm:tw-space-y-0\">\r\n\r\n <!-- Title and Back Button -->\r\n <div class=\"tw-flex tw-items-center tw-space-x-4\">\r\n <button cideEleButton variant=\"ghost\" size=\"sm\" (click)=\"goBack()\" class=\"tw-text-gray-600 hover:tw-text-gray-900\">\r\n <cide-ele-icon class=\"tw-w-4 tw-h-4\">arrow_back</cide-ele-icon>\r\n </button>\r\n <div class=\"tw-flex tw-items-center tw-space-x-2\">\r\n <cide-ele-icon class=\"tw-text-blue-600 tw-w-5 tw-h-5\">palette</cide-ele-icon>\r\n <div>\r\n <h5 class=\"tw-text-base tw-font-medium tw-text-gray-900 tw-m-0\">Theme Management</h5>\r\n <p class=\"tw-text-sm tw-text-gray-500 tw-m-0\">Page: {{ pageTitle() }}</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Error Message -->\r\n @if (error()) {\r\n <div class=\"tw-mt-4 tw-p-4 tw-bg-red-50 tw-border tw-border-red-200 tw-rounded-md\">\r\n <div class=\"tw-flex tw-items-start\">\r\n <cide-ele-icon name=\"error\" class=\"tw-text-red-400 tw-w-5 tw-h-5 tw-mt-0.5 tw-flex-shrink-0\"></cide-ele-icon>\r\n <div class=\"tw-ml-3\">\r\n <h3 class=\"tw-text-sm tw-font-medium tw-text-red-800 tw-m-0\">Error</h3>\r\n <p class=\"tw-text-sm tw-text-red-700 tw-mt-1 tw-m-0\">{{ error() }}</p>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Quick Add/Edit Form Section -->\r\n <div class=\"tw-px-6 tw-py-4 tw-bg-white tw-overflow-auto\">\r\n <div class=\"tw-flex tw-items-center tw-justify-between tw-mb-3\">\r\n <div class=\"tw-flex tw-items-center tw-space-x-3\">\r\n <cide-ele-icon class=\"tw-text-blue-600 tw-w-5 tw-h-5\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\r\n <h6 class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-m-0\">{{ isEditMode() ? 'Edit Theme' : 'Quick Add Theme' }}</h6>\r\n </div>\r\n </div>\r\n\r\n <!-- Form (kept as-is) -->\r\n <form [formGroup]=\"themeForm\" (ngSubmit)=\"saveTheme()\" class=\"tw-space-y-4\">\r\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-3 tw-gap-4\">\r\n <!-- Theme Title -->\r\n <div class=\"tw-space-y-2\">\r\n <cide-ele-input id=\"sytm_title\" formControlName=\"sytm_title\" placeholder=\"Enter theme title\" label=\"Theme Title*\" size=\"sm\"></cide-ele-input>\r\n </div>\r\n <!-- Theme Code -->\r\n <div class=\"tw-space-y-2\">\r\n <cide-ele-input id=\"sytm_theme_code\" formControlName=\"sytm_theme_code\" placeholder=\"Enter theme code\" label=\"Theme Code*\" size=\"sm\"></cide-ele-input>\r\n </div>\r\n <!-- Status -->\r\n <div class=\"tw-space-y-2\">\r\n <cide-ele-input\r\n id=\"sytm_isactive_cb\"\r\n type=\"checkbox\"\r\n label=\"Active\"\r\n size=\"sm\"\r\n formControlName=\"sytm_isactive\">\r\n </cide-ele-input>\r\n </div>\r\n <!-- Sub Title -->\r\n <div class=\"tw-space-y-2\">\r\n <cide-ele-input id=\"sytm_sub_title\" formControlName=\"sytm_sub_title\" placeholder=\"Enter sub title\" label=\"Sub Title\" size=\"sm\"></cide-ele-input>\r\n </div>\r\n <!-- Preview ID -->\r\n <div class=\"tw-space-y-2\">\r\n <cide-ele-input id=\"sytm_preview_id_fm\" formControlName=\"sytm_preview_id_fm\" placeholder=\"Enter preview image ID\" label=\"Preview Image ID\" size=\"sm\"></cide-ele-input>\r\n </div>\r\n <!-- Description -->\r\n <div class=\"tw-space-y-2 md:tw-col-span-2\">\r\n <cide-ele-textarea id=\"sytm_desc\" formControlName=\"sytm_desc\" placeholder=\"Enter theme description\" rows=\"2\" label=\"Description\" size=\"sm\"></cide-ele-textarea>\r\n </div>\r\n <!-- Configuration JSON -->\r\n <div class=\"tw-space-y-2 md:tw-col-span-3\">\r\n <cide-ele-json-editor label=\"Configuration JSON\" formControlName=\"sytm_configuration\" [required]=\"true\" [config]=\"{\r\n showLineNumbers: true,\r\n autoFormat: true,\r\n validateOnChange: true,\r\n minHeight: 150,\r\n maxHeight: 300,\r\n placeholder: 'Enter theme configuration JSON...'\r\n }\" helperText=\"Enter valid JSON configuration for the theme\"></cide-ele-json-editor>\r\n </div>\r\n <!-- Layout Configuration + Selection: right-side checkbox list -->\r\n <div class=\"lg:tw-col-span-1 tw-space-y-2\">\r\n <div class=\"tw-text-sm tw-font-medium tw-text-gray-700\">Layout & Selection</div>\r\n <!-- Selected toggle -->\r\n <div class=\"tw-bg-white tw-border tw-border-gray-200 tw-rounded-md tw-px-3 tw-py-2\">\r\n <cide-ele-input\r\n id=\"sytm_isselected\"\r\n type=\"checkbox\"\r\n label=\"Selected (Default)\"\r\n size=\"sm\"\r\n formControlName=\"sytm_isselected\">\r\n </cide-ele-input>\r\n </div>\r\n <div formGroupName=\"sytm_layout\" class=\"tw-bg-white tw-border tw-border-gray-200 tw-rounded-md tw-divide-y tw-overflow-hidden\">\r\n <!-- Sidebar -->\r\n <div class=\"tw-px-3 tw-py-2\" formGroupName=\"sytm_layout_sidebar\">\r\n <cide-ele-input id=\"layout_sidebar_status\" type=\"checkbox\" label=\"Sidebar\" size=\"sm\" formControlName=\"status\"></cide-ele-input>\r\n </div>\r\n <!-- Header -->\r\n <div class=\"tw-px-3 tw-py-2\" formGroupName=\"sytm_layout_header\">\r\n <cide-ele-input id=\"layout_header_status\" type=\"checkbox\" label=\"Header\" size=\"sm\" formControlName=\"status\"></cide-ele-input>\r\n </div>\r\n <!-- Footer -->\r\n <div class=\"tw-px-3 tw-py-2\" formGroupName=\"sytm_layout_footer\">\r\n <cide-ele-input id=\"layout_footer_status\" type=\"checkbox\" label=\"Footer\" size=\"sm\" formControlName=\"status\"></cide-ele-input>\r\n </div>\r\n <!-- Breadcrumb -->\r\n <div class=\"tw-px-3 tw-py-2\" formGroupName=\"sytm_layout_breadcrumb\">\r\n <cide-ele-input id=\"layout_breadcrumb_status\" type=\"checkbox\" label=\"Breadcrumb\" size=\"sm\" formControlName=\"status\"></cide-ele-input>\r\n </div>\r\n <!-- Console -->\r\n <div class=\"tw-px-3 tw-py-2\" formGroupName=\"sytm_layout_console\">\r\n <cide-ele-input id=\"layout_console_status\" type=\"checkbox\" label=\"Console\" size=\"sm\" formControlName=\"status\"></cide-ele-input>\r\n </div>\r\n <!-- Request -->\r\n <div class=\"tw-px-3 tw-py-2\" formGroupName=\"sytm_layout_request\">\r\n <cide-ele-input id=\"layout_request_status\" type=\"checkbox\" label=\"Request\" size=\"sm\" formControlName=\"status\"></cide-ele-input>\r\n </div>\r\n </div>\r\n <p class=\"tw-text-xs tw-text-gray-500 tw-pt-1\">Toggle active sections. Only one theme can be selected as default. More options can be added here later.</p>\r\n </div>\r\n <!-- Drawer Configuration -->\r\n <div class=\"tw-space-y-2 md:tw-col-span-3\">\r\n <div class=\"tw-flex tw-items-center tw-justify-between\">\r\n <div class=\"tw-text-sm tw-font-medium tw-text-gray-700\">Drawers</div>\r\n <button cideEleButton type=\"button\" size=\"xs\" variant=\"outline\" (click)=\"addDrawer()\">\r\n Add Drawer\r\n </button>\r\n </div>\r\n\r\n <div formGroupName=\"sytm_layout\">\r\n <div class=\"tw-space-y-2\" formArrayName=\"sytm_layout_drawer\">\r\n <div *ngFor=\"let drawerGrp of drawerArray.controls; let i = index\" [formGroupName]=\"i\" class=\"tw-border tw-border-gray-200 tw-rounded-md tw-p-3 tw-flex tw-items-center tw-gap-3\">\r\n <cide-ele-input id=\"drawer_active_{{i}}\" type=\"checkbox\" label=\"Active\" size=\"sm\" formControlName=\"syth_status\"></cide-ele-input>\r\n <div class=\"tw-flex-1\">\r\n <cide-ele-select\r\n id=\"drawer_config_{{i}}\"\r\n label=\"Drawer For\"\r\n size=\"sm\"\r\n [options]=\"drawerConfigOptions\"\r\n formControlName=\"syth_config_syco_for\">\r\n </cide-ele-select>\r\n </div>\r\n <button cideEleButton type=\"button\" size=\"xs\" variant=\"ghost\" (click)=\"removeDrawer(i)\">\r\n <cide-ele-icon class=\"tw-w-4 tw-h-4\">delete</cide-ele-icon>\r\n </button>\r\n </div>\r\n <p class=\"tw-text-xs tw-text-gray-500\">Configure multiple drawers as needed.</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Form Actions -->\r\n <div class=\"tw-flex tw-flex-col tw-gap-2 tw-pt-4 tw-border-t tw-border-gray-200\">\r\n <div class=\"tw-flex tw-items-center tw-justify-end tw-space-x-3\">\r\n <button cideEleButton type=\"button\" variant=\"outline\" (click)=\"cancelForm()\" [disabled]=\"loading()\">Cancel</button>\r\n <button cideEleButton type=\"submit\" variant=\"primary\" leftIcon=\"add\" [disabled]=\"!themeForm.valid || loading()\" [loading]=\"loading()\">\r\n {{ isEditMode() ? 'Update Theme' : 'Create Theme' }}\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n\r\n <!-- Right: Theme gallery (40%) -->\r\n <div class=\"tw-hidden lg:tw-flex tw-w-2/5 tw-flex-col\">\r\n <!-- (Header consolidated above) -->\r\n\r\n <!-- Gallery list -->\r\n <div class=\"tw-flex-1 tw-overflow-auto tw-bg-gray-50\">\r\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-3 tw-p-4\">\r\n @for (theme of filteredThemes(); track theme._id) {\r\n <div class=\"tw-rounded-md tw-transition tw-cursor-pointer tw-relative\"\r\n [ngClass]=\"theme.sytm_isselected\r\n ? 'tw-border tw-border-blue-500 tw-ring-2 tw-ring-blue-200 tw-bg-blue-50/50'\r\n : 'tw-bg-white tw-border tw-border-gray-200 hover:tw-shadow-sm'\"\r\n (click)=\"editTheme(theme)\"\r\n role=\"button\"\r\n tabindex=\"0\"\r\n [attr.aria-selected]=\"theme.sytm_isselected ? 'true' : 'false'\"\r\n [attr.aria-label]=\"'Edit theme ' + (theme.sytm_title || theme.sytm_theme_code)\"\r\n (keydown.enter)=\"editTheme(theme)\"\r\n (keydown.space)=\"$event.preventDefault(); editTheme(theme)\">\r\n\r\n <!-- Selected badge -->\r\n <div *ngIf=\"theme.sytm_isselected\"\r\n class=\"tw-absolute tw-top-2 tw-right-2 tw-flex tw-items-center tw-justify-center tw-w-6 tw-h-6 tw-rounded-full tw-bg-blue-600 tw-text-white\">\r\n <cide-ele-icon class=\"tw-w-4 tw-h-4\">check</cide-ele-icon>\r\n </div>\r\n \r\n <div class=\"tw-aspect-[16/9] tw-bg-gray-100 tw-rounded-t-md tw-overflow-hidden tw-flex tw-items-center tw-justify-center\">\r\n @if (getPreviewUrl(theme)) {\r\n <img [src]=\"getPreviewUrl(theme)\" class=\"tw-w-full tw-h-full tw-object-cover\" alt=\"Preview\" />\r\n } @else {\r\n <div class=\"tw-text-gray-400 tw-text-xs\">No preview</div>\r\n }\r\n </div>\r\n <div class=\"tw-p-3 tw-space-y-1\">\r\n <div class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\" [title]=\"theme.sytm_title\">{{ theme.sytm_title || 'Untitled Theme' }}</div>\r\n <div class=\"tw-text-xs tw-text-gray-500 tw-truncate\" [title]=\"theme.sytm_theme_code\">{{ theme.sytm_theme_code }}</div>\r\n <div class=\"tw-flex tw-items-center tw-justify-between tw-pt-1\">\r\n <span class=\"tw-inline-flex tw-items-center tw-gap-1 tw-text-xs\" [ngClass]=\"theme.sytm_isactive ? 'tw-text-green-700' : 'tw-text-red-700'\">\r\n <span class=\"tw-w-1.5 tw-h-1.5 tw-rounded-full\" [ngClass]=\"theme.sytm_isactive ? 'tw-bg-green-500' : 'tw-bg-red-500'\"></span>\r\n {{ theme.sytm_isactive ? 'Active' : 'Inactive' }}\r\n </span>\r\n <div class=\"tw-flex tw-items-center tw-gap-1\">\r\n <!-- Set Selected Button - Clear and Simple -->\r\n @if (theme.sytm_isselected) {\r\n <span class=\"tw-inline-flex tw-items-center tw-gap-1 tw-px-2 tw-py-1 tw-bg-green-100 tw-text-green-800 tw-rounded-md tw-text-xs tw-font-medium\">\r\n <cide-ele-icon class=\"tw-w-3 tw-h-3\">check</cide-ele-icon>\r\n Selected\r\n </span>\r\n } @else {\r\n <button cideEleButton \r\n variant=\"outline\" \r\n size=\"xs\"\r\n (click)=\"$event.stopPropagation(); setSelectedTheme(theme)\"\r\n [attr.aria-label]=\"'Select ' + (theme.sytm_title || theme.sytm_theme_code) + ' theme'\"\r\n class=\"tw-text-xs\">\r\n Select\r\n </button>\r\n }\r\n <button cideEleButton variant=\"ghost\" size=\"xs\" (click)=\"$event.stopPropagation(); editTheme(theme)\"\r\n [attr.aria-label]=\"'Edit theme ' + (theme.sytm_title || theme.sytm_theme_code)\">\r\n <cide-ele-icon class=\"tw-w-4 tw-h-4\">edit</cide-ele-icon>\r\n </button>\r\n <button cideEleButton variant=\"ghost\" size=\"xs\" (click)=\"$event.stopPropagation(); deleteTheme(theme)\"\r\n [attr.aria-label]=\"'Delete theme ' + (theme.sytm_title || theme.sytm_theme_code)\">\r\n <cide-ele-icon class=\"tw-w-4 tw-h-4\">delete</cide-ele-icon>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n\r\n @if (!loading() && filteredThemes().length === 0) {\r\n <div class=\"tw-col-span-full tw-text-center tw-text-xs tw-text-gray-500 tw-py-8\">No themes found</div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- \r\n Angular Template References for Grid Renderers (Best Practice)\r\n \r\n These ng-template elements represent the Angular best practice for custom rendering.\r\n They provide:\r\n - Type safety with template context\r\n - Component lifecycle integration\r\n - Change detection optimization\r\n - Proper event handling\r\n - Accessibility features\r\n \r\n Note: Current data grid uses string renderers for compatibility.\r\n Templates are maintained for future component enhancement.\r\n-->\r\n\r\n<!-- Theme Details Renderer Template -->\r\n<ng-template #themeDetailsRendererTemplate let-row=\"row\" let-value=\"value\">\r\n <div class=\"tw-flex tw-items-center tw-min-w-0\">\r\n <!-- Theme Icon -->\r\n <div class=\"tw-flex-shrink-0\">\r\n <cide-ele-icon \r\n class=\"tw-text-purple-600\" \r\n size=\"xs\">\r\n palette\r\n </cide-ele-icon>\r\n </div>\r\n \r\n <!-- Theme Details -->\r\n <div class=\"tw-ml-3 tw-min-w-0 tw-flex-1\">\r\n <div class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\" \r\n [title]=\"row.sytm_title\">\r\n {{ row.sytm_title || 'Untitled' }}\r\n </div>\r\n @if (row.sytm_desc) {\r\n <div class=\"tw-text-xs tw-text-gray-500 tw-truncate\" \r\n [title]=\"row.sytm_desc\">\r\n {{ row.sytm_desc }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Theme Status Renderer Template -->\r\n<ng-template #themeStatusRendererTemplate let-row=\"row\" let-value=\"value\">\r\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 tw-whitespace-nowrap\"\r\n [ngClass]=\"row.sytm_isactive ? 'tw-bg-green-100 tw-text-green-800' : 'tw-bg-red-100 tw-text-red-800'\">\r\n {{ row.sytm_isactive ? 'Active' : 'Inactive' }}\r\n </span>\r\n</ng-template>\r\n\r\n<!-- Actions Dropdown Renderer Template -->\r\n<ng-template #actionsDropdownRendererTemplate let-row=\"row\" let-value=\"value\">\r\n <cide-ele-dropdown \r\n [items]=\"getActionDropdownItems(row)\"\r\n [config]=\"{ triggerIcon: 'more_vert', triggerSize: 'sm' }\"\r\n (itemClick)=\"onDropdownItemClick($event, row)\">\r\n </cide-ele-dropdown>\r\n</ng-template> ", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i2.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "ngmodule", type: FormsModule }, { 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: 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"], 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: 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"] }] });
|
|
6227
6393
|
}
|
|
6228
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
6394
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PageThemeComponent, decorators: [{
|
|
6229
6395
|
type: Component,
|
|
6230
6396
|
args: [{ selector: 'cide-core-app-page-theme', standalone: true, imports: [
|
|
6231
6397
|
CommonModule,
|
|
@@ -6243,7 +6409,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
6243
6409
|
], template: "<!-- Page Theme Container -->\r\n<div class=\"tw-flex tw-h-full tw-w-full\">\r\n \r\n <!-- Left: Form and header (60%) -->\r\n <div class=\"tw-w-full lg:tw-w-3/5 tw-flex tw-flex-col tw-border-r tw-border-gray-200\">\r\n\r\n <!-- Header Section -->\r\n <div class=\"tw-px-6 tw-py-3 tw-border-b tw-border-gray-200 tw-bg-gray-50\">\r\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-3 sm:tw-space-y-0\">\r\n\r\n <!-- Title and Back Button -->\r\n <div class=\"tw-flex tw-items-center tw-space-x-4\">\r\n <button cideEleButton variant=\"ghost\" size=\"sm\" (click)=\"goBack()\" class=\"tw-text-gray-600 hover:tw-text-gray-900\">\r\n <cide-ele-icon class=\"tw-w-4 tw-h-4\">arrow_back</cide-ele-icon>\r\n </button>\r\n <div class=\"tw-flex tw-items-center tw-space-x-2\">\r\n <cide-ele-icon class=\"tw-text-blue-600 tw-w-5 tw-h-5\">palette</cide-ele-icon>\r\n <div>\r\n <h5 class=\"tw-text-base tw-font-medium tw-text-gray-900 tw-m-0\">Theme Management</h5>\r\n <p class=\"tw-text-sm tw-text-gray-500 tw-m-0\">Page: {{ pageTitle() }}</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Error Message -->\r\n @if (error()) {\r\n <div class=\"tw-mt-4 tw-p-4 tw-bg-red-50 tw-border tw-border-red-200 tw-rounded-md\">\r\n <div class=\"tw-flex tw-items-start\">\r\n <cide-ele-icon name=\"error\" class=\"tw-text-red-400 tw-w-5 tw-h-5 tw-mt-0.5 tw-flex-shrink-0\"></cide-ele-icon>\r\n <div class=\"tw-ml-3\">\r\n <h3 class=\"tw-text-sm tw-font-medium tw-text-red-800 tw-m-0\">Error</h3>\r\n <p class=\"tw-text-sm tw-text-red-700 tw-mt-1 tw-m-0\">{{ error() }}</p>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Quick Add/Edit Form Section -->\r\n <div class=\"tw-px-6 tw-py-4 tw-bg-white tw-overflow-auto\">\r\n <div class=\"tw-flex tw-items-center tw-justify-between tw-mb-3\">\r\n <div class=\"tw-flex tw-items-center tw-space-x-3\">\r\n <cide-ele-icon class=\"tw-text-blue-600 tw-w-5 tw-h-5\">{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\r\n <h6 class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-m-0\">{{ isEditMode() ? 'Edit Theme' : 'Quick Add Theme' }}</h6>\r\n </div>\r\n </div>\r\n\r\n <!-- Form (kept as-is) -->\r\n <form [formGroup]=\"themeForm\" (ngSubmit)=\"saveTheme()\" class=\"tw-space-y-4\">\r\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 lg:tw-grid-cols-3 tw-gap-4\">\r\n <!-- Theme Title -->\r\n <div class=\"tw-space-y-2\">\r\n <cide-ele-input id=\"sytm_title\" formControlName=\"sytm_title\" placeholder=\"Enter theme title\" label=\"Theme Title*\" size=\"sm\"></cide-ele-input>\r\n </div>\r\n <!-- Theme Code -->\r\n <div class=\"tw-space-y-2\">\r\n <cide-ele-input id=\"sytm_theme_code\" formControlName=\"sytm_theme_code\" placeholder=\"Enter theme code\" label=\"Theme Code*\" size=\"sm\"></cide-ele-input>\r\n </div>\r\n <!-- Status -->\r\n <div class=\"tw-space-y-2\">\r\n <cide-ele-input\r\n id=\"sytm_isactive_cb\"\r\n type=\"checkbox\"\r\n label=\"Active\"\r\n size=\"sm\"\r\n formControlName=\"sytm_isactive\">\r\n </cide-ele-input>\r\n </div>\r\n <!-- Sub Title -->\r\n <div class=\"tw-space-y-2\">\r\n <cide-ele-input id=\"sytm_sub_title\" formControlName=\"sytm_sub_title\" placeholder=\"Enter sub title\" label=\"Sub Title\" size=\"sm\"></cide-ele-input>\r\n </div>\r\n <!-- Preview ID -->\r\n <div class=\"tw-space-y-2\">\r\n <cide-ele-input id=\"sytm_preview_id_fm\" formControlName=\"sytm_preview_id_fm\" placeholder=\"Enter preview image ID\" label=\"Preview Image ID\" size=\"sm\"></cide-ele-input>\r\n </div>\r\n <!-- Description -->\r\n <div class=\"tw-space-y-2 md:tw-col-span-2\">\r\n <cide-ele-textarea id=\"sytm_desc\" formControlName=\"sytm_desc\" placeholder=\"Enter theme description\" rows=\"2\" label=\"Description\" size=\"sm\"></cide-ele-textarea>\r\n </div>\r\n <!-- Configuration JSON -->\r\n <div class=\"tw-space-y-2 md:tw-col-span-3\">\r\n <cide-ele-json-editor label=\"Configuration JSON\" formControlName=\"sytm_configuration\" [required]=\"true\" [config]=\"{\r\n showLineNumbers: true,\r\n autoFormat: true,\r\n validateOnChange: true,\r\n minHeight: 150,\r\n maxHeight: 300,\r\n placeholder: 'Enter theme configuration JSON...'\r\n }\" helperText=\"Enter valid JSON configuration for the theme\"></cide-ele-json-editor>\r\n </div>\r\n <!-- Layout Configuration + Selection: right-side checkbox list -->\r\n <div class=\"lg:tw-col-span-1 tw-space-y-2\">\r\n <div class=\"tw-text-sm tw-font-medium tw-text-gray-700\">Layout & Selection</div>\r\n <!-- Selected toggle -->\r\n <div class=\"tw-bg-white tw-border tw-border-gray-200 tw-rounded-md tw-px-3 tw-py-2\">\r\n <cide-ele-input\r\n id=\"sytm_isselected\"\r\n type=\"checkbox\"\r\n label=\"Selected (Default)\"\r\n size=\"sm\"\r\n formControlName=\"sytm_isselected\">\r\n </cide-ele-input>\r\n </div>\r\n <div formGroupName=\"sytm_layout\" class=\"tw-bg-white tw-border tw-border-gray-200 tw-rounded-md tw-divide-y tw-overflow-hidden\">\r\n <!-- Sidebar -->\r\n <div class=\"tw-px-3 tw-py-2\" formGroupName=\"sytm_layout_sidebar\">\r\n <cide-ele-input id=\"layout_sidebar_status\" type=\"checkbox\" label=\"Sidebar\" size=\"sm\" formControlName=\"status\"></cide-ele-input>\r\n </div>\r\n <!-- Header -->\r\n <div class=\"tw-px-3 tw-py-2\" formGroupName=\"sytm_layout_header\">\r\n <cide-ele-input id=\"layout_header_status\" type=\"checkbox\" label=\"Header\" size=\"sm\" formControlName=\"status\"></cide-ele-input>\r\n </div>\r\n <!-- Footer -->\r\n <div class=\"tw-px-3 tw-py-2\" formGroupName=\"sytm_layout_footer\">\r\n <cide-ele-input id=\"layout_footer_status\" type=\"checkbox\" label=\"Footer\" size=\"sm\" formControlName=\"status\"></cide-ele-input>\r\n </div>\r\n <!-- Breadcrumb -->\r\n <div class=\"tw-px-3 tw-py-2\" formGroupName=\"sytm_layout_breadcrumb\">\r\n <cide-ele-input id=\"layout_breadcrumb_status\" type=\"checkbox\" label=\"Breadcrumb\" size=\"sm\" formControlName=\"status\"></cide-ele-input>\r\n </div>\r\n <!-- Console -->\r\n <div class=\"tw-px-3 tw-py-2\" formGroupName=\"sytm_layout_console\">\r\n <cide-ele-input id=\"layout_console_status\" type=\"checkbox\" label=\"Console\" size=\"sm\" formControlName=\"status\"></cide-ele-input>\r\n </div>\r\n <!-- Request -->\r\n <div class=\"tw-px-3 tw-py-2\" formGroupName=\"sytm_layout_request\">\r\n <cide-ele-input id=\"layout_request_status\" type=\"checkbox\" label=\"Request\" size=\"sm\" formControlName=\"status\"></cide-ele-input>\r\n </div>\r\n </div>\r\n <p class=\"tw-text-xs tw-text-gray-500 tw-pt-1\">Toggle active sections. Only one theme can be selected as default. More options can be added here later.</p>\r\n </div>\r\n <!-- Drawer Configuration -->\r\n <div class=\"tw-space-y-2 md:tw-col-span-3\">\r\n <div class=\"tw-flex tw-items-center tw-justify-between\">\r\n <div class=\"tw-text-sm tw-font-medium tw-text-gray-700\">Drawers</div>\r\n <button cideEleButton type=\"button\" size=\"xs\" variant=\"outline\" (click)=\"addDrawer()\">\r\n Add Drawer\r\n </button>\r\n </div>\r\n\r\n <div formGroupName=\"sytm_layout\">\r\n <div class=\"tw-space-y-2\" formArrayName=\"sytm_layout_drawer\">\r\n <div *ngFor=\"let drawerGrp of drawerArray.controls; let i = index\" [formGroupName]=\"i\" class=\"tw-border tw-border-gray-200 tw-rounded-md tw-p-3 tw-flex tw-items-center tw-gap-3\">\r\n <cide-ele-input id=\"drawer_active_{{i}}\" type=\"checkbox\" label=\"Active\" size=\"sm\" formControlName=\"syth_status\"></cide-ele-input>\r\n <div class=\"tw-flex-1\">\r\n <cide-ele-select\r\n id=\"drawer_config_{{i}}\"\r\n label=\"Drawer For\"\r\n size=\"sm\"\r\n [options]=\"drawerConfigOptions\"\r\n formControlName=\"syth_config_syco_for\">\r\n </cide-ele-select>\r\n </div>\r\n <button cideEleButton type=\"button\" size=\"xs\" variant=\"ghost\" (click)=\"removeDrawer(i)\">\r\n <cide-ele-icon class=\"tw-w-4 tw-h-4\">delete</cide-ele-icon>\r\n </button>\r\n </div>\r\n <p class=\"tw-text-xs tw-text-gray-500\">Configure multiple drawers as needed.</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Form Actions -->\r\n <div class=\"tw-flex tw-flex-col tw-gap-2 tw-pt-4 tw-border-t tw-border-gray-200\">\r\n <div class=\"tw-flex tw-items-center tw-justify-end tw-space-x-3\">\r\n <button cideEleButton type=\"button\" variant=\"outline\" (click)=\"cancelForm()\" [disabled]=\"loading()\">Cancel</button>\r\n <button cideEleButton type=\"submit\" variant=\"primary\" leftIcon=\"add\" [disabled]=\"!themeForm.valid || loading()\" [loading]=\"loading()\">\r\n {{ isEditMode() ? 'Update Theme' : 'Create Theme' }}\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n\r\n <!-- Right: Theme gallery (40%) -->\r\n <div class=\"tw-hidden lg:tw-flex tw-w-2/5 tw-flex-col\">\r\n <!-- (Header consolidated above) -->\r\n\r\n <!-- Gallery list -->\r\n <div class=\"tw-flex-1 tw-overflow-auto tw-bg-gray-50\">\r\n <div class=\"tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-3 tw-p-4\">\r\n @for (theme of filteredThemes(); track theme._id) {\r\n <div class=\"tw-rounded-md tw-transition tw-cursor-pointer tw-relative\"\r\n [ngClass]=\"theme.sytm_isselected\r\n ? 'tw-border tw-border-blue-500 tw-ring-2 tw-ring-blue-200 tw-bg-blue-50/50'\r\n : 'tw-bg-white tw-border tw-border-gray-200 hover:tw-shadow-sm'\"\r\n (click)=\"editTheme(theme)\"\r\n role=\"button\"\r\n tabindex=\"0\"\r\n [attr.aria-selected]=\"theme.sytm_isselected ? 'true' : 'false'\"\r\n [attr.aria-label]=\"'Edit theme ' + (theme.sytm_title || theme.sytm_theme_code)\"\r\n (keydown.enter)=\"editTheme(theme)\"\r\n (keydown.space)=\"$event.preventDefault(); editTheme(theme)\">\r\n\r\n <!-- Selected badge -->\r\n <div *ngIf=\"theme.sytm_isselected\"\r\n class=\"tw-absolute tw-top-2 tw-right-2 tw-flex tw-items-center tw-justify-center tw-w-6 tw-h-6 tw-rounded-full tw-bg-blue-600 tw-text-white\">\r\n <cide-ele-icon class=\"tw-w-4 tw-h-4\">check</cide-ele-icon>\r\n </div>\r\n \r\n <div class=\"tw-aspect-[16/9] tw-bg-gray-100 tw-rounded-t-md tw-overflow-hidden tw-flex tw-items-center tw-justify-center\">\r\n @if (getPreviewUrl(theme)) {\r\n <img [src]=\"getPreviewUrl(theme)\" class=\"tw-w-full tw-h-full tw-object-cover\" alt=\"Preview\" />\r\n } @else {\r\n <div class=\"tw-text-gray-400 tw-text-xs\">No preview</div>\r\n }\r\n </div>\r\n <div class=\"tw-p-3 tw-space-y-1\">\r\n <div class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\" [title]=\"theme.sytm_title\">{{ theme.sytm_title || 'Untitled Theme' }}</div>\r\n <div class=\"tw-text-xs tw-text-gray-500 tw-truncate\" [title]=\"theme.sytm_theme_code\">{{ theme.sytm_theme_code }}</div>\r\n <div class=\"tw-flex tw-items-center tw-justify-between tw-pt-1\">\r\n <span class=\"tw-inline-flex tw-items-center tw-gap-1 tw-text-xs\" [ngClass]=\"theme.sytm_isactive ? 'tw-text-green-700' : 'tw-text-red-700'\">\r\n <span class=\"tw-w-1.5 tw-h-1.5 tw-rounded-full\" [ngClass]=\"theme.sytm_isactive ? 'tw-bg-green-500' : 'tw-bg-red-500'\"></span>\r\n {{ theme.sytm_isactive ? 'Active' : 'Inactive' }}\r\n </span>\r\n <div class=\"tw-flex tw-items-center tw-gap-1\">\r\n <!-- Set Selected Button - Clear and Simple -->\r\n @if (theme.sytm_isselected) {\r\n <span class=\"tw-inline-flex tw-items-center tw-gap-1 tw-px-2 tw-py-1 tw-bg-green-100 tw-text-green-800 tw-rounded-md tw-text-xs tw-font-medium\">\r\n <cide-ele-icon class=\"tw-w-3 tw-h-3\">check</cide-ele-icon>\r\n Selected\r\n </span>\r\n } @else {\r\n <button cideEleButton \r\n variant=\"outline\" \r\n size=\"xs\"\r\n (click)=\"$event.stopPropagation(); setSelectedTheme(theme)\"\r\n [attr.aria-label]=\"'Select ' + (theme.sytm_title || theme.sytm_theme_code) + ' theme'\"\r\n class=\"tw-text-xs\">\r\n Select\r\n </button>\r\n }\r\n <button cideEleButton variant=\"ghost\" size=\"xs\" (click)=\"$event.stopPropagation(); editTheme(theme)\"\r\n [attr.aria-label]=\"'Edit theme ' + (theme.sytm_title || theme.sytm_theme_code)\">\r\n <cide-ele-icon class=\"tw-w-4 tw-h-4\">edit</cide-ele-icon>\r\n </button>\r\n <button cideEleButton variant=\"ghost\" size=\"xs\" (click)=\"$event.stopPropagation(); deleteTheme(theme)\"\r\n [attr.aria-label]=\"'Delete theme ' + (theme.sytm_title || theme.sytm_theme_code)\">\r\n <cide-ele-icon class=\"tw-w-4 tw-h-4\">delete</cide-ele-icon>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n\r\n @if (!loading() && filteredThemes().length === 0) {\r\n <div class=\"tw-col-span-full tw-text-center tw-text-xs tw-text-gray-500 tw-py-8\">No themes found</div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- \r\n Angular Template References for Grid Renderers (Best Practice)\r\n \r\n These ng-template elements represent the Angular best practice for custom rendering.\r\n They provide:\r\n - Type safety with template context\r\n - Component lifecycle integration\r\n - Change detection optimization\r\n - Proper event handling\r\n - Accessibility features\r\n \r\n Note: Current data grid uses string renderers for compatibility.\r\n Templates are maintained for future component enhancement.\r\n-->\r\n\r\n<!-- Theme Details Renderer Template -->\r\n<ng-template #themeDetailsRendererTemplate let-row=\"row\" let-value=\"value\">\r\n <div class=\"tw-flex tw-items-center tw-min-w-0\">\r\n <!-- Theme Icon -->\r\n <div class=\"tw-flex-shrink-0\">\r\n <cide-ele-icon \r\n class=\"tw-text-purple-600\" \r\n size=\"xs\">\r\n palette\r\n </cide-ele-icon>\r\n </div>\r\n \r\n <!-- Theme Details -->\r\n <div class=\"tw-ml-3 tw-min-w-0 tw-flex-1\">\r\n <div class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\" \r\n [title]=\"row.sytm_title\">\r\n {{ row.sytm_title || 'Untitled' }}\r\n </div>\r\n @if (row.sytm_desc) {\r\n <div class=\"tw-text-xs tw-text-gray-500 tw-truncate\" \r\n [title]=\"row.sytm_desc\">\r\n {{ row.sytm_desc }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Theme Status Renderer Template -->\r\n<ng-template #themeStatusRendererTemplate let-row=\"row\" let-value=\"value\">\r\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 tw-whitespace-nowrap\"\r\n [ngClass]=\"row.sytm_isactive ? 'tw-bg-green-100 tw-text-green-800' : 'tw-bg-red-100 tw-text-red-800'\">\r\n {{ row.sytm_isactive ? 'Active' : 'Inactive' }}\r\n </span>\r\n</ng-template>\r\n\r\n<!-- Actions Dropdown Renderer Template -->\r\n<ng-template #actionsDropdownRendererTemplate let-row=\"row\" let-value=\"value\">\r\n <cide-ele-dropdown \r\n [items]=\"getActionDropdownItems(row)\"\r\n [config]=\"{ triggerIcon: 'more_vert', triggerSize: 'sm' }\"\r\n (itemClick)=\"onDropdownItemClick($event, row)\">\r\n </cide-ele-dropdown>\r\n</ng-template> " }]
|
|
6244
6410
|
}] });
|
|
6245
6411
|
|
|
6412
|
+
var pageTheme_component = /*#__PURE__*/Object.freeze({
|
|
6413
|
+
__proto__: null,
|
|
6414
|
+
PageThemeComponent: PageThemeComponent
|
|
6415
|
+
});
|
|
6416
|
+
|
|
6246
6417
|
class PageControlsService {
|
|
6418
|
+
http;
|
|
6247
6419
|
constructor(http) {
|
|
6248
6420
|
this.http = http;
|
|
6249
6421
|
console.log('PageControlsService initialized - using real API');
|
|
@@ -6363,10 +6535,10 @@ class PageControlsService {
|
|
|
6363
6535
|
console.error('Page Controls Service Error:', errorMessage);
|
|
6364
6536
|
return throwError(() => new Error(errorMessage));
|
|
6365
6537
|
}
|
|
6366
|
-
static
|
|
6367
|
-
static
|
|
6538
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PageControlsService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6539
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PageControlsService, providedIn: 'root' });
|
|
6368
6540
|
}
|
|
6369
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
6541
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PageControlsService, decorators: [{
|
|
6370
6542
|
type: Injectable,
|
|
6371
6543
|
args: [{
|
|
6372
6544
|
providedIn: 'root'
|
|
@@ -6374,64 +6546,62 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
6374
6546
|
}], ctorParameters: () => [{ type: i1.HttpClient }] });
|
|
6375
6547
|
|
|
6376
6548
|
class PageControlsComponent {
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
this.isFormDirty = computed(() => this.controlForm.dirty);
|
|
6434
|
-
}
|
|
6549
|
+
// Dependency injection
|
|
6550
|
+
destroyRef = inject(DestroyRef);
|
|
6551
|
+
controlsService = inject(PageControlsService);
|
|
6552
|
+
appState = inject(AppStateHelperService);
|
|
6553
|
+
fb = inject(NonNullableFormBuilder);
|
|
6554
|
+
router = inject(Router);
|
|
6555
|
+
route = inject(ActivatedRoute);
|
|
6556
|
+
// Make Math available in template
|
|
6557
|
+
Math = Math;
|
|
6558
|
+
// Signals for reactive state management
|
|
6559
|
+
controls = signal([], ...(ngDevMode ? [{ debugName: "controls" }] : []));
|
|
6560
|
+
loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
6561
|
+
error = signal(null, ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
6562
|
+
selectedItems = signal([], ...(ngDevMode ? [{ debugName: "selectedItems" }] : []));
|
|
6563
|
+
searchTerm = signal('', ...(ngDevMode ? [{ debugName: "searchTerm" }] : []));
|
|
6564
|
+
// Page information
|
|
6565
|
+
pageId = signal('', ...(ngDevMode ? [{ debugName: "pageId" }] : []));
|
|
6566
|
+
pageTitle = signal('', ...(ngDevMode ? [{ debugName: "pageTitle" }] : []));
|
|
6567
|
+
// Form state
|
|
6568
|
+
isEditMode = signal(false, ...(ngDevMode ? [{ debugName: "isEditMode" }] : []));
|
|
6569
|
+
editingControlId = signal(null, ...(ngDevMode ? [{ debugName: "editingControlId" }] : []));
|
|
6570
|
+
retrievedControl = signal(null, ...(ngDevMode ? [{ debugName: "retrievedControl" }] : []));
|
|
6571
|
+
// Control selection for new layout
|
|
6572
|
+
selectedControlId = signal(null, ...(ngDevMode ? [{ debugName: "selectedControlId" }] : []));
|
|
6573
|
+
// Pagination signals
|
|
6574
|
+
currentPage = signal(1, ...(ngDevMode ? [{ debugName: "currentPage" }] : []));
|
|
6575
|
+
pageSize = signal(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
|
|
6576
|
+
totalItems = signal(0, ...(ngDevMode ? [{ debugName: "totalItems" }] : []));
|
|
6577
|
+
// Modern reactive forms with signals - No validators for simplicity
|
|
6578
|
+
controlForm = this.fb.group({
|
|
6579
|
+
sype_key: [''],
|
|
6580
|
+
sype_label: [''],
|
|
6581
|
+
sype_label_hide: [false],
|
|
6582
|
+
sype_auto_complete: [false], // Changed to boolean for checkbox
|
|
6583
|
+
sype_hide_helper_and_error_text: [false],
|
|
6584
|
+
sype_type: [''], // controlType
|
|
6585
|
+
sype_option_key: [''],
|
|
6586
|
+
sype_placeholder: [''],
|
|
6587
|
+
sype_min_length: [0],
|
|
6588
|
+
sype_max_length: [20],
|
|
6589
|
+
sype_regex: [''],
|
|
6590
|
+
sype_required: [false],
|
|
6591
|
+
sype_disabled: [false],
|
|
6592
|
+
sype_width: [''], // Changed to string for px values like "20px"
|
|
6593
|
+
sype_height: [''], // Changed to string for px values like "20px"
|
|
6594
|
+
sype_label_placement: ['left'],
|
|
6595
|
+
sype_helper_text_collapse: [false],
|
|
6596
|
+
sype_default: [''],
|
|
6597
|
+
sype_tooltip: [''],
|
|
6598
|
+
sype_size: ['sm'], // Changed default to small
|
|
6599
|
+
sype_leading_icon: [''],
|
|
6600
|
+
sype_isactive: [true],
|
|
6601
|
+
sype_entity_id_syen: ['']
|
|
6602
|
+
});
|
|
6603
|
+
// Computed values
|
|
6604
|
+
isFormDirty = computed(() => this.controlForm.dirty, ...(ngDevMode ? [{ debugName: "isFormDirty" }] : []));
|
|
6435
6605
|
ngOnInit() {
|
|
6436
6606
|
this.initializeComponent();
|
|
6437
6607
|
}
|
|
@@ -6827,10 +6997,10 @@ class PageControlsComponent {
|
|
|
6827
6997
|
trackByControlId(index, control) {
|
|
6828
6998
|
return control._id || '';
|
|
6829
6999
|
}
|
|
6830
|
-
static
|
|
6831
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: PageControlsComponent, isStandalone: true, selector: "cide-core-app-page-controls", ngImport: i0, template: "<!-- Page Controls Container -->\n<div class=\"page-controls-container\">\n <!-- Header Section -->\n <div class=\"header\">\n <div class=\"header-content\">\n <div class=\"header-left\">\n <button \n cideEleButton\n variant=\"ghost\"\n size=\"sm\"\n (click)=\"goBack()\"\n class=\"back-button\">\n <cide-ele-icon>arrow_back</cide-ele-icon>\n </button>\n <div class=\"title-section\">\n <cide-ele-icon class=\"title-icon\">settings</cide-ele-icon>\n <div>\n <h1 class=\"title\">Control Management</h1>\n <p class=\"subtitle\">Page: {{ pageTitle() }}</p>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <!-- Error Message -->\n <div class=\"error-message\" *ngIf=\"error()\">\n <cide-ele-icon>error</cide-ele-icon>\n <div>\n <h3>Error</h3>\n <p>{{ error() }}</p>\n </div>\n </div>\n\n <!-- Main Content Area -->\n <div class=\"main-content\">\n <!-- Form Section -->\n <div class=\"form-section\">\n <div class=\"form-header\">\n <cide-ele-icon>{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n <h3>{{ isEditMode() ? 'Edit Control' : 'Quick Add Control' }}</h3>\n </div>\n\n <!-- Form -->\n <form [formGroup]=\"controlForm\" (ngSubmit)=\"saveControl()\" class=\"control-form tw-overflow-y-auto\">\n <div class=\"form-grid\">\n \n <!-- Basic Information Section -->\n <!-- Control Key -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_key\"\n formControlName=\"sype_key\"\n placeholder=\"Enter control key\"\n label=\"Control Key\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Control Label -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_label\"\n formControlName=\"sype_label\"\n placeholder=\"Enter control label\"\n label=\"Control Label\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Control Type -->\n <div class=\"form-group\">\n <cide-ele-select\n id=\"sype_type\"\n formControlName=\"sype_type\"\n [options]=\"[\n { value: 'text', label: 'Text Input' },\n { value: 'textarea', label: 'Text Area' },\n { value: 'select', label: 'Select' },\n { value: 'checkbox', label: 'Checkbox' },\n { value: 'radio', label: 'Radio' },\n { value: 'date', label: 'Date' },\n { value: 'number', label: 'Number' },\n { value: 'email', label: 'Email' },\n { value: 'password', label: 'Password' },\n { value: 'file', label: 'File Upload' }\n ]\"\n label=\"Control Type\"\n size=\"sm\">\n </cide-ele-select>\n </div>\n\n <!-- Status - Checkbox aligned properly -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_isactive\"\n type=\"checkbox\"\n formControlName=\"sype_isactive\"\n label=\"Active Status\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Placeholder -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_placeholder\"\n formControlName=\"sype_placeholder\"\n placeholder=\"Enter placeholder text\"\n label=\"Placeholder\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Auto Complete - Checkbox aligned properly -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_auto_complete\"\n type=\"checkbox\"\n formControlName=\"sype_auto_complete\"\n label=\"Auto Complete\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Tooltip -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_tooltip\"\n formControlName=\"sype_tooltip\"\n placeholder=\"Enter tooltip text\"\n label=\"Tooltip\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Validation & Sizing Section -->\n <!-- Min/Max Length - Side by side -->\n <div class=\"form-group form-group-row\">\n <div class=\"form-group-half\">\n <cide-ele-input\n id=\"sype_min_length\"\n type=\"number\"\n formControlName=\"sype_min_length\"\n placeholder=\"0\"\n label=\"Min Length\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n <div class=\"form-group-half\">\n <cide-ele-input\n id=\"sype_max_length\"\n type=\"number\"\n formControlName=\"sype_max_length\"\n placeholder=\"20\"\n label=\"Max Length\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n </div>\n\n <!-- Size & Label Placement - Side by side -->\n <div class=\"form-group form-group-row\">\n <div class=\"form-group-half\">\n <cide-ele-select\n id=\"sype_size\"\n formControlName=\"sype_size\"\n label=\"Size\"\n size=\"xs\"\n [options]=\"[\n { value: 'xs', label: 'XS' },\n { value: 'sm', label: 'SM' },\n { value: 'md', label: 'MD' },\n { value: 'lg', label: 'LG' },\n { value: 'xl', label: 'XL' },\n { value: 'xxl', label: 'XXL' }\n ]\">\n </cide-ele-select>\n </div>\n <div class=\"form-group-half\">\n <cide-ele-select\n id=\"sype_label_placement\"\n formControlName=\"sype_label_placement\"\n label=\"Label Placement\"\n size=\"xs\"\n [options]=\"[\n { value: 'left', label: 'Left' },\n { value: 'floating', label: 'Floating' },\n { value: 'fixed', label: 'Fixed' }\n ]\">\n </cide-ele-select>\n </div>\n </div>\n\n <!-- Width & Height - Side by side -->\n <div class=\"form-group form-group-row\">\n <div class=\"form-group-half\">\n <cide-ele-input\n id=\"sype_width\"\n type=\"text\"\n formControlName=\"sype_width\"\n placeholder=\"20px\"\n label=\"Width\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n <div class=\"form-group-half\">\n <cide-ele-input\n id=\"sype_height\"\n type=\"text\"\n formControlName=\"sype_height\"\n placeholder=\"20px\"\n label=\"Height\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n </div>\n\n <!-- Leading Icon -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_leading_icon\"\n formControlName=\"sype_leading_icon\"\n placeholder=\"Enter icon name\"\n label=\"Leading Icon\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Default Value -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_default\"\n formControlName=\"sype_default\"\n placeholder=\"Enter default value\"\n label=\"Default Value\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Regex Pattern -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_regex\"\n formControlName=\"sype_regex\"\n placeholder=\"Enter regex pattern\"\n label=\"Regex Pattern\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Option Key -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_option_key\"\n formControlName=\"sype_option_key\"\n placeholder=\"Enter option key\"\n label=\"Option Key\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Entity ID (Auto-assigned from AppState) - Hidden -->\n <div class=\"form-group\" style=\"display: none;\">\n <cide-ele-input\n id=\"sype_entity_id_syen\"\n formControlName=\"sype_entity_id_syen\"\n placeholder=\"Auto-assigned from system\"\n label=\"Entity ID (Auto-assigned)\"\n size=\"sm\"\n readonly>\n </cide-ele-input>\n </div>\n\n <!-- Control Options -->\n <div class=\"form-group full-width\">\n <h6 class=\"options-title\">Control Options</h6>\n <div class=\"options-grid\">\n \n <!-- Required -->\n <div class=\"option-item\">\n <cide-ele-input\n id=\"sype_required\"\n type=\"checkbox\"\n formControlName=\"sype_required\"\n label=\"Required\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n\n <!-- Disabled -->\n <div class=\"option-item\">\n <cide-ele-input\n id=\"sype_disabled\"\n type=\"checkbox\"\n formControlName=\"sype_disabled\"\n label=\"Disabled\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n\n <!-- Hide Label -->\n <div class=\"option-item\">\n <cide-ele-input\n id=\"sype_label_hide\"\n type=\"checkbox\"\n formControlName=\"sype_label_hide\"\n label=\"Hide Label\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n\n <!-- Hide Helper Text -->\n <div class=\"option-item\">\n <cide-ele-input\n id=\"sype_hide_helper_and_error_text\"\n type=\"checkbox\"\n formControlName=\"sype_hide_helper_and_error_text\"\n label=\"Hide Helper Text\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n\n <!-- Helper Text Collapse -->\n <div class=\"option-item\">\n <cide-ele-input\n id=\"sype_helper_text_collapse\"\n type=\"checkbox\"\n formControlName=\"sype_helper_text_collapse\"\n label=\"Collapse Helper\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n\n </div>\n </div>\n\n </div>\n\n <!-- Form Actions -->\n <div class=\"form-actions\">\n <button \n cideEleButton\n type=\"button\"\n variant=\"outline\"\n (click)=\"cancelForm()\"\n [disabled]=\"loading()\">\n Cancel\n </button>\n <button \n cideEleButton\n type=\"submit\"\n variant=\"primary\"\n [disabled]=\"loading()\">\n {{ isEditMode() ? 'Update Control' : 'Create Control' }}\n </button>\n </div>\n </form>\n </div>\n\n <!-- Controls List Section -->\n <div class=\"controls-list-section\">\n <div class=\"controls-header\">\n <h3>Page Controls</h3>\n <p>Controls connected to this page</p>\n </div>\n \n <div class=\"controls-list\" *ngIf=\"!loading() && controls().length > 0\">\n <div \n class=\"control-item\" \n *ngFor=\"let control of controls(); trackBy: trackByControlId\"\n [class.selected]=\"selectedControlId() === control._id\"\n (click)=\"selectControl(control)\"\n (keyup.enter)=\"selectControl(control)\"\n (keyup.space)=\"selectControl(control)\"\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-label]=\"'Select control ' + (control.sype_label || control.sype_key)\">\n <div class=\"control-header\">\n <div class=\"control-icon\">\n <cide-ele-icon>settings_input_component</cide-ele-icon>\n </div>\n <div class=\"control-info\">\n <h4>{{ control.sype_label || control.sype_key }}</h4>\n <p>{{ control.sype_tooltip || 'No tooltip' }}</p>\n <div class=\"control-meta\">\n <span class=\"control-type\">{{ control.sype_type }}</span>\n <span class=\"control-status\" [class.active]=\"control.sype_isactive\">\n {{ control.sype_isactive ? 'Active' : 'Inactive' }}\n </span>\n </div>\n </div>\n <div class=\"control-actions\">\n <button \n cideEleButton\n variant=\"ghost\"\n size=\"sm\"\n (click)=\"editControl(control); $event.stopPropagation()\">\n <cide-ele-icon>edit</cide-ele-icon>\n </button>\n <button \n cideEleButton\n variant=\"ghost\"\n size=\"sm\"\n (click)=\"deleteControl(control); $event.stopPropagation()\">\n <cide-ele-icon>delete</cide-ele-icon>\n </button>\n </div>\n </div>\n \n \n </div>\n </div>\n\n <div class=\"controls-list-empty\" *ngIf=\"!loading() && controls().length === 0\">\n <cide-ele-icon>settings_input_component</cide-ele-icon>\n <p>No controls available</p>\n <small>Create controls using the form on the left</small>\n </div>\n\n <div class=\"controls-list-loading\" *ngIf=\"loading()\">\n <cide-ele-icon class=\"spinning\">refresh</cide-ele-icon>\n <p>Loading controls...</p>\n </div>\n </div>\n </div>\n</div>\n\n ", styles: [".page-controls-container{@apply tw-flex tw-flex-col tw-h-full tw-bg-gray-50;}.header{@apply tw-bg-white tw-border-b tw-border-gray-200 tw-px-6 tw-py-4;}.header-content{@apply tw-flex tw-items-center tw-justify-between;}.header-left{@apply tw-flex tw-items-center tw-space-x-4;}.back-button{@apply tw-flex tw-items-center tw-justify-center tw-w-8 tw-h-8 tw-text-gray-600 hover:tw-text-gray-900 hover:tw-bg-gray-100 tw-rounded-md tw-transition-colors;}.title-section{@apply tw-flex tw-items-center tw-space-x-3;}.title-icon{@apply tw-text-blue-600 tw-text-xl;}.title{@apply tw-text-xl tw-font-semibold tw-text-gray-900 tw-mb-0;}.subtitle{@apply tw-text-sm tw-text-gray-500 tw-mb-0;}.error-message{@apply tw-bg-red-50 tw-border tw-border-red-200 tw-rounded-md tw-p-4 tw-mx-6 tw-mt-4 tw-flex tw-items-start tw-space-x-3;}.error-message cide-ele-icon{@apply tw-text-red-500 tw-flex-shrink-0 tw-mt-0.5;}.error-message h3{@apply tw-text-red-800 tw-font-medium tw-mb-1;}.error-message p{@apply tw-text-red-700 tw-text-sm tw-mb-0;}.main-content{@apply tw-flex tw-flex-1 tw-gap-6 tw-p-6 tw-overflow-hidden;}.form-section{@apply tw-w-3/5 tw-bg-white tw-rounded-lg tw-border tw-border-gray-200 tw-shadow-sm tw-flex tw-flex-col;}.form-header{@apply tw-flex tw-items-center tw-space-x-3 tw-p-6 tw-border-b tw-border-gray-200;}.form-header cide-ele-icon{@apply tw-text-blue-600;}.form-header h3{@apply tw-text-lg tw-font-medium tw-text-gray-900 tw-mb-0;}.control-form{@apply tw-flex tw-flex-col tw-flex-1 tw-p-6;}.form-grid{@apply tw-grid tw-grid-cols-2 tw-gap-4 tw-mb-6;}.form-group{@apply tw-space-y-1;}.form-group.full-width{@apply tw-col-span-2;}.form-group.compact-number,.form-group.compact-select,.form-group.compact-dimension{@apply tw-max-w-32;}.form-group.compact-number{@apply tw-min-w-20;}.form-group.compact-dimension{@apply tw-min-w-24;}.form-group.compact-select{@apply tw-min-w-28;}.form-group.form-group-row{@apply tw-col-span-2 tw-flex tw-gap-4;}.form-group-half{@apply tw-flex-1 tw-space-y-1;}.checkbox-field{margin:.25rem 0}.checkbox-label{display:flex;flex-direction:column;gap:.25rem;cursor:pointer;padding:.75rem 0;background:transparent;border:none;border-radius:0;transition:all .2s ease}.checkbox-label:hover{background:#667eea05}.checkbox-label .checkbox-input{width:1rem;height:1rem;accent-color:#667eea;border-radius:3px;margin-bottom:.125rem}.checkbox-label .checkbox-text{font-weight:600;color:#374151;font-size:.875rem}.checkbox-label .checkbox-description{font-size:.75rem;color:#6b7280;margin-top:.125rem}.options-title{@apply tw-text-sm tw-font-medium tw-text-gray-900 tw-mb-3;}.options-grid{@apply tw-grid tw-grid-cols-3 tw-gap-3;}.option-item{@apply tw-flex tw-items-center tw-space-x-2;}.option-checkbox{@apply tw-rounded tw-border-gray-300 tw-text-blue-600 focus:tw-ring-blue-500 focus:tw-border-blue-500;}.option-item label{@apply tw-text-sm tw-text-gray-700 tw-cursor-pointer;}.form-actions{@apply tw-flex tw-justify-end tw-space-x-3 tw-pt-4 tw-border-t tw-border-gray-200 tw-mt-auto;}.controls-list-section{@apply tw-w-2/5 tw-bg-white tw-rounded-lg tw-border tw-border-gray-200 tw-shadow-sm tw-flex tw-flex-col;}.controls-header{@apply tw-p-6 tw-border-b tw-border-gray-200;}.controls-header h3{@apply tw-text-lg tw-font-medium tw-text-gray-900 tw-mb-1;}.controls-header p{@apply tw-text-sm tw-text-gray-500 tw-mb-0;}.controls-list{@apply tw-flex-1 tw-overflow-y-auto tw-p-4;}.control-item{@apply tw-bg-gray-50 tw-border tw-border-gray-200 tw-rounded-lg tw-p-4 tw-mb-3 tw-cursor-pointer tw-transition-all tw-duration-200;}.control-item:hover{@apply tw-shadow-md tw-border-gray-300;}.control-item.selected{@apply tw-bg-blue-50 tw-border-blue-300 tw-shadow-md;}.control-item:focus{@apply tw-outline-none tw-ring-2 tw-ring-blue-500 tw-ring-offset-2;}.control-item:last-child{@apply tw-mb-0;}.control-header{@apply tw-flex tw-items-start tw-space-x-3;}.control-icon{@apply tw-flex-shrink-0 tw-w-10 tw-h-10 tw-bg-blue-100 tw-rounded-lg tw-flex tw-items-center tw-justify-center;}.control-icon cide-ele-icon{@apply tw-text-blue-600;}.control-info{@apply tw-flex-1 tw-min-w-0;}.control-info h4{@apply tw-text-sm tw-font-medium tw-text-gray-900 tw-mb-1 tw-truncate;}.control-info p{@apply tw-text-xs tw-text-gray-500 tw-mb-2 tw-truncate;}.control-meta{@apply tw-flex tw-items-center tw-space-x-2;}.control-type{@apply tw-inline-flex tw-items-center tw-px-2 tw-py-0.5 tw-rounded-full tw-text-xs tw-font-medium tw-bg-gray-100 tw-text-gray-800;}.control-status{@apply tw-inline-flex tw-items-center tw-px-2 tw-py-0.5 tw-rounded-full tw-text-xs tw-font-medium tw-bg-red-100 tw-text-red-800;}.control-status.active{@apply tw-bg-green-100 tw-text-green-800;}.control-actions{@apply tw-flex tw-items-center tw-space-x-1 tw-opacity-0 tw-transition-opacity tw-duration-200;}.control-item:hover .control-actions,.control-item.selected .control-actions{@apply tw-opacity-100;}.controls-list-empty{@apply tw-flex tw-flex-col tw-items-center tw-justify-center tw-py-12 tw-text-center;}.controls-list-empty cide-ele-icon{@apply tw-text-4xl tw-text-gray-300 tw-mb-4;}.controls-list-empty p{@apply tw-text-gray-500 tw-font-medium tw-mb-1;}.controls-list-empty small{@apply tw-text-gray-400;}.controls-list-loading{@apply tw-flex tw-flex-col tw-items-center tw-justify-center tw-py-12 tw-text-center;}.controls-list-loading cide-ele-icon{@apply tw-text-2xl tw-text-blue-500 tw-mb-4;}.controls-list-loading p{@apply tw-text-gray-500;}.spinning{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (max-width: 1024px){.main-content{@apply tw-flex-col;}.form-section{@apply tw-w-full;}.controls-list-section{@apply tw-w-full tw-max-h-96;}.form-grid{@apply tw-grid-cols-1;}.options-grid{@apply tw-grid-cols-2;}}@media (max-width: 640px){.main-content{@apply tw-p-4 tw-gap-4;}.form-grid{@apply tw-gap-3;}.form-actions{@apply tw-flex-col tw-space-x-0 tw-space-y-2;}.options-grid{@apply tw-grid-cols-1;}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: FormsModule }, { 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: 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"], outputs: ["ngModelChange", "change", "searchChange"] }, { kind: "component", type: CideIconComponent, selector: "cide-ele-icon", inputs: ["size", "type", "toolTip"] }] }); }
|
|
7000
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PageControlsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7001
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.7", type: PageControlsComponent, isStandalone: true, selector: "cide-core-app-page-controls", ngImport: i0, template: "<!-- Page Controls Container -->\n<div class=\"page-controls-container\">\n <!-- Header Section -->\n <div class=\"header\">\n <div class=\"header-content\">\n <div class=\"header-left\">\n <button \n cideEleButton\n variant=\"ghost\"\n size=\"sm\"\n (click)=\"goBack()\"\n class=\"back-button\">\n <cide-ele-icon>arrow_back</cide-ele-icon>\n </button>\n <div class=\"title-section\">\n <cide-ele-icon class=\"title-icon\">settings</cide-ele-icon>\n <div>\n <h1 class=\"title\">Control Management</h1>\n <p class=\"subtitle\">Page: {{ pageTitle() }}</p>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <!-- Error Message -->\n <div class=\"error-message\" *ngIf=\"error()\">\n <cide-ele-icon>error</cide-ele-icon>\n <div>\n <h3>Error</h3>\n <p>{{ error() }}</p>\n </div>\n </div>\n\n <!-- Main Content Area -->\n <div class=\"main-content\">\n <!-- Form Section -->\n <div class=\"form-section\">\n <div class=\"form-header\">\n <cide-ele-icon>{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n <h3>{{ isEditMode() ? 'Edit Control' : 'Quick Add Control' }}</h3>\n </div>\n\n <!-- Form -->\n <form [formGroup]=\"controlForm\" (ngSubmit)=\"saveControl()\" class=\"control-form tw-overflow-y-auto\">\n <div class=\"form-grid\">\n \n <!-- Basic Information Section -->\n <!-- Control Key -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_key\"\n formControlName=\"sype_key\"\n placeholder=\"Enter control key\"\n label=\"Control Key\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Control Label -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_label\"\n formControlName=\"sype_label\"\n placeholder=\"Enter control label\"\n label=\"Control Label\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Control Type -->\n <div class=\"form-group\">\n <cide-ele-select\n id=\"sype_type\"\n formControlName=\"sype_type\"\n [options]=\"[\n { value: 'text', label: 'Text Input' },\n { value: 'textarea', label: 'Text Area' },\n { value: 'select', label: 'Select' },\n { value: 'checkbox', label: 'Checkbox' },\n { value: 'radio', label: 'Radio' },\n { value: 'date', label: 'Date' },\n { value: 'number', label: 'Number' },\n { value: 'email', label: 'Email' },\n { value: 'password', label: 'Password' },\n { value: 'file', label: 'File Upload' }\n ]\"\n label=\"Control Type\"\n size=\"sm\">\n </cide-ele-select>\n </div>\n\n <!-- Status - Checkbox aligned properly -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_isactive\"\n type=\"checkbox\"\n formControlName=\"sype_isactive\"\n label=\"Active Status\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Placeholder -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_placeholder\"\n formControlName=\"sype_placeholder\"\n placeholder=\"Enter placeholder text\"\n label=\"Placeholder\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Auto Complete - Checkbox aligned properly -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_auto_complete\"\n type=\"checkbox\"\n formControlName=\"sype_auto_complete\"\n label=\"Auto Complete\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Tooltip -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_tooltip\"\n formControlName=\"sype_tooltip\"\n placeholder=\"Enter tooltip text\"\n label=\"Tooltip\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Validation & Sizing Section -->\n <!-- Min/Max Length - Side by side -->\n <div class=\"form-group form-group-row\">\n <div class=\"form-group-half\">\n <cide-ele-input\n id=\"sype_min_length\"\n type=\"number\"\n formControlName=\"sype_min_length\"\n placeholder=\"0\"\n label=\"Min Length\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n <div class=\"form-group-half\">\n <cide-ele-input\n id=\"sype_max_length\"\n type=\"number\"\n formControlName=\"sype_max_length\"\n placeholder=\"20\"\n label=\"Max Length\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n </div>\n\n <!-- Size & Label Placement - Side by side -->\n <div class=\"form-group form-group-row\">\n <div class=\"form-group-half\">\n <cide-ele-select\n id=\"sype_size\"\n formControlName=\"sype_size\"\n label=\"Size\"\n size=\"xs\"\n [options]=\"[\n { value: 'xs', label: 'XS' },\n { value: 'sm', label: 'SM' },\n { value: 'md', label: 'MD' },\n { value: 'lg', label: 'LG' },\n { value: 'xl', label: 'XL' },\n { value: 'xxl', label: 'XXL' }\n ]\">\n </cide-ele-select>\n </div>\n <div class=\"form-group-half\">\n <cide-ele-select\n id=\"sype_label_placement\"\n formControlName=\"sype_label_placement\"\n label=\"Label Placement\"\n size=\"xs\"\n [options]=\"[\n { value: 'left', label: 'Left' },\n { value: 'floating', label: 'Floating' },\n { value: 'fixed', label: 'Fixed' }\n ]\">\n </cide-ele-select>\n </div>\n </div>\n\n <!-- Width & Height - Side by side -->\n <div class=\"form-group form-group-row\">\n <div class=\"form-group-half\">\n <cide-ele-input\n id=\"sype_width\"\n type=\"text\"\n formControlName=\"sype_width\"\n placeholder=\"20px\"\n label=\"Width\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n <div class=\"form-group-half\">\n <cide-ele-input\n id=\"sype_height\"\n type=\"text\"\n formControlName=\"sype_height\"\n placeholder=\"20px\"\n label=\"Height\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n </div>\n\n <!-- Leading Icon -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_leading_icon\"\n formControlName=\"sype_leading_icon\"\n placeholder=\"Enter icon name\"\n label=\"Leading Icon\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Default Value -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_default\"\n formControlName=\"sype_default\"\n placeholder=\"Enter default value\"\n label=\"Default Value\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Regex Pattern -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_regex\"\n formControlName=\"sype_regex\"\n placeholder=\"Enter regex pattern\"\n label=\"Regex Pattern\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Option Key -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_option_key\"\n formControlName=\"sype_option_key\"\n placeholder=\"Enter option key\"\n label=\"Option Key\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Entity ID (Auto-assigned from AppState) - Hidden -->\n <div class=\"form-group\" style=\"display: none;\">\n <cide-ele-input\n id=\"sype_entity_id_syen\"\n formControlName=\"sype_entity_id_syen\"\n placeholder=\"Auto-assigned from system\"\n label=\"Entity ID (Auto-assigned)\"\n size=\"sm\"\n readonly>\n </cide-ele-input>\n </div>\n\n <!-- Control Options -->\n <div class=\"form-group full-width\">\n <h6 class=\"options-title\">Control Options</h6>\n <div class=\"options-grid\">\n \n <!-- Required -->\n <div class=\"option-item\">\n <cide-ele-input\n id=\"sype_required\"\n type=\"checkbox\"\n formControlName=\"sype_required\"\n label=\"Required\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n\n <!-- Disabled -->\n <div class=\"option-item\">\n <cide-ele-input\n id=\"sype_disabled\"\n type=\"checkbox\"\n formControlName=\"sype_disabled\"\n label=\"Disabled\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n\n <!-- Hide Label -->\n <div class=\"option-item\">\n <cide-ele-input\n id=\"sype_label_hide\"\n type=\"checkbox\"\n formControlName=\"sype_label_hide\"\n label=\"Hide Label\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n\n <!-- Hide Helper Text -->\n <div class=\"option-item\">\n <cide-ele-input\n id=\"sype_hide_helper_and_error_text\"\n type=\"checkbox\"\n formControlName=\"sype_hide_helper_and_error_text\"\n label=\"Hide Helper Text\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n\n <!-- Helper Text Collapse -->\n <div class=\"option-item\">\n <cide-ele-input\n id=\"sype_helper_text_collapse\"\n type=\"checkbox\"\n formControlName=\"sype_helper_text_collapse\"\n label=\"Collapse Helper\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n\n </div>\n </div>\n\n </div>\n\n <!-- Form Actions -->\n <div class=\"form-actions\">\n <button \n cideEleButton\n type=\"button\"\n variant=\"outline\"\n (click)=\"cancelForm()\"\n [disabled]=\"loading()\">\n Cancel\n </button>\n <button \n cideEleButton\n type=\"submit\"\n variant=\"primary\"\n [disabled]=\"loading()\">\n {{ isEditMode() ? 'Update Control' : 'Create Control' }}\n </button>\n </div>\n </form>\n </div>\n\n <!-- Controls List Section -->\n <div class=\"controls-list-section\">\n <div class=\"controls-header\">\n <h3>Page Controls</h3>\n <p>Controls connected to this page</p>\n </div>\n \n <div class=\"controls-list\" *ngIf=\"!loading() && controls().length > 0\">\n <div \n class=\"control-item\" \n *ngFor=\"let control of controls(); trackBy: trackByControlId\"\n [class.selected]=\"selectedControlId() === control._id\"\n (click)=\"selectControl(control)\"\n (keyup.enter)=\"selectControl(control)\"\n (keyup.space)=\"selectControl(control)\"\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-label]=\"'Select control ' + (control.sype_label || control.sype_key)\">\n <div class=\"control-header\">\n <div class=\"control-icon\">\n <cide-ele-icon>settings_input_component</cide-ele-icon>\n </div>\n <div class=\"control-info\">\n <h4>{{ control.sype_label || control.sype_key }}</h4>\n <p>{{ control.sype_tooltip || 'No tooltip' }}</p>\n <div class=\"control-meta\">\n <span class=\"control-type\">{{ control.sype_type }}</span>\n <span class=\"control-status\" [class.active]=\"control.sype_isactive\">\n {{ control.sype_isactive ? 'Active' : 'Inactive' }}\n </span>\n </div>\n </div>\n <div class=\"control-actions\">\n <button \n cideEleButton\n variant=\"ghost\"\n size=\"sm\"\n (click)=\"editControl(control); $event.stopPropagation()\">\n <cide-ele-icon>edit</cide-ele-icon>\n </button>\n <button \n cideEleButton\n variant=\"ghost\"\n size=\"sm\"\n (click)=\"deleteControl(control); $event.stopPropagation()\">\n <cide-ele-icon>delete</cide-ele-icon>\n </button>\n </div>\n </div>\n \n \n </div>\n </div>\n\n <div class=\"controls-list-empty\" *ngIf=\"!loading() && controls().length === 0\">\n <cide-ele-icon>settings_input_component</cide-ele-icon>\n <p>No controls available</p>\n <small>Create controls using the form on the left</small>\n </div>\n\n <div class=\"controls-list-loading\" *ngIf=\"loading()\">\n <cide-ele-icon class=\"spinning\">refresh</cide-ele-icon>\n <p>Loading controls...</p>\n </div>\n </div>\n </div>\n</div>\n\n ", styles: [".page-controls-container{@apply tw-flex tw-flex-col tw-h-full tw-bg-gray-50;}.header{@apply tw-bg-white tw-border-b tw-border-gray-200 tw-px-6 tw-py-4;}.header-content{@apply tw-flex tw-items-center tw-justify-between;}.header-left{@apply tw-flex tw-items-center tw-space-x-4;}.back-button{@apply tw-flex tw-items-center tw-justify-center tw-w-8 tw-h-8 tw-text-gray-600 hover:tw-text-gray-900 hover:tw-bg-gray-100 tw-rounded-md tw-transition-colors;}.title-section{@apply tw-flex tw-items-center tw-space-x-3;}.title-icon{@apply tw-text-blue-600 tw-text-xl;}.title{@apply tw-text-xl tw-font-semibold tw-text-gray-900 tw-mb-0;}.subtitle{@apply tw-text-sm tw-text-gray-500 tw-mb-0;}.error-message{@apply tw-bg-red-50 tw-border tw-border-red-200 tw-rounded-md tw-p-4 tw-mx-6 tw-mt-4 tw-flex tw-items-start tw-space-x-3;}.error-message cide-ele-icon{@apply tw-text-red-500 tw-flex-shrink-0 tw-mt-0.5;}.error-message h3{@apply tw-text-red-800 tw-font-medium tw-mb-1;}.error-message p{@apply tw-text-red-700 tw-text-sm tw-mb-0;}.main-content{@apply tw-flex tw-flex-1 tw-gap-6 tw-p-6 tw-overflow-hidden;}.form-section{@apply tw-w-3/5 tw-bg-white tw-rounded-lg tw-border tw-border-gray-200 tw-shadow-sm tw-flex tw-flex-col;}.form-header{@apply tw-flex tw-items-center tw-space-x-3 tw-p-6 tw-border-b tw-border-gray-200;}.form-header cide-ele-icon{@apply tw-text-blue-600;}.form-header h3{@apply tw-text-lg tw-font-medium tw-text-gray-900 tw-mb-0;}.control-form{@apply tw-flex tw-flex-col tw-flex-1 tw-p-6;}.form-grid{@apply tw-grid tw-grid-cols-2 tw-gap-4 tw-mb-6;}.form-group{@apply tw-space-y-1;}.form-group.full-width{@apply tw-col-span-2;}.form-group.compact-number,.form-group.compact-select,.form-group.compact-dimension{@apply tw-max-w-32;}.form-group.compact-number{@apply tw-min-w-20;}.form-group.compact-dimension{@apply tw-min-w-24;}.form-group.compact-select{@apply tw-min-w-28;}.form-group.form-group-row{@apply tw-col-span-2 tw-flex tw-gap-4;}.form-group-half{@apply tw-flex-1 tw-space-y-1;}.checkbox-field{margin:.25rem 0}.checkbox-label{display:flex;flex-direction:column;gap:.25rem;cursor:pointer;padding:.75rem 0;background:transparent;border:none;border-radius:0;transition:all .2s ease}.checkbox-label:hover{background:#667eea05}.checkbox-label .checkbox-input{width:1rem;height:1rem;accent-color:#667eea;border-radius:3px;margin-bottom:.125rem}.checkbox-label .checkbox-text{font-weight:600;color:#374151;font-size:.875rem}.checkbox-label .checkbox-description{font-size:.75rem;color:#6b7280;margin-top:.125rem}.options-title{@apply tw-text-sm tw-font-medium tw-text-gray-900 tw-mb-3;}.options-grid{@apply tw-grid tw-grid-cols-3 tw-gap-3;}.option-item{@apply tw-flex tw-items-center tw-space-x-2;}.option-checkbox{@apply tw-rounded tw-border-gray-300 tw-text-blue-600 focus:tw-ring-blue-500 focus:tw-border-blue-500;}.option-item label{@apply tw-text-sm tw-text-gray-700 tw-cursor-pointer;}.form-actions{@apply tw-flex tw-justify-end tw-space-x-3 tw-pt-4 tw-border-t tw-border-gray-200 tw-mt-auto;}.controls-list-section{@apply tw-w-2/5 tw-bg-white tw-rounded-lg tw-border tw-border-gray-200 tw-shadow-sm tw-flex tw-flex-col;}.controls-header{@apply tw-p-6 tw-border-b tw-border-gray-200;}.controls-header h3{@apply tw-text-lg tw-font-medium tw-text-gray-900 tw-mb-1;}.controls-header p{@apply tw-text-sm tw-text-gray-500 tw-mb-0;}.controls-list{@apply tw-flex-1 tw-overflow-y-auto tw-p-4;}.control-item{@apply tw-bg-gray-50 tw-border tw-border-gray-200 tw-rounded-lg tw-p-4 tw-mb-3 tw-cursor-pointer tw-transition-all tw-duration-200;}.control-item:hover{@apply tw-shadow-md tw-border-gray-300;}.control-item.selected{@apply tw-bg-blue-50 tw-border-blue-300 tw-shadow-md;}.control-item:focus{@apply tw-outline-none tw-ring-2 tw-ring-blue-500 tw-ring-offset-2;}.control-item:last-child{@apply tw-mb-0;}.control-header{@apply tw-flex tw-items-start tw-space-x-3;}.control-icon{@apply tw-flex-shrink-0 tw-w-10 tw-h-10 tw-bg-blue-100 tw-rounded-lg tw-flex tw-items-center tw-justify-center;}.control-icon cide-ele-icon{@apply tw-text-blue-600;}.control-info{@apply tw-flex-1 tw-min-w-0;}.control-info h4{@apply tw-text-sm tw-font-medium tw-text-gray-900 tw-mb-1 tw-truncate;}.control-info p{@apply tw-text-xs tw-text-gray-500 tw-mb-2 tw-truncate;}.control-meta{@apply tw-flex tw-items-center tw-space-x-2;}.control-type{@apply tw-inline-flex tw-items-center tw-px-2 tw-py-0.5 tw-rounded-full tw-text-xs tw-font-medium tw-bg-gray-100 tw-text-gray-800;}.control-status{@apply tw-inline-flex tw-items-center tw-px-2 tw-py-0.5 tw-rounded-full tw-text-xs tw-font-medium tw-bg-red-100 tw-text-red-800;}.control-status.active{@apply tw-bg-green-100 tw-text-green-800;}.control-actions{@apply tw-flex tw-items-center tw-space-x-1 tw-opacity-0 tw-transition-opacity tw-duration-200;}.control-item:hover .control-actions,.control-item.selected .control-actions{@apply tw-opacity-100;}.controls-list-empty{@apply tw-flex tw-flex-col tw-items-center tw-justify-center tw-py-12 tw-text-center;}.controls-list-empty cide-ele-icon{@apply tw-text-4xl tw-text-gray-300 tw-mb-4;}.controls-list-empty p{@apply tw-text-gray-500 tw-font-medium tw-mb-1;}.controls-list-empty small{@apply tw-text-gray-400;}.controls-list-loading{@apply tw-flex tw-flex-col tw-items-center tw-justify-center tw-py-12 tw-text-center;}.controls-list-loading cide-ele-icon{@apply tw-text-2xl tw-text-blue-500 tw-mb-4;}.controls-list-loading p{@apply tw-text-gray-500;}.spinning{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (max-width: 1024px){.main-content{@apply tw-flex-col;}.form-section{@apply tw-w-full;}.controls-list-section{@apply tw-w-full tw-max-h-96;}.form-grid{@apply tw-grid-cols-1;}.options-grid{@apply tw-grid-cols-2;}}@media (max-width: 640px){.main-content{@apply tw-p-4 tw-gap-4;}.form-grid{@apply tw-gap-3;}.form-actions{@apply tw-flex-col tw-space-x-0 tw-space-y-2;}.options-grid{@apply tw-grid-cols-1;}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: FormsModule }, { 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: 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"], outputs: ["ngModelChange", "change", "searchChange"] }, { kind: "component", type: CideIconComponent, selector: "cide-ele-icon", inputs: ["size", "type", "toolTip"] }] });
|
|
6832
7002
|
}
|
|
6833
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
7003
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PageControlsComponent, decorators: [{
|
|
6834
7004
|
type: Component,
|
|
6835
7005
|
args: [{ selector: 'cide-core-app-page-controls', standalone: true, imports: [
|
|
6836
7006
|
CommonModule,
|
|
@@ -6844,6 +7014,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
6844
7014
|
], template: "<!-- Page Controls Container -->\n<div class=\"page-controls-container\">\n <!-- Header Section -->\n <div class=\"header\">\n <div class=\"header-content\">\n <div class=\"header-left\">\n <button \n cideEleButton\n variant=\"ghost\"\n size=\"sm\"\n (click)=\"goBack()\"\n class=\"back-button\">\n <cide-ele-icon>arrow_back</cide-ele-icon>\n </button>\n <div class=\"title-section\">\n <cide-ele-icon class=\"title-icon\">settings</cide-ele-icon>\n <div>\n <h1 class=\"title\">Control Management</h1>\n <p class=\"subtitle\">Page: {{ pageTitle() }}</p>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <!-- Error Message -->\n <div class=\"error-message\" *ngIf=\"error()\">\n <cide-ele-icon>error</cide-ele-icon>\n <div>\n <h3>Error</h3>\n <p>{{ error() }}</p>\n </div>\n </div>\n\n <!-- Main Content Area -->\n <div class=\"main-content\">\n <!-- Form Section -->\n <div class=\"form-section\">\n <div class=\"form-header\">\n <cide-ele-icon>{{ isEditMode() ? 'edit' : 'add' }}</cide-ele-icon>\n <h3>{{ isEditMode() ? 'Edit Control' : 'Quick Add Control' }}</h3>\n </div>\n\n <!-- Form -->\n <form [formGroup]=\"controlForm\" (ngSubmit)=\"saveControl()\" class=\"control-form tw-overflow-y-auto\">\n <div class=\"form-grid\">\n \n <!-- Basic Information Section -->\n <!-- Control Key -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_key\"\n formControlName=\"sype_key\"\n placeholder=\"Enter control key\"\n label=\"Control Key\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Control Label -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_label\"\n formControlName=\"sype_label\"\n placeholder=\"Enter control label\"\n label=\"Control Label\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Control Type -->\n <div class=\"form-group\">\n <cide-ele-select\n id=\"sype_type\"\n formControlName=\"sype_type\"\n [options]=\"[\n { value: 'text', label: 'Text Input' },\n { value: 'textarea', label: 'Text Area' },\n { value: 'select', label: 'Select' },\n { value: 'checkbox', label: 'Checkbox' },\n { value: 'radio', label: 'Radio' },\n { value: 'date', label: 'Date' },\n { value: 'number', label: 'Number' },\n { value: 'email', label: 'Email' },\n { value: 'password', label: 'Password' },\n { value: 'file', label: 'File Upload' }\n ]\"\n label=\"Control Type\"\n size=\"sm\">\n </cide-ele-select>\n </div>\n\n <!-- Status - Checkbox aligned properly -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_isactive\"\n type=\"checkbox\"\n formControlName=\"sype_isactive\"\n label=\"Active Status\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Placeholder -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_placeholder\"\n formControlName=\"sype_placeholder\"\n placeholder=\"Enter placeholder text\"\n label=\"Placeholder\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Auto Complete - Checkbox aligned properly -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_auto_complete\"\n type=\"checkbox\"\n formControlName=\"sype_auto_complete\"\n label=\"Auto Complete\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Tooltip -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_tooltip\"\n formControlName=\"sype_tooltip\"\n placeholder=\"Enter tooltip text\"\n label=\"Tooltip\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Validation & Sizing Section -->\n <!-- Min/Max Length - Side by side -->\n <div class=\"form-group form-group-row\">\n <div class=\"form-group-half\">\n <cide-ele-input\n id=\"sype_min_length\"\n type=\"number\"\n formControlName=\"sype_min_length\"\n placeholder=\"0\"\n label=\"Min Length\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n <div class=\"form-group-half\">\n <cide-ele-input\n id=\"sype_max_length\"\n type=\"number\"\n formControlName=\"sype_max_length\"\n placeholder=\"20\"\n label=\"Max Length\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n </div>\n\n <!-- Size & Label Placement - Side by side -->\n <div class=\"form-group form-group-row\">\n <div class=\"form-group-half\">\n <cide-ele-select\n id=\"sype_size\"\n formControlName=\"sype_size\"\n label=\"Size\"\n size=\"xs\"\n [options]=\"[\n { value: 'xs', label: 'XS' },\n { value: 'sm', label: 'SM' },\n { value: 'md', label: 'MD' },\n { value: 'lg', label: 'LG' },\n { value: 'xl', label: 'XL' },\n { value: 'xxl', label: 'XXL' }\n ]\">\n </cide-ele-select>\n </div>\n <div class=\"form-group-half\">\n <cide-ele-select\n id=\"sype_label_placement\"\n formControlName=\"sype_label_placement\"\n label=\"Label Placement\"\n size=\"xs\"\n [options]=\"[\n { value: 'left', label: 'Left' },\n { value: 'floating', label: 'Floating' },\n { value: 'fixed', label: 'Fixed' }\n ]\">\n </cide-ele-select>\n </div>\n </div>\n\n <!-- Width & Height - Side by side -->\n <div class=\"form-group form-group-row\">\n <div class=\"form-group-half\">\n <cide-ele-input\n id=\"sype_width\"\n type=\"text\"\n formControlName=\"sype_width\"\n placeholder=\"20px\"\n label=\"Width\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n <div class=\"form-group-half\">\n <cide-ele-input\n id=\"sype_height\"\n type=\"text\"\n formControlName=\"sype_height\"\n placeholder=\"20px\"\n label=\"Height\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n </div>\n\n <!-- Leading Icon -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_leading_icon\"\n formControlName=\"sype_leading_icon\"\n placeholder=\"Enter icon name\"\n label=\"Leading Icon\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Default Value -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_default\"\n formControlName=\"sype_default\"\n placeholder=\"Enter default value\"\n label=\"Default Value\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Regex Pattern -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_regex\"\n formControlName=\"sype_regex\"\n placeholder=\"Enter regex pattern\"\n label=\"Regex Pattern\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Option Key -->\n <div class=\"form-group\">\n <cide-ele-input\n id=\"sype_option_key\"\n formControlName=\"sype_option_key\"\n placeholder=\"Enter option key\"\n label=\"Option Key\"\n size=\"sm\">\n </cide-ele-input>\n </div>\n\n <!-- Entity ID (Auto-assigned from AppState) - Hidden -->\n <div class=\"form-group\" style=\"display: none;\">\n <cide-ele-input\n id=\"sype_entity_id_syen\"\n formControlName=\"sype_entity_id_syen\"\n placeholder=\"Auto-assigned from system\"\n label=\"Entity ID (Auto-assigned)\"\n size=\"sm\"\n readonly>\n </cide-ele-input>\n </div>\n\n <!-- Control Options -->\n <div class=\"form-group full-width\">\n <h6 class=\"options-title\">Control Options</h6>\n <div class=\"options-grid\">\n \n <!-- Required -->\n <div class=\"option-item\">\n <cide-ele-input\n id=\"sype_required\"\n type=\"checkbox\"\n formControlName=\"sype_required\"\n label=\"Required\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n\n <!-- Disabled -->\n <div class=\"option-item\">\n <cide-ele-input\n id=\"sype_disabled\"\n type=\"checkbox\"\n formControlName=\"sype_disabled\"\n label=\"Disabled\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n\n <!-- Hide Label -->\n <div class=\"option-item\">\n <cide-ele-input\n id=\"sype_label_hide\"\n type=\"checkbox\"\n formControlName=\"sype_label_hide\"\n label=\"Hide Label\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n\n <!-- Hide Helper Text -->\n <div class=\"option-item\">\n <cide-ele-input\n id=\"sype_hide_helper_and_error_text\"\n type=\"checkbox\"\n formControlName=\"sype_hide_helper_and_error_text\"\n label=\"Hide Helper Text\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n\n <!-- Helper Text Collapse -->\n <div class=\"option-item\">\n <cide-ele-input\n id=\"sype_helper_text_collapse\"\n type=\"checkbox\"\n formControlName=\"sype_helper_text_collapse\"\n label=\"Collapse Helper\"\n size=\"xs\">\n </cide-ele-input>\n </div>\n\n </div>\n </div>\n\n </div>\n\n <!-- Form Actions -->\n <div class=\"form-actions\">\n <button \n cideEleButton\n type=\"button\"\n variant=\"outline\"\n (click)=\"cancelForm()\"\n [disabled]=\"loading()\">\n Cancel\n </button>\n <button \n cideEleButton\n type=\"submit\"\n variant=\"primary\"\n [disabled]=\"loading()\">\n {{ isEditMode() ? 'Update Control' : 'Create Control' }}\n </button>\n </div>\n </form>\n </div>\n\n <!-- Controls List Section -->\n <div class=\"controls-list-section\">\n <div class=\"controls-header\">\n <h3>Page Controls</h3>\n <p>Controls connected to this page</p>\n </div>\n \n <div class=\"controls-list\" *ngIf=\"!loading() && controls().length > 0\">\n <div \n class=\"control-item\" \n *ngFor=\"let control of controls(); trackBy: trackByControlId\"\n [class.selected]=\"selectedControlId() === control._id\"\n (click)=\"selectControl(control)\"\n (keyup.enter)=\"selectControl(control)\"\n (keyup.space)=\"selectControl(control)\"\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-label]=\"'Select control ' + (control.sype_label || control.sype_key)\">\n <div class=\"control-header\">\n <div class=\"control-icon\">\n <cide-ele-icon>settings_input_component</cide-ele-icon>\n </div>\n <div class=\"control-info\">\n <h4>{{ control.sype_label || control.sype_key }}</h4>\n <p>{{ control.sype_tooltip || 'No tooltip' }}</p>\n <div class=\"control-meta\">\n <span class=\"control-type\">{{ control.sype_type }}</span>\n <span class=\"control-status\" [class.active]=\"control.sype_isactive\">\n {{ control.sype_isactive ? 'Active' : 'Inactive' }}\n </span>\n </div>\n </div>\n <div class=\"control-actions\">\n <button \n cideEleButton\n variant=\"ghost\"\n size=\"sm\"\n (click)=\"editControl(control); $event.stopPropagation()\">\n <cide-ele-icon>edit</cide-ele-icon>\n </button>\n <button \n cideEleButton\n variant=\"ghost\"\n size=\"sm\"\n (click)=\"deleteControl(control); $event.stopPropagation()\">\n <cide-ele-icon>delete</cide-ele-icon>\n </button>\n </div>\n </div>\n \n \n </div>\n </div>\n\n <div class=\"controls-list-empty\" *ngIf=\"!loading() && controls().length === 0\">\n <cide-ele-icon>settings_input_component</cide-ele-icon>\n <p>No controls available</p>\n <small>Create controls using the form on the left</small>\n </div>\n\n <div class=\"controls-list-loading\" *ngIf=\"loading()\">\n <cide-ele-icon class=\"spinning\">refresh</cide-ele-icon>\n <p>Loading controls...</p>\n </div>\n </div>\n </div>\n</div>\n\n ", styles: [".page-controls-container{@apply tw-flex tw-flex-col tw-h-full tw-bg-gray-50;}.header{@apply tw-bg-white tw-border-b tw-border-gray-200 tw-px-6 tw-py-4;}.header-content{@apply tw-flex tw-items-center tw-justify-between;}.header-left{@apply tw-flex tw-items-center tw-space-x-4;}.back-button{@apply tw-flex tw-items-center tw-justify-center tw-w-8 tw-h-8 tw-text-gray-600 hover:tw-text-gray-900 hover:tw-bg-gray-100 tw-rounded-md tw-transition-colors;}.title-section{@apply tw-flex tw-items-center tw-space-x-3;}.title-icon{@apply tw-text-blue-600 tw-text-xl;}.title{@apply tw-text-xl tw-font-semibold tw-text-gray-900 tw-mb-0;}.subtitle{@apply tw-text-sm tw-text-gray-500 tw-mb-0;}.error-message{@apply tw-bg-red-50 tw-border tw-border-red-200 tw-rounded-md tw-p-4 tw-mx-6 tw-mt-4 tw-flex tw-items-start tw-space-x-3;}.error-message cide-ele-icon{@apply tw-text-red-500 tw-flex-shrink-0 tw-mt-0.5;}.error-message h3{@apply tw-text-red-800 tw-font-medium tw-mb-1;}.error-message p{@apply tw-text-red-700 tw-text-sm tw-mb-0;}.main-content{@apply tw-flex tw-flex-1 tw-gap-6 tw-p-6 tw-overflow-hidden;}.form-section{@apply tw-w-3/5 tw-bg-white tw-rounded-lg tw-border tw-border-gray-200 tw-shadow-sm tw-flex tw-flex-col;}.form-header{@apply tw-flex tw-items-center tw-space-x-3 tw-p-6 tw-border-b tw-border-gray-200;}.form-header cide-ele-icon{@apply tw-text-blue-600;}.form-header h3{@apply tw-text-lg tw-font-medium tw-text-gray-900 tw-mb-0;}.control-form{@apply tw-flex tw-flex-col tw-flex-1 tw-p-6;}.form-grid{@apply tw-grid tw-grid-cols-2 tw-gap-4 tw-mb-6;}.form-group{@apply tw-space-y-1;}.form-group.full-width{@apply tw-col-span-2;}.form-group.compact-number,.form-group.compact-select,.form-group.compact-dimension{@apply tw-max-w-32;}.form-group.compact-number{@apply tw-min-w-20;}.form-group.compact-dimension{@apply tw-min-w-24;}.form-group.compact-select{@apply tw-min-w-28;}.form-group.form-group-row{@apply tw-col-span-2 tw-flex tw-gap-4;}.form-group-half{@apply tw-flex-1 tw-space-y-1;}.checkbox-field{margin:.25rem 0}.checkbox-label{display:flex;flex-direction:column;gap:.25rem;cursor:pointer;padding:.75rem 0;background:transparent;border:none;border-radius:0;transition:all .2s ease}.checkbox-label:hover{background:#667eea05}.checkbox-label .checkbox-input{width:1rem;height:1rem;accent-color:#667eea;border-radius:3px;margin-bottom:.125rem}.checkbox-label .checkbox-text{font-weight:600;color:#374151;font-size:.875rem}.checkbox-label .checkbox-description{font-size:.75rem;color:#6b7280;margin-top:.125rem}.options-title{@apply tw-text-sm tw-font-medium tw-text-gray-900 tw-mb-3;}.options-grid{@apply tw-grid tw-grid-cols-3 tw-gap-3;}.option-item{@apply tw-flex tw-items-center tw-space-x-2;}.option-checkbox{@apply tw-rounded tw-border-gray-300 tw-text-blue-600 focus:tw-ring-blue-500 focus:tw-border-blue-500;}.option-item label{@apply tw-text-sm tw-text-gray-700 tw-cursor-pointer;}.form-actions{@apply tw-flex tw-justify-end tw-space-x-3 tw-pt-4 tw-border-t tw-border-gray-200 tw-mt-auto;}.controls-list-section{@apply tw-w-2/5 tw-bg-white tw-rounded-lg tw-border tw-border-gray-200 tw-shadow-sm tw-flex tw-flex-col;}.controls-header{@apply tw-p-6 tw-border-b tw-border-gray-200;}.controls-header h3{@apply tw-text-lg tw-font-medium tw-text-gray-900 tw-mb-1;}.controls-header p{@apply tw-text-sm tw-text-gray-500 tw-mb-0;}.controls-list{@apply tw-flex-1 tw-overflow-y-auto tw-p-4;}.control-item{@apply tw-bg-gray-50 tw-border tw-border-gray-200 tw-rounded-lg tw-p-4 tw-mb-3 tw-cursor-pointer tw-transition-all tw-duration-200;}.control-item:hover{@apply tw-shadow-md tw-border-gray-300;}.control-item.selected{@apply tw-bg-blue-50 tw-border-blue-300 tw-shadow-md;}.control-item:focus{@apply tw-outline-none tw-ring-2 tw-ring-blue-500 tw-ring-offset-2;}.control-item:last-child{@apply tw-mb-0;}.control-header{@apply tw-flex tw-items-start tw-space-x-3;}.control-icon{@apply tw-flex-shrink-0 tw-w-10 tw-h-10 tw-bg-blue-100 tw-rounded-lg tw-flex tw-items-center tw-justify-center;}.control-icon cide-ele-icon{@apply tw-text-blue-600;}.control-info{@apply tw-flex-1 tw-min-w-0;}.control-info h4{@apply tw-text-sm tw-font-medium tw-text-gray-900 tw-mb-1 tw-truncate;}.control-info p{@apply tw-text-xs tw-text-gray-500 tw-mb-2 tw-truncate;}.control-meta{@apply tw-flex tw-items-center tw-space-x-2;}.control-type{@apply tw-inline-flex tw-items-center tw-px-2 tw-py-0.5 tw-rounded-full tw-text-xs tw-font-medium tw-bg-gray-100 tw-text-gray-800;}.control-status{@apply tw-inline-flex tw-items-center tw-px-2 tw-py-0.5 tw-rounded-full tw-text-xs tw-font-medium tw-bg-red-100 tw-text-red-800;}.control-status.active{@apply tw-bg-green-100 tw-text-green-800;}.control-actions{@apply tw-flex tw-items-center tw-space-x-1 tw-opacity-0 tw-transition-opacity tw-duration-200;}.control-item:hover .control-actions,.control-item.selected .control-actions{@apply tw-opacity-100;}.controls-list-empty{@apply tw-flex tw-flex-col tw-items-center tw-justify-center tw-py-12 tw-text-center;}.controls-list-empty cide-ele-icon{@apply tw-text-4xl tw-text-gray-300 tw-mb-4;}.controls-list-empty p{@apply tw-text-gray-500 tw-font-medium tw-mb-1;}.controls-list-empty small{@apply tw-text-gray-400;}.controls-list-loading{@apply tw-flex tw-flex-col tw-items-center tw-justify-center tw-py-12 tw-text-center;}.controls-list-loading cide-ele-icon{@apply tw-text-2xl tw-text-blue-500 tw-mb-4;}.controls-list-loading p{@apply tw-text-gray-500;}.spinning{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (max-width: 1024px){.main-content{@apply tw-flex-col;}.form-section{@apply tw-w-full;}.controls-list-section{@apply tw-w-full tw-max-h-96;}.form-grid{@apply tw-grid-cols-1;}.options-grid{@apply tw-grid-cols-2;}}@media (max-width: 640px){.main-content{@apply tw-p-4 tw-gap-4;}.form-grid{@apply tw-gap-3;}.form-actions{@apply tw-flex-col tw-space-x-0 tw-space-y-2;}.options-grid{@apply tw-grid-cols-1;}}\n"] }]
|
|
6845
7015
|
}] });
|
|
6846
7016
|
|
|
7017
|
+
var pageControls_component = /*#__PURE__*/Object.freeze({
|
|
7018
|
+
__proto__: null,
|
|
7019
|
+
PageControlsComponent: PageControlsComponent
|
|
7020
|
+
});
|
|
7021
|
+
|
|
6847
7022
|
// Page Management Components
|
|
6848
7023
|
// Page Management Interfaces - Now using model interfaces from cloud-ide-lms-model
|
|
6849
7024
|
|
|
@@ -6855,5 +7030,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
6855
7030
|
* Generated bundle index. Do not edit.
|
|
6856
7031
|
*/
|
|
6857
7032
|
|
|
6858
|
-
export { CloudIdeCoreComponent, CloudIdeCoreService, DepartmentListComponent, DepartmentManagementService, DesignationListComponent, DesignationManagementService, GradeLevelListComponent, GradeLevelManagementService, MENU_TYPES, MenuListComponent, MenuManagementService, PageControlsComponent, PageControlsService, PageListComponent, PageManagementService, PageThemeComponent, PageThemeService };
|
|
7033
|
+
export { CloudIdeCoreComponent, CloudIdeCoreService, DepartmentListComponent, DepartmentManagementService, DesignationListComponent, DesignationManagementService, GradeLevelListComponent, GradeLevelManagementService, MENU_TYPES, MenuListComponent, MenuManagementService, PageControlsComponent, PageControlsService, PageListComponent, PageManagementService, PageThemeComponent, PageThemeService, coreRoutes };
|
|
6859
7034
|
//# sourceMappingURL=cloud-ide-core.mjs.map
|