@memberjunction/ng-credentials 0.0.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/lib/credentials.module.d.ts +16 -0
  2. package/dist/lib/credentials.module.d.ts.map +1 -0
  3. package/dist/lib/credentials.module.js +76 -0
  4. package/dist/lib/credentials.module.js.map +1 -0
  5. package/dist/lib/dialogs/credential-dialog.component.d.ts +67 -0
  6. package/dist/lib/dialogs/credential-dialog.component.d.ts.map +1 -0
  7. package/dist/lib/dialogs/credential-dialog.component.js +185 -0
  8. package/dist/lib/dialogs/credential-dialog.component.js.map +1 -0
  9. package/dist/lib/panels/credential-category-edit-panel/credential-category-edit-panel.component.d.ts +43 -0
  10. package/dist/lib/panels/credential-category-edit-panel/credential-category-edit-panel.component.d.ts.map +1 -0
  11. package/dist/lib/panels/credential-category-edit-panel/credential-category-edit-panel.component.js +233 -0
  12. package/dist/lib/panels/credential-category-edit-panel/credential-category-edit-panel.component.js.map +1 -0
  13. package/dist/lib/panels/credential-edit-panel/credential-edit-panel.component.d.ts +95 -0
  14. package/dist/lib/panels/credential-edit-panel/credential-edit-panel.component.d.ts.map +1 -0
  15. package/dist/lib/panels/credential-edit-panel/credential-edit-panel.component.js +529 -0
  16. package/dist/lib/panels/credential-edit-panel/credential-edit-panel.component.js.map +1 -0
  17. package/dist/lib/panels/credential-type-edit-panel/credential-type-edit-panel.component.d.ts +55 -0
  18. package/dist/lib/panels/credential-type-edit-panel/credential-type-edit-panel.component.d.ts.map +1 -0
  19. package/dist/lib/panels/credential-type-edit-panel/credential-type-edit-panel.component.js +274 -0
  20. package/dist/lib/panels/credential-type-edit-panel/credential-type-edit-panel.component.js.map +1 -0
  21. package/dist/lib/services/credential-dialog.service.d.ts +89 -0
  22. package/dist/lib/services/credential-dialog.service.d.ts.map +1 -0
  23. package/dist/lib/services/credential-dialog.service.js +166 -0
  24. package/dist/lib/services/credential-dialog.service.js.map +1 -0
  25. package/dist/public-api.d.ts +15 -0
  26. package/dist/public-api.d.ts.map +1 -0
  27. package/dist/public-api.js +19 -0
  28. package/dist/public-api.js.map +1 -0
  29. package/package.json +43 -6
  30. package/README.md +0 -45
@@ -0,0 +1,233 @@
1
+ import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy } from '@angular/core';
2
+ import { Metadata, RunView } from '@memberjunction/core';
3
+ import { MJNotificationService } from '@memberjunction/ng-notifications';
4
+ import * as i0 from "@angular/core";
5
+ import * as i1 from "@angular/forms";
6
+ import * as i2 from "@memberjunction/ng-shared-generic";
7
+ export class CredentialCategoryEditPanelComponent {
8
+ cdr;
9
+ category = null;
10
+ isOpen = false;
11
+ close = new EventEmitter();
12
+ saved = new EventEmitter();
13
+ deleted = new EventEmitter();
14
+ isLoading = false;
15
+ isSaving = false;
16
+ isNew = false;
17
+ // All categories for parent selection
18
+ allCategories = [];
19
+ // Form fields
20
+ name = '';
21
+ description = '';
22
+ parentId = '';
23
+ iconClass = '';
24
+ // Icon suggestions
25
+ iconSuggestions = [
26
+ { icon: 'fa-solid fa-folder', label: 'Folder' },
27
+ { icon: 'fa-solid fa-lock', label: 'Lock' },
28
+ { icon: 'fa-solid fa-shield-halved', label: 'Shield' },
29
+ { icon: 'fa-solid fa-key', label: 'Key' },
30
+ { icon: 'fa-solid fa-cloud', label: 'Cloud' },
31
+ { icon: 'fa-solid fa-database', label: 'Database' },
32
+ { icon: 'fa-solid fa-brain', label: 'AI' },
33
+ { icon: 'fa-solid fa-envelope', label: 'Email' },
34
+ { icon: 'fa-solid fa-plug', label: 'Integration' },
35
+ { icon: 'fa-solid fa-server', label: 'Server' },
36
+ { icon: 'fa-solid fa-code', label: 'Code' },
37
+ { icon: 'fa-solid fa-globe', label: 'Web' }
38
+ ];
39
+ _metadata = new Metadata();
40
+ constructor(cdr) {
41
+ this.cdr = cdr;
42
+ }
43
+ ngOnInit() {
44
+ this.loadCategories();
45
+ }
46
+ get panelTitle() {
47
+ return this.isNew ? 'Create Category' : 'Edit Category';
48
+ }
49
+ get canSave() {
50
+ return this.name.trim().length > 0;
51
+ }
52
+ get availableParentCategories() {
53
+ // Exclude the current category and its descendants from parent options
54
+ if (!this.category || this.isNew) {
55
+ return this.allCategories;
56
+ }
57
+ const currentId = this.category.ID;
58
+ const descendantIds = this.getDescendantIds(currentId);
59
+ descendantIds.add(currentId);
60
+ return this.allCategories.filter(c => !descendantIds.has(c.ID));
61
+ }
62
+ getDescendantIds(categoryId) {
63
+ const descendants = new Set();
64
+ const findChildren = (parentId) => {
65
+ for (const cat of this.allCategories) {
66
+ if (cat.ParentID === parentId) {
67
+ descendants.add(cat.ID);
68
+ findChildren(cat.ID);
69
+ }
70
+ }
71
+ };
72
+ findChildren(categoryId);
73
+ return descendants;
74
+ }
75
+ async open(category, preselectedParentId) {
76
+ this.isLoading = true;
77
+ this.isOpen = true;
78
+ this.category = category;
79
+ this.isNew = !category || !category.ID;
80
+ this.cdr.markForCheck();
81
+ await this.loadCategories();
82
+ this.resetForm();
83
+ if (category && category.ID) {
84
+ this.populateFromCategory(category);
85
+ }
86
+ else if (preselectedParentId) {
87
+ this.parentId = preselectedParentId;
88
+ }
89
+ this.isLoading = false;
90
+ this.cdr.markForCheck();
91
+ }
92
+ async loadCategories() {
93
+ try {
94
+ const rv = new RunView();
95
+ const result = await rv.RunView({
96
+ EntityName: 'MJ: Credential Categories',
97
+ OrderBy: 'Name',
98
+ ResultType: 'entity_object'
99
+ });
100
+ if (result.Success) {
101
+ this.allCategories = result.Results;
102
+ }
103
+ }
104
+ catch (error) {
105
+ console.error('Error loading categories:', error);
106
+ }
107
+ this.cdr.markForCheck();
108
+ }
109
+ resetForm() {
110
+ this.name = '';
111
+ this.description = '';
112
+ this.parentId = '';
113
+ this.iconClass = '';
114
+ }
115
+ populateFromCategory(category) {
116
+ this.name = category.Name || '';
117
+ this.description = category.Description || '';
118
+ this.parentId = category.ParentID || '';
119
+ this.iconClass = category.IconClass || '';
120
+ }
121
+ selectIcon(icon) {
122
+ this.iconClass = icon;
123
+ this.cdr.markForCheck();
124
+ }
125
+ async save() {
126
+ if (!this.canSave) {
127
+ MJNotificationService.Instance.CreateSimpleNotification('Please enter a category name', 'warning', 3000);
128
+ return;
129
+ }
130
+ this.isSaving = true;
131
+ this.cdr.markForCheck();
132
+ try {
133
+ let entity;
134
+ if (this.isNew) {
135
+ entity = await this._metadata.GetEntityObject('MJ: Credential Categories');
136
+ }
137
+ else {
138
+ entity = this.category;
139
+ }
140
+ entity.Name = this.name.trim();
141
+ entity.Description = this.description.trim() || null;
142
+ entity.ParentID = this.parentId || null;
143
+ entity.IconClass = this.iconClass.trim() || null;
144
+ const success = await entity.Save();
145
+ if (success) {
146
+ const action = this.isNew ? 'created' : 'updated';
147
+ MJNotificationService.Instance.CreateSimpleNotification(`Category "${entity.Name}" ${action} successfully`, 'success', 3000);
148
+ this.saved.emit(entity);
149
+ this.closePanel();
150
+ }
151
+ else {
152
+ const errorMessage = entity.LatestResult?.Message || 'Unknown error';
153
+ console.error('Save failed:', errorMessage);
154
+ MJNotificationService.Instance.CreateSimpleNotification(`Failed to save category: ${errorMessage}`, 'error', 5000);
155
+ }
156
+ }
157
+ catch (error) {
158
+ console.error('Error saving category:', error);
159
+ MJNotificationService.Instance.CreateSimpleNotification('Error saving category', 'error', 3000);
160
+ }
161
+ finally {
162
+ this.isSaving = false;
163
+ this.cdr.markForCheck();
164
+ }
165
+ }
166
+ async deleteCategory() {
167
+ if (this.isNew || !this.category)
168
+ return;
169
+ const confirmed = confirm(`Are you sure you want to delete "${this.category.Name}"? This action cannot be undone.`);
170
+ if (!confirmed)
171
+ return;
172
+ this.isSaving = true;
173
+ this.cdr.markForCheck();
174
+ try {
175
+ const success = await this.category.Delete();
176
+ if (success) {
177
+ MJNotificationService.Instance.CreateSimpleNotification(`Category "${this.category.Name}" deleted successfully`, 'success', 3000);
178
+ this.deleted.emit(this.category.ID);
179
+ this.closePanel();
180
+ }
181
+ else {
182
+ const errorMessage = this.category.LatestResult?.Message || 'Unknown error';
183
+ MJNotificationService.Instance.CreateSimpleNotification(`Failed to delete category: ${errorMessage}`, 'error', 5000);
184
+ }
185
+ }
186
+ catch (error) {
187
+ console.error('Error deleting category:', error);
188
+ MJNotificationService.Instance.CreateSimpleNotification('Error deleting category', 'error', 3000);
189
+ }
190
+ finally {
191
+ this.isSaving = false;
192
+ this.cdr.markForCheck();
193
+ }
194
+ }
195
+ closePanel() {
196
+ this.isOpen = false;
197
+ this.category = null;
198
+ this.resetForm();
199
+ this.close.emit();
200
+ this.cdr.markForCheck();
201
+ }
202
+ onBackdropClick(event) {
203
+ if (event.target.classList.contains('panel-backdrop')) {
204
+ this.closePanel();
205
+ }
206
+ }
207
+ getParentPath(categoryId) {
208
+ const parts = [];
209
+ let current = this.allCategories.find(c => c.ID === categoryId);
210
+ while (current) {
211
+ parts.unshift(current.Name);
212
+ current = current.ParentID ? this.allCategories.find(c => c.ID === current.ParentID) : undefined;
213
+ }
214
+ return parts.join(' / ');
215
+ }
216
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: CredentialCategoryEditPanelComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
217
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: CredentialCategoryEditPanelComponent, isStandalone: false, selector: "mj-credential-category-edit-panel", inputs: { category: "category", isOpen: "isOpen" }, outputs: { close: "close", saved: "saved", deleted: "deleted" }, ngImport: i0, template: "@if (isOpen) {\n <div class=\"panel-backdrop\" (click)=\"onBackdropClick($event)\">\n <div class=\"edit-panel\" [class.open]=\"isOpen\">\n <!-- Panel Header -->\n <div class=\"panel-header\">\n <div class=\"header-content\">\n <div class=\"header-icon\" [style.backgroundColor]=\"'#6366f1' + '15'\" [style.color]=\"'#6366f1'\">\n <i [class]=\"iconClass || 'fa-solid fa-folder'\"></i>\n </div>\n <div class=\"header-text\">\n <h2>{{panelTitle}}</h2>\n @if (parentId) {\n <span class=\"header-subtitle\">\n Under: {{getParentPath(parentId)}}\n </span>\n }\n @if (!parentId) {\n <span class=\"header-subtitle\">Root category</span>\n }\n </div>\n </div>\n <button class=\"close-btn\" (click)=\"closePanel()\" [disabled]=\"isSaving\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n <!-- Panel Body -->\n <div class=\"panel-body\">\n @if (isLoading) {\n <mj-loading text=\"Loading...\"></mj-loading>\n }\n @if (!isLoading) {\n <form class=\"category-form\" (submit)=\"$event.preventDefault(); save()\">\n <!-- Basic Info Section -->\n <div class=\"form-section\">\n <h3 class=\"section-title\">\n <i class=\"fa-solid fa-info-circle\"></i>\n Basic Information\n </h3>\n <div class=\"form-group\">\n <label for=\"categoryName\" class=\"required\">Name</label>\n <input\n type=\"text\"\n id=\"categoryName\"\n name=\"categoryName\"\n [(ngModel)]=\"name\"\n placeholder=\"e.g., Production, Development, API Keys\"\n [disabled]=\"isSaving\"\n required\n />\n </div>\n <div class=\"form-group\">\n <label for=\"categoryParent\">Parent Category</label>\n <select\n id=\"categoryParent\"\n name=\"categoryParent\"\n [(ngModel)]=\"parentId\"\n [disabled]=\"isSaving\"\n >\n <option [ngValue]=\"''\">No parent (root category)</option>\n @for (cat of availableParentCategories; track cat) {\n <option [ngValue]=\"cat.ID\">\n {{getParentPath(cat.ID)}}\n </option>\n }\n </select>\n <span class=\"field-hint\">Select a parent to create a subcategory</span>\n </div>\n <div class=\"form-group\">\n <label for=\"categoryDescription\">Description</label>\n <textarea\n id=\"categoryDescription\"\n name=\"categoryDescription\"\n [(ngModel)]=\"description\"\n placeholder=\"Optional description of this category...\"\n rows=\"3\"\n [disabled]=\"isSaving\"\n ></textarea>\n </div>\n </div>\n <!-- Icon Section -->\n <div class=\"form-section\">\n <h3 class=\"section-title\">\n <i class=\"fa-solid fa-icons\"></i>\n Icon\n </h3>\n <div class=\"form-group\">\n <label for=\"categoryIcon\">Custom Icon Class</label>\n <input\n type=\"text\"\n id=\"categoryIcon\"\n name=\"categoryIcon\"\n [(ngModel)]=\"iconClass\"\n placeholder=\"e.g., fa-solid fa-folder\"\n [disabled]=\"isSaving\"\n />\n <span class=\"field-hint\">Font Awesome icon class</span>\n </div>\n <div class=\"icon-suggestions\">\n <p class=\"suggestions-label\">Quick pick:</p>\n <div class=\"icon-grid\">\n @for (suggestion of iconSuggestions; track suggestion) {\n <button\n type=\"button\"\n class=\"icon-btn\"\n [class.selected]=\"iconClass === suggestion.icon\"\n (click)=\"selectIcon(suggestion.icon)\"\n [disabled]=\"isSaving\"\n [title]=\"suggestion.label\"\n >\n <i [class]=\"suggestion.icon\"></i>\n </button>\n }\n </div>\n </div>\n @if (iconClass) {\n <div class=\"icon-preview\">\n <div class=\"preview-label\">Preview:</div>\n <div class=\"preview-icon\">\n <i [class]=\"iconClass\"></i>\n </div>\n </div>\n }\n </div>\n </form>\n }\n </div>\n <!-- Panel Footer -->\n <div class=\"panel-footer\">\n <div class=\"footer-left\">\n @if (!isNew) {\n <button\n class=\"btn-delete\"\n (click)=\"deleteCategory()\"\n [disabled]=\"isSaving\"\n >\n <i class=\"fa-solid fa-trash\"></i>\n <span>Delete</span>\n </button>\n }\n </div>\n <div class=\"footer-right\">\n <button\n class=\"btn-secondary\"\n (click)=\"closePanel()\"\n [disabled]=\"isSaving\"\n >\n Cancel\n </button>\n <button\n class=\"btn-primary\"\n (click)=\"save()\"\n [disabled]=\"isSaving || !canSave\"\n >\n @if (isSaving) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n }\n @if (!isSaving) {\n <i class=\"fa-solid fa-check\"></i>\n }\n <span>{{isNew ? 'Create' : 'Save'}}</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n}\n", styles: ["/* Panel Backdrop */\n.panel-backdrop {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n z-index: 1000;\n display: flex;\n justify-content: flex-end;\n animation: fadeIn 0.2s ease-out;\n}\n\n@keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n/* Slide-in Panel */\n.edit-panel {\n width: 100%;\n max-width: 500px;\n height: 100%;\n background: #ffffff;\n display: flex;\n flex-direction: column;\n box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);\n transform: translateX(100%);\n animation: slideIn 0.3s ease-out forwards;\n}\n\n@keyframes slideIn {\n from { transform: translateX(100%); }\n to { transform: translateX(0); }\n}\n\n/* Panel Header */\n.panel-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 20px 24px;\n border-bottom: 1px solid #e5e7eb;\n background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);\n}\n\n.header-content {\n display: flex;\n align-items: center;\n gap: 16px;\n}\n\n.header-icon {\n width: 48px;\n height: 48px;\n border-radius: 12px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 20px;\n flex-shrink: 0;\n}\n\n.header-text h2 {\n font-size: 18px;\n font-weight: 600;\n color: #1e293b;\n margin: 0 0 4px 0;\n}\n\n.header-subtitle {\n font-size: 13px;\n color: #64748b;\n}\n\n.close-btn {\n width: 36px;\n height: 36px;\n border: none;\n background: #f1f5f9;\n border-radius: 8px;\n cursor: pointer;\n color: #64748b;\n font-size: 16px;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.15s ease;\n}\n\n.close-btn:hover:not(:disabled) {\n background: #e2e8f0;\n color: #334155;\n}\n\n.close-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n/* Panel Body */\n.panel-body {\n flex: 1;\n overflow-y: auto;\n padding: 24px;\n scroll-behavior: smooth;\n -webkit-overflow-scrolling: touch;\n}\n\n/* Form Sections */\n.form-section {\n margin-bottom: 28px;\n}\n\n.form-section:last-child {\n margin-bottom: 0;\n}\n\n.section-title {\n display: flex;\n align-items: center;\n gap: 10px;\n font-size: 14px;\n font-weight: 600;\n color: #334155;\n margin: 0 0 16px 0;\n padding-bottom: 10px;\n border-bottom: 1px solid #f1f5f9;\n}\n\n.section-title i {\n color: #6366f1;\n font-size: 14px;\n}\n\n/* Form Groups */\n.form-group {\n margin-bottom: 18px;\n}\n\n.form-group:last-child {\n margin-bottom: 0;\n}\n\n.form-group label {\n display: block;\n font-size: 13px;\n font-weight: 500;\n color: #475569;\n margin-bottom: 6px;\n}\n\n.form-group label.required::after {\n content: '*';\n color: #ef4444;\n margin-left: 4px;\n}\n\n.form-group input[type=\"text\"],\n.form-group select,\n.form-group textarea {\n width: 100%;\n padding: 10px 14px;\n border: 1px solid #d1d5db;\n border-radius: 8px;\n font-size: 14px;\n color: #1e293b;\n background: #ffffff;\n transition: all 0.15s ease;\n box-sizing: border-box;\n}\n\n.form-group input:focus,\n.form-group select:focus,\n.form-group textarea:focus {\n outline: none;\n border-color: #6366f1;\n box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);\n}\n\n.form-group input:disabled,\n.form-group select:disabled,\n.form-group textarea:disabled {\n background: #f8fafc;\n color: #94a3b8;\n cursor: not-allowed;\n}\n\n.form-group textarea {\n resize: vertical;\n min-height: 80px;\n}\n\n.form-group select {\n cursor: pointer;\n}\n\n.field-hint {\n display: block;\n font-size: 12px;\n color: #94a3b8;\n margin-top: 5px;\n}\n\n/* Icon Suggestions */\n.icon-suggestions {\n margin-top: 16px;\n}\n\n.suggestions-label {\n font-size: 12px;\n font-weight: 500;\n color: #64748b;\n margin: 0 0 10px 0;\n}\n\n.icon-grid {\n display: grid;\n grid-template-columns: repeat(6, 1fr);\n gap: 8px;\n}\n\n.icon-btn {\n width: 100%;\n aspect-ratio: 1;\n border: 2px solid #e5e7eb;\n border-radius: 8px;\n background: #ffffff;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 16px;\n color: #64748b;\n transition: all 0.15s ease;\n}\n\n.icon-btn:hover:not(:disabled) {\n border-color: #6366f1;\n color: #6366f1;\n background: #f0f1ff;\n}\n\n.icon-btn.selected {\n border-color: #6366f1;\n background: #6366f1;\n color: #ffffff;\n}\n\n.icon-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n/* Icon Preview */\n.icon-preview {\n margin-top: 16px;\n display: flex;\n align-items: center;\n gap: 12px;\n}\n\n.preview-label {\n font-size: 12px;\n font-weight: 500;\n color: #64748b;\n}\n\n.preview-icon {\n width: 48px;\n height: 48px;\n border-radius: 12px;\n background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);\n display: flex;\n align-items: center;\n justify-content: center;\n color: white;\n font-size: 20px;\n box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);\n}\n\n/* Panel Footer */\n.panel-footer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 16px 24px;\n border-top: 1px solid #e5e7eb;\n background: #f8fafc;\n}\n\n.footer-left,\n.footer-right {\n display: flex;\n align-items: center;\n gap: 12px;\n}\n\n.btn-primary,\n.btn-secondary,\n.btn-delete {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 20px;\n border: none;\n border-radius: 8px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.15s ease;\n}\n\n.btn-primary {\n background: #6366f1;\n color: #ffffff;\n}\n\n.btn-primary:hover:not(:disabled) {\n background: #4f46e5;\n}\n\n.btn-primary:disabled {\n background: #c7d2fe;\n cursor: not-allowed;\n}\n\n.btn-secondary {\n background: #ffffff;\n color: #475569;\n border: 1px solid #d1d5db;\n}\n\n.btn-secondary:hover:not(:disabled) {\n background: #f1f5f9;\n border-color: #94a3b8;\n}\n\n.btn-secondary:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.btn-delete {\n background: transparent;\n color: #dc2626;\n padding: 10px 16px;\n}\n\n.btn-delete:hover:not(:disabled) {\n background: #fef2f2;\n}\n\n.btn-delete:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n/* Mobile Responsiveness */\n@media (max-width: 768px) {\n .edit-panel {\n max-width: 100%;\n }\n\n .panel-header {\n padding: 16px 20px;\n }\n\n .header-icon {\n width: 40px;\n height: 40px;\n font-size: 18px;\n }\n\n .header-text h2 {\n font-size: 16px;\n }\n\n .panel-body {\n padding: 20px;\n }\n\n .icon-grid {\n grid-template-columns: repeat(4, 1fr);\n }\n\n .panel-footer {\n padding: 14px 20px;\n flex-direction: column-reverse;\n gap: 12px;\n }\n\n .footer-left,\n .footer-right {\n width: 100%;\n }\n\n .footer-right {\n flex-direction: row;\n }\n\n .footer-right .btn-primary,\n .footer-right .btn-secondary {\n flex: 1;\n justify-content: center;\n }\n\n .btn-delete {\n width: 100%;\n justify-content: center;\n background: #fef2f2;\n }\n}\n\n@media (max-width: 480px) {\n .panel-header {\n padding: 14px 16px;\n }\n\n .header-content {\n gap: 12px;\n }\n\n .header-icon {\n width: 36px;\n height: 36px;\n font-size: 16px;\n border-radius: 10px;\n }\n\n .header-text h2 {\n font-size: 15px;\n }\n\n .header-subtitle {\n font-size: 12px;\n }\n\n .panel-body {\n padding: 16px;\n }\n\n .icon-grid {\n grid-template-columns: repeat(4, 1fr);\n gap: 6px;\n }\n\n .icon-btn {\n font-size: 14px;\n }\n\n .preview-icon {\n width: 40px;\n height: 40px;\n font-size: 18px;\n }\n\n .panel-footer {\n padding: 12px 16px;\n }\n\n .btn-primary,\n .btn-secondary {\n padding: 10px 16px;\n font-size: 13px;\n }\n}\n\n/* Custom scrollbar */\n.panel-body::-webkit-scrollbar {\n width: 6px;\n}\n\n.panel-body::-webkit-scrollbar-track {\n background: transparent;\n}\n\n.panel-body::-webkit-scrollbar-thumb {\n background: #d1d5db;\n border-radius: 3px;\n}\n\n.panel-body::-webkit-scrollbar-thumb:hover {\n background: #94a3b8;\n}\n\n/* Animations */\n@keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n}\n\n.fa-spin {\n animation: spin 1s linear infinite;\n}\n"], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i2.LoadingComponent, selector: "mj-loading", inputs: ["text", "showText", "animationDuration", "size", "textColor", "logoColor", "logoGradient", "animation"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
218
+ }
219
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: CredentialCategoryEditPanelComponent, decorators: [{
220
+ type: Component,
221
+ args: [{ standalone: false, selector: 'mj-credential-category-edit-panel', changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (isOpen) {\n <div class=\"panel-backdrop\" (click)=\"onBackdropClick($event)\">\n <div class=\"edit-panel\" [class.open]=\"isOpen\">\n <!-- Panel Header -->\n <div class=\"panel-header\">\n <div class=\"header-content\">\n <div class=\"header-icon\" [style.backgroundColor]=\"'#6366f1' + '15'\" [style.color]=\"'#6366f1'\">\n <i [class]=\"iconClass || 'fa-solid fa-folder'\"></i>\n </div>\n <div class=\"header-text\">\n <h2>{{panelTitle}}</h2>\n @if (parentId) {\n <span class=\"header-subtitle\">\n Under: {{getParentPath(parentId)}}\n </span>\n }\n @if (!parentId) {\n <span class=\"header-subtitle\">Root category</span>\n }\n </div>\n </div>\n <button class=\"close-btn\" (click)=\"closePanel()\" [disabled]=\"isSaving\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n <!-- Panel Body -->\n <div class=\"panel-body\">\n @if (isLoading) {\n <mj-loading text=\"Loading...\"></mj-loading>\n }\n @if (!isLoading) {\n <form class=\"category-form\" (submit)=\"$event.preventDefault(); save()\">\n <!-- Basic Info Section -->\n <div class=\"form-section\">\n <h3 class=\"section-title\">\n <i class=\"fa-solid fa-info-circle\"></i>\n Basic Information\n </h3>\n <div class=\"form-group\">\n <label for=\"categoryName\" class=\"required\">Name</label>\n <input\n type=\"text\"\n id=\"categoryName\"\n name=\"categoryName\"\n [(ngModel)]=\"name\"\n placeholder=\"e.g., Production, Development, API Keys\"\n [disabled]=\"isSaving\"\n required\n />\n </div>\n <div class=\"form-group\">\n <label for=\"categoryParent\">Parent Category</label>\n <select\n id=\"categoryParent\"\n name=\"categoryParent\"\n [(ngModel)]=\"parentId\"\n [disabled]=\"isSaving\"\n >\n <option [ngValue]=\"''\">No parent (root category)</option>\n @for (cat of availableParentCategories; track cat) {\n <option [ngValue]=\"cat.ID\">\n {{getParentPath(cat.ID)}}\n </option>\n }\n </select>\n <span class=\"field-hint\">Select a parent to create a subcategory</span>\n </div>\n <div class=\"form-group\">\n <label for=\"categoryDescription\">Description</label>\n <textarea\n id=\"categoryDescription\"\n name=\"categoryDescription\"\n [(ngModel)]=\"description\"\n placeholder=\"Optional description of this category...\"\n rows=\"3\"\n [disabled]=\"isSaving\"\n ></textarea>\n </div>\n </div>\n <!-- Icon Section -->\n <div class=\"form-section\">\n <h3 class=\"section-title\">\n <i class=\"fa-solid fa-icons\"></i>\n Icon\n </h3>\n <div class=\"form-group\">\n <label for=\"categoryIcon\">Custom Icon Class</label>\n <input\n type=\"text\"\n id=\"categoryIcon\"\n name=\"categoryIcon\"\n [(ngModel)]=\"iconClass\"\n placeholder=\"e.g., fa-solid fa-folder\"\n [disabled]=\"isSaving\"\n />\n <span class=\"field-hint\">Font Awesome icon class</span>\n </div>\n <div class=\"icon-suggestions\">\n <p class=\"suggestions-label\">Quick pick:</p>\n <div class=\"icon-grid\">\n @for (suggestion of iconSuggestions; track suggestion) {\n <button\n type=\"button\"\n class=\"icon-btn\"\n [class.selected]=\"iconClass === suggestion.icon\"\n (click)=\"selectIcon(suggestion.icon)\"\n [disabled]=\"isSaving\"\n [title]=\"suggestion.label\"\n >\n <i [class]=\"suggestion.icon\"></i>\n </button>\n }\n </div>\n </div>\n @if (iconClass) {\n <div class=\"icon-preview\">\n <div class=\"preview-label\">Preview:</div>\n <div class=\"preview-icon\">\n <i [class]=\"iconClass\"></i>\n </div>\n </div>\n }\n </div>\n </form>\n }\n </div>\n <!-- Panel Footer -->\n <div class=\"panel-footer\">\n <div class=\"footer-left\">\n @if (!isNew) {\n <button\n class=\"btn-delete\"\n (click)=\"deleteCategory()\"\n [disabled]=\"isSaving\"\n >\n <i class=\"fa-solid fa-trash\"></i>\n <span>Delete</span>\n </button>\n }\n </div>\n <div class=\"footer-right\">\n <button\n class=\"btn-secondary\"\n (click)=\"closePanel()\"\n [disabled]=\"isSaving\"\n >\n Cancel\n </button>\n <button\n class=\"btn-primary\"\n (click)=\"save()\"\n [disabled]=\"isSaving || !canSave\"\n >\n @if (isSaving) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n }\n @if (!isSaving) {\n <i class=\"fa-solid fa-check\"></i>\n }\n <span>{{isNew ? 'Create' : 'Save'}}</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n}\n", styles: ["/* Panel Backdrop */\n.panel-backdrop {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n z-index: 1000;\n display: flex;\n justify-content: flex-end;\n animation: fadeIn 0.2s ease-out;\n}\n\n@keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n/* Slide-in Panel */\n.edit-panel {\n width: 100%;\n max-width: 500px;\n height: 100%;\n background: #ffffff;\n display: flex;\n flex-direction: column;\n box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);\n transform: translateX(100%);\n animation: slideIn 0.3s ease-out forwards;\n}\n\n@keyframes slideIn {\n from { transform: translateX(100%); }\n to { transform: translateX(0); }\n}\n\n/* Panel Header */\n.panel-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 20px 24px;\n border-bottom: 1px solid #e5e7eb;\n background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);\n}\n\n.header-content {\n display: flex;\n align-items: center;\n gap: 16px;\n}\n\n.header-icon {\n width: 48px;\n height: 48px;\n border-radius: 12px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 20px;\n flex-shrink: 0;\n}\n\n.header-text h2 {\n font-size: 18px;\n font-weight: 600;\n color: #1e293b;\n margin: 0 0 4px 0;\n}\n\n.header-subtitle {\n font-size: 13px;\n color: #64748b;\n}\n\n.close-btn {\n width: 36px;\n height: 36px;\n border: none;\n background: #f1f5f9;\n border-radius: 8px;\n cursor: pointer;\n color: #64748b;\n font-size: 16px;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.15s ease;\n}\n\n.close-btn:hover:not(:disabled) {\n background: #e2e8f0;\n color: #334155;\n}\n\n.close-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n/* Panel Body */\n.panel-body {\n flex: 1;\n overflow-y: auto;\n padding: 24px;\n scroll-behavior: smooth;\n -webkit-overflow-scrolling: touch;\n}\n\n/* Form Sections */\n.form-section {\n margin-bottom: 28px;\n}\n\n.form-section:last-child {\n margin-bottom: 0;\n}\n\n.section-title {\n display: flex;\n align-items: center;\n gap: 10px;\n font-size: 14px;\n font-weight: 600;\n color: #334155;\n margin: 0 0 16px 0;\n padding-bottom: 10px;\n border-bottom: 1px solid #f1f5f9;\n}\n\n.section-title i {\n color: #6366f1;\n font-size: 14px;\n}\n\n/* Form Groups */\n.form-group {\n margin-bottom: 18px;\n}\n\n.form-group:last-child {\n margin-bottom: 0;\n}\n\n.form-group label {\n display: block;\n font-size: 13px;\n font-weight: 500;\n color: #475569;\n margin-bottom: 6px;\n}\n\n.form-group label.required::after {\n content: '*';\n color: #ef4444;\n margin-left: 4px;\n}\n\n.form-group input[type=\"text\"],\n.form-group select,\n.form-group textarea {\n width: 100%;\n padding: 10px 14px;\n border: 1px solid #d1d5db;\n border-radius: 8px;\n font-size: 14px;\n color: #1e293b;\n background: #ffffff;\n transition: all 0.15s ease;\n box-sizing: border-box;\n}\n\n.form-group input:focus,\n.form-group select:focus,\n.form-group textarea:focus {\n outline: none;\n border-color: #6366f1;\n box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);\n}\n\n.form-group input:disabled,\n.form-group select:disabled,\n.form-group textarea:disabled {\n background: #f8fafc;\n color: #94a3b8;\n cursor: not-allowed;\n}\n\n.form-group textarea {\n resize: vertical;\n min-height: 80px;\n}\n\n.form-group select {\n cursor: pointer;\n}\n\n.field-hint {\n display: block;\n font-size: 12px;\n color: #94a3b8;\n margin-top: 5px;\n}\n\n/* Icon Suggestions */\n.icon-suggestions {\n margin-top: 16px;\n}\n\n.suggestions-label {\n font-size: 12px;\n font-weight: 500;\n color: #64748b;\n margin: 0 0 10px 0;\n}\n\n.icon-grid {\n display: grid;\n grid-template-columns: repeat(6, 1fr);\n gap: 8px;\n}\n\n.icon-btn {\n width: 100%;\n aspect-ratio: 1;\n border: 2px solid #e5e7eb;\n border-radius: 8px;\n background: #ffffff;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 16px;\n color: #64748b;\n transition: all 0.15s ease;\n}\n\n.icon-btn:hover:not(:disabled) {\n border-color: #6366f1;\n color: #6366f1;\n background: #f0f1ff;\n}\n\n.icon-btn.selected {\n border-color: #6366f1;\n background: #6366f1;\n color: #ffffff;\n}\n\n.icon-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n/* Icon Preview */\n.icon-preview {\n margin-top: 16px;\n display: flex;\n align-items: center;\n gap: 12px;\n}\n\n.preview-label {\n font-size: 12px;\n font-weight: 500;\n color: #64748b;\n}\n\n.preview-icon {\n width: 48px;\n height: 48px;\n border-radius: 12px;\n background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);\n display: flex;\n align-items: center;\n justify-content: center;\n color: white;\n font-size: 20px;\n box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);\n}\n\n/* Panel Footer */\n.panel-footer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 16px 24px;\n border-top: 1px solid #e5e7eb;\n background: #f8fafc;\n}\n\n.footer-left,\n.footer-right {\n display: flex;\n align-items: center;\n gap: 12px;\n}\n\n.btn-primary,\n.btn-secondary,\n.btn-delete {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 20px;\n border: none;\n border-radius: 8px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.15s ease;\n}\n\n.btn-primary {\n background: #6366f1;\n color: #ffffff;\n}\n\n.btn-primary:hover:not(:disabled) {\n background: #4f46e5;\n}\n\n.btn-primary:disabled {\n background: #c7d2fe;\n cursor: not-allowed;\n}\n\n.btn-secondary {\n background: #ffffff;\n color: #475569;\n border: 1px solid #d1d5db;\n}\n\n.btn-secondary:hover:not(:disabled) {\n background: #f1f5f9;\n border-color: #94a3b8;\n}\n\n.btn-secondary:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.btn-delete {\n background: transparent;\n color: #dc2626;\n padding: 10px 16px;\n}\n\n.btn-delete:hover:not(:disabled) {\n background: #fef2f2;\n}\n\n.btn-delete:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n/* Mobile Responsiveness */\n@media (max-width: 768px) {\n .edit-panel {\n max-width: 100%;\n }\n\n .panel-header {\n padding: 16px 20px;\n }\n\n .header-icon {\n width: 40px;\n height: 40px;\n font-size: 18px;\n }\n\n .header-text h2 {\n font-size: 16px;\n }\n\n .panel-body {\n padding: 20px;\n }\n\n .icon-grid {\n grid-template-columns: repeat(4, 1fr);\n }\n\n .panel-footer {\n padding: 14px 20px;\n flex-direction: column-reverse;\n gap: 12px;\n }\n\n .footer-left,\n .footer-right {\n width: 100%;\n }\n\n .footer-right {\n flex-direction: row;\n }\n\n .footer-right .btn-primary,\n .footer-right .btn-secondary {\n flex: 1;\n justify-content: center;\n }\n\n .btn-delete {\n width: 100%;\n justify-content: center;\n background: #fef2f2;\n }\n}\n\n@media (max-width: 480px) {\n .panel-header {\n padding: 14px 16px;\n }\n\n .header-content {\n gap: 12px;\n }\n\n .header-icon {\n width: 36px;\n height: 36px;\n font-size: 16px;\n border-radius: 10px;\n }\n\n .header-text h2 {\n font-size: 15px;\n }\n\n .header-subtitle {\n font-size: 12px;\n }\n\n .panel-body {\n padding: 16px;\n }\n\n .icon-grid {\n grid-template-columns: repeat(4, 1fr);\n gap: 6px;\n }\n\n .icon-btn {\n font-size: 14px;\n }\n\n .preview-icon {\n width: 40px;\n height: 40px;\n font-size: 18px;\n }\n\n .panel-footer {\n padding: 12px 16px;\n }\n\n .btn-primary,\n .btn-secondary {\n padding: 10px 16px;\n font-size: 13px;\n }\n}\n\n/* Custom scrollbar */\n.panel-body::-webkit-scrollbar {\n width: 6px;\n}\n\n.panel-body::-webkit-scrollbar-track {\n background: transparent;\n}\n\n.panel-body::-webkit-scrollbar-thumb {\n background: #d1d5db;\n border-radius: 3px;\n}\n\n.panel-body::-webkit-scrollbar-thumb:hover {\n background: #94a3b8;\n}\n\n/* Animations */\n@keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n}\n\n.fa-spin {\n animation: spin 1s linear infinite;\n}\n"] }]
222
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { category: [{
223
+ type: Input
224
+ }], isOpen: [{
225
+ type: Input
226
+ }], close: [{
227
+ type: Output
228
+ }], saved: [{
229
+ type: Output
230
+ }], deleted: [{
231
+ type: Output
232
+ }] } });
233
+ //# sourceMappingURL=credential-category-edit-panel.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-category-edit-panel.component.js","sourceRoot":"","sources":["../../../../src/lib/panels/credential-category-edit-panel/credential-category-edit-panel.component.ts","../../../../src/lib/panels/credential-category-edit-panel/credential-category-edit-panel.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAqB,uBAAuB,EAAU,MAAM,eAAe,CAAC;AAE3H,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;;;;AASzE,MAAM,OAAO,oCAAoC;IAuCzB;IAtCX,QAAQ,GAAoC,IAAI,CAAC;IACjD,MAAM,GAAG,KAAK,CAAC;IAEd,KAAK,GAAG,IAAI,YAAY,EAAQ,CAAC;IACjC,KAAK,GAAG,IAAI,YAAY,EAA4B,CAAC;IACrD,OAAO,GAAG,IAAI,YAAY,EAAU,CAAC;IAExC,SAAS,GAAG,KAAK,CAAC;IAClB,QAAQ,GAAG,KAAK,CAAC;IACjB,KAAK,GAAG,KAAK,CAAC;IAErB,sCAAsC;IAC/B,aAAa,GAA+B,EAAE,CAAC;IAEtD,cAAc;IACP,IAAI,GAAG,EAAE,CAAC;IACV,WAAW,GAAG,EAAE,CAAC;IACjB,QAAQ,GAAG,EAAE,CAAC;IACd,SAAS,G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;IAEM,eAAe,CAAC,KAAiB;QACpC,IAAK,KAAK,CAAC,MAAsB,CAAC,SAAS,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;YACrE,IAAI,CAAC,UAAU,EAAE,CAAC;QACtB,CAAC;IACL,CAAC;IAEM,aAAa,CAAC,UAAkB;QACnC,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,IAAI,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,UAAU,CAAC,CAAC;QAEhE,OAAO,OAAO,EAAE,CAAC;YACb,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAC5B,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,OAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACtG,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;uGAjQQ,oCAAoC;2FAApC,oCAAoC,mNCZjD,soMAsKA;;2FD1Ja,oCAAoC;kBAPhD,SAAS;iCACI,KAAK,YACL,mCAAmC,mBAG5B,uBAAuB,CAAC,MAAM;;sBAG9C,KAAK;;sBACL,KAAK;;sBAEL,MAAM;;sBACN,MAAM;;sBACN,MAAM"}
@@ -0,0 +1,95 @@
1
+ import { EventEmitter, ChangeDetectorRef, OnInit, OnDestroy } from '@angular/core';
2
+ import { CredentialEntity, CredentialTypeEntity, CredentialCategoryEntity } from '@memberjunction/core-entities';
3
+ import * as i0 from "@angular/core";
4
+ interface FieldSchemaProperty {
5
+ name: string;
6
+ type: string;
7
+ title: string;
8
+ description: string;
9
+ isSecret: boolean;
10
+ required: boolean;
11
+ order: number;
12
+ enum?: string[];
13
+ const?: unknown;
14
+ default?: unknown;
15
+ format?: string;
16
+ pattern?: string;
17
+ minLength?: number;
18
+ maxLength?: number;
19
+ minimum?: number;
20
+ maximum?: number;
21
+ }
22
+ interface CredentialValues {
23
+ [key: string]: string | number | boolean;
24
+ }
25
+ export declare class CredentialEditPanelComponent implements OnInit, OnDestroy {
26
+ private cdr;
27
+ credential: CredentialEntity | null;
28
+ credentialTypes: CredentialTypeEntity[];
29
+ isOpen: boolean;
30
+ close: EventEmitter<void>;
31
+ saved: EventEmitter<CredentialEntity>;
32
+ deleted: EventEmitter<string>;
33
+ isLoading: boolean;
34
+ isSaving: boolean;
35
+ isNew: boolean;
36
+ categories: CredentialCategoryEntity[];
37
+ name: string;
38
+ description: string;
39
+ selectedTypeId: string;
40
+ selectedCategoryId: string;
41
+ isActive: boolean;
42
+ isDefault: boolean;
43
+ expiresAt: Date | null;
44
+ credentialValues: CredentialValues;
45
+ schemaFields: FieldSchemaProperty[];
46
+ showSecretFields: Set<string>;
47
+ private _metadata;
48
+ constructor(cdr: ChangeDetectorRef);
49
+ ngOnInit(): void;
50
+ ngOnDestroy(): void;
51
+ get selectedType(): CredentialTypeEntity | null;
52
+ get panelTitle(): string;
53
+ get canSave(): boolean;
54
+ open(credential: CredentialEntity | null, preselectedTypeId?: string, preselectedCategoryId?: string): Promise<void>;
55
+ private resetForm;
56
+ private populateFromCredential;
57
+ private loadCategories;
58
+ onTypeChange(): void;
59
+ toggleSecretVisibility(fieldName: string): void;
60
+ isSecretVisible(fieldName: string): boolean;
61
+ save(): Promise<void>;
62
+ deleteCredential(): Promise<void>;
63
+ closePanel(): void;
64
+ onBackdropClick(): void;
65
+ onEscapeKey(event: Event): void;
66
+ get groupedCredentialTypes(): Array<{
67
+ category: string;
68
+ types: CredentialTypeEntity[];
69
+ }>;
70
+ getTypeIcon(type: CredentialTypeEntity): string;
71
+ getTypeColor(type: CredentialTypeEntity): string;
72
+ onValueChange(fieldName: string, value: string): void;
73
+ formatDateForInput(date: Date | null): string;
74
+ onExpiresAtChange(value: string): void;
75
+ /**
76
+ * Validates a field value against format constraints.
77
+ */
78
+ private validateFormat;
79
+ /**
80
+ * Validates all credential fields against their schema constraints.
81
+ * Returns array of error messages (empty if all valid).
82
+ */
83
+ private validateAllFields;
84
+ /**
85
+ * Cleans credential values before saving by removing:
86
+ * - "undefined" string values
87
+ * - Empty strings for non-required fields
88
+ * - null and undefined values
89
+ */
90
+ private cleanCredentialValues;
91
+ static ɵfac: i0.ɵɵFactoryDeclaration<CredentialEditPanelComponent, never>;
92
+ static ɵcmp: i0.ɵɵComponentDeclaration<CredentialEditPanelComponent, "mj-credential-edit-panel", never, { "credential": { "alias": "credential"; "required": false; }; "credentialTypes": { "alias": "credentialTypes"; "required": false; }; "isOpen": { "alias": "isOpen"; "required": false; }; }, { "close": "close"; "saved": "saved"; "deleted": "deleted"; }, never, never, false, never>;
93
+ }
94
+ export {};
95
+ //# sourceMappingURL=credential-edit-panel.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-edit-panel.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/panels/credential-edit-panel/credential-edit-panel.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAE,iBAAiB,EAA2B,MAAM,EAAE,SAAS,EAAgB,MAAM,eAAe,CAAC;AACpJ,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;;AAIjH,UAAU,mBAAmB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IAEd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,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