@memberjunction/ng-credentials 6.1.0-edge.5 → 6.1.0-edge.7

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.
@@ -18,8 +18,8 @@ import { CredentialCategoryEditPanelComponent } from './panels/credential-catego
18
18
  import { CredentialDialogComponent } from './dialogs/credential-dialog.component';
19
19
  import * as i0 from "@angular/core";
20
20
  export class CredentialsModule {
21
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: CredentialsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
22
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.3", ngImport: i0, type: CredentialsModule, declarations: [
21
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: CredentialsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
22
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.22", ngImport: i0, type: CredentialsModule, declarations: [
23
23
  // Panels
24
24
  CredentialEditPanelComponent,
25
25
  CredentialTypeEditPanelComponent,
@@ -34,11 +34,11 @@ export class CredentialsModule {
34
34
  CredentialCategoryEditPanelComponent,
35
35
  // Dialogs
36
36
  CredentialDialogComponent] });
37
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: CredentialsModule, imports: [CommonModule,
37
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: CredentialsModule, imports: [CommonModule,
38
38
  FormsModule,
39
39
  SharedGenericModule] });
40
40
  }
41
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: CredentialsModule, decorators: [{
41
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: CredentialsModule, decorators: [{
42
42
  type: NgModule,
43
43
  args: [{
44
44
  declarations: [
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.module.js","sourceRoot":"","sources":["../../src/lib/credentials.module.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,yBAAyB;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE,mBAAmB;AACnB,OAAO,EAAE,4BAA4B,EAAE,MAAM,gEAAgE,CAAC;AAC9G,OAAO,EAAE,gCAAgC,EAAE,MAAM,0EAA0E,CAAC;AAC5H,OAAO,EAAE,oCAAoC,EAAE,MAAM,kFAAkF,CAAC;AAExI,oBAAoB;AACpB,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;;AAyBlF,MAAM,OAAO,iBAAiB;uGAAjB,iBAAiB;wGAAjB,iBAAiB;YArBtB,SAAS;YACT,4BAA4B;YAC5B,gCAAgC;YAChC,oCAAoC;YACpC,UAAU;YACV,yBAAyB,aAGzB,YAAY;YACZ,WAAW;YACX,mBAAmB;YAGnB,SAAS;YACT,4BAA4B;YAC5B,gCAAgC;YAChC,oCAAoC;YACpC,UAAU;YACV,yBAAyB;wGAGpB,iBAAiB,YAbtB,YAAY;YACZ,WAAW;YACX,mBAAmB;;2FAWd,iBAAiB;kBAvB7B,QAAQ;mBAAC;oBACN,YAAY,EAAE;wBACV,SAAS;wBACT,4BAA4B;wBAC5B,gCAAgC;wBAChC,oCAAoC;wBACpC,UAAU;wBACV,yBAAyB;qBAC5B;oBACD,OAAO,EAAE;wBACL,YAAY;wBACZ,WAAW;wBACX,mBAAmB;qBACtB;oBACD,OAAO,EAAE;wBACL,SAAS;wBACT,4BAA4B;wBAC5B,gCAAgC;wBAChC,oCAAoC;wBACpC,UAAU;wBACV,yBAAyB;qBAC5B;iBACJ","sourcesContent":["/**\n * @fileoverview Credentials Module\n *\n * Angular module providing reusable credential management components.\n * Includes panels and dialogs for creating and editing credentials,\n * credential types, and credential categories.\n */\n\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\n\n// MemberJunction modules\nimport { SharedGenericModule } from '@memberjunction/ng-shared-generic';\n\n// Panel components\nimport { CredentialEditPanelComponent } from './panels/credential-edit-panel/credential-edit-panel.component';\nimport { CredentialTypeEditPanelComponent } from './panels/credential-type-edit-panel/credential-type-edit-panel.component';\nimport { CredentialCategoryEditPanelComponent } from './panels/credential-category-edit-panel/credential-category-edit-panel.component';\n\n// Dialog components\nimport { CredentialDialogComponent } from './dialogs/credential-dialog.component';\n\n@NgModule({\n declarations: [\n // Panels\n CredentialEditPanelComponent,\n CredentialTypeEditPanelComponent,\n CredentialCategoryEditPanelComponent,\n // Dialogs\n CredentialDialogComponent\n ],\n imports: [\n CommonModule,\n FormsModule,\n SharedGenericModule\n ],\n exports: [\n // Panels\n CredentialEditPanelComponent,\n CredentialTypeEditPanelComponent,\n CredentialCategoryEditPanelComponent,\n // Dialogs\n CredentialDialogComponent\n ]\n})\nexport class CredentialsModule { }\n"]}
1
+ {"version":3,"file":"credentials.module.js","sourceRoot":"","sources":["../../src/lib/credentials.module.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,yBAAyB;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE,mBAAmB;AACnB,OAAO,EAAE,4BAA4B,EAAE,MAAM,gEAAgE,CAAC;AAC9G,OAAO,EAAE,gCAAgC,EAAE,MAAM,0EAA0E,CAAC;AAC5H,OAAO,EAAE,oCAAoC,EAAE,MAAM,kFAAkF,CAAC;AAExI,oBAAoB;AACpB,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;;AAyBlF,MAAM,OAAO,iBAAiB;wGAAjB,iBAAiB;yGAAjB,iBAAiB;YArBtB,SAAS;YACT,4BAA4B;YAC5B,gCAAgC;YAChC,oCAAoC;YACpC,UAAU;YACV,yBAAyB,aAGzB,YAAY;YACZ,WAAW;YACX,mBAAmB;YAGnB,SAAS;YACT,4BAA4B;YAC5B,gCAAgC;YAChC,oCAAoC;YACpC,UAAU;YACV,yBAAyB;yGAGpB,iBAAiB,YAbtB,YAAY;YACZ,WAAW;YACX,mBAAmB;;4FAWd,iBAAiB;kBAvB7B,QAAQ;mBAAC;oBACN,YAAY,EAAE;wBACV,SAAS;wBACT,4BAA4B;wBAC5B,gCAAgC;wBAChC,oCAAoC;wBACpC,UAAU;wBACV,yBAAyB;qBAC5B;oBACD,OAAO,EAAE;wBACL,YAAY;wBACZ,WAAW;wBACX,mBAAmB;qBACtB;oBACD,OAAO,EAAE;wBACL,SAAS;wBACT,4BAA4B;wBAC5B,gCAAgC;wBAChC,oCAAoC;wBACpC,UAAU;wBACV,yBAAyB;qBAC5B;iBACJ","sourcesContent":["/**\n * @fileoverview Credentials Module\n *\n * Angular module providing reusable credential management components.\n * Includes panels and dialogs for creating and editing credentials,\n * credential types, and credential categories.\n */\n\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\n\n// MemberJunction modules\nimport { SharedGenericModule } from '@memberjunction/ng-shared-generic';\n\n// Panel components\nimport { CredentialEditPanelComponent } from './panels/credential-edit-panel/credential-edit-panel.component';\nimport { CredentialTypeEditPanelComponent } from './panels/credential-type-edit-panel/credential-type-edit-panel.component';\nimport { CredentialCategoryEditPanelComponent } from './panels/credential-category-edit-panel/credential-category-edit-panel.component';\n\n// Dialog components\nimport { CredentialDialogComponent } from './dialogs/credential-dialog.component';\n\n@NgModule({\n declarations: [\n // Panels\n CredentialEditPanelComponent,\n CredentialTypeEditPanelComponent,\n CredentialCategoryEditPanelComponent,\n // Dialogs\n CredentialDialogComponent\n ],\n imports: [\n CommonModule,\n FormsModule,\n SharedGenericModule\n ],\n exports: [\n // Panels\n CredentialEditPanelComponent,\n CredentialTypeEditPanelComponent,\n CredentialCategoryEditPanelComponent,\n // Dialogs\n CredentialDialogComponent\n ]\n})\nexport class CredentialsModule { }\n"]}
@@ -125,8 +125,8 @@ export class CredentialDialogComponent extends BaseAngularComponent {
125
125
  });
126
126
  this.cdr.markForCheck();
127
127
  }
128
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: CredentialDialogComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
129
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: CredentialDialogComponent, isStandalone: false, selector: "mj-credential-dialog", inputs: { Visible: "Visible", Credential: "Credential", PreselectedTypeId: "PreselectedTypeId", PreselectedCategoryId: "PreselectedCategoryId", Title: "Title", Width: "Width" }, outputs: { close: "close" }, viewQueries: [{ propertyName: "editPanel", first: true, predicate: ["editPanel"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
128
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: CredentialDialogComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
129
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: CredentialDialogComponent, isStandalone: false, selector: "mj-credential-dialog", inputs: { Visible: "Visible", Credential: "Credential", PreselectedTypeId: "PreselectedTypeId", PreselectedCategoryId: "PreselectedCategoryId", Title: "Title", Width: "Width" }, outputs: { close: "close" }, viewQueries: [{ propertyName: "editPanel", first: true, predicate: ["editPanel"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
130
130
  @if (Visible) {
131
131
  @if (IsLoading) {
132
132
  <div class="loading-backdrop">
@@ -146,7 +146,7 @@ export class CredentialDialogComponent extends BaseAngularComponent {
146
146
  }
147
147
  `, isInline: true, styles: ["\n .loading-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 display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n }\n "], dependencies: [{ kind: "component", type: i1.LoadingComponent, selector: "mj-loading", inputs: ["text", "showText", "animationDuration", "size", "textColor", "logoColor", "logoGradient", "animation"] }, { kind: "component", type: i2.CredentialEditPanelComponent, selector: "mj-credential-edit-panel", inputs: ["credential", "credentialTypes", "isOpen"], outputs: ["close", "saved", "deleted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
148
148
  }
149
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: CredentialDialogComponent, decorators: [{
149
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: CredentialDialogComponent, decorators: [{
150
150
  type: Component,
151
151
  args: [{ standalone: false, selector: 'mj-credential-dialog', template: `
152
152
  @if (Visible) {
@@ -1 +1 @@
1
- {"version":3,"file":"credential-dialog.component.js","sourceRoot":"","sources":["../../../src/lib/dialogs/credential-dialog.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAqB,uBAAuB,EAAE,SAAS,EAAoC,MAAM,eAAe,CAAC;AAChK,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;;;;AAuE/C,MAAM,OAAO,yBAA0B,SAAQ,oBAAoB;IAiB3C;IAhBI,SAAS,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;;;;;;;;;;;KAkBT;;2FAiBQ,yBAAyB;kBAtCrC,SAAS;iCACI,KAAK,YACL,sBAAsB,YACtB;;;;;;;;;;;;;;;;;;KAkBT,mBAegB,uBAAuB,CAAC,MAAM;;sBAG9C,SAAS;uBAAC,WAAW;;sBAErB,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBAEL,MAAM","sourcesContent":["/**\n * @fileoverview Credential Dialog Component\n *\n * A dialog wrapper for the CredentialEditPanelComponent that provides\n * a convenient way to create or edit credentials in a modal dialog.\n */\n\nimport { Component, Input, Output, EventEmitter, ChangeDetectorRef, ChangeDetectionStrategy, ViewChild, OnInit, OnChanges, SimpleChanges } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { MJCredentialEntity, MJCredentialTypeEntity } from '@memberjunction/core-entities';\nimport { RunView } from '@memberjunction/core';\nimport { CredentialEditPanelComponent } from '../panels/credential-edit-panel/credential-edit-panel.component';\n\n/**\n * Configuration options for opening the credential dialog\n */\nexport interface CredentialDialogOptions {\n /** The credential to edit, or null for creating a new credential */\n credential?: MJCredentialEntity | null;\n /** Pre-selected credential type ID for new credentials */\n preselectedTypeId?: string;\n /** Pre-selected category ID for new credentials */\n preselectedCategoryId?: string;\n /** Dialog title override */\n title?: string;\n /** Dialog width in pixels */\n width?: number;\n}\n\n/**\n * Result returned when the dialog closes\n */\nexport interface CredentialDialogResult {\n /** Whether a credential was saved or deleted */\n success: boolean;\n /** The saved credential entity (if save was successful) */\n credential?: MJCredentialEntity;\n /** The ID of the deleted credential (if delete was successful) */\n deletedId?: string;\n /** The action that was taken */\n action: 'saved' | 'deleted' | 'cancelled';\n}\n\n@Component({\n standalone: false,\n selector: 'mj-credential-dialog',\n template: `\n @if (Visible) {\n @if (IsLoading) {\n <div class=\"loading-backdrop\">\n <mj-loading text=\"Loading credential types...\"></mj-loading>\n </div>\n } @else {\n <mj-credential-edit-panel\n #editPanel\n [credential]=\"Credential\"\n [credentialTypes]=\"credentialTypes\"\n [isOpen]=\"Visible\"\n (saved)=\"onSaved($event)\"\n (deleted)=\"onDeleted($event)\"\n (close)=\"onCancel()\">\n </mj-credential-edit-panel>\n }\n }\n `,\n styles: [`\n .loading-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 display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class CredentialDialogComponent extends BaseAngularComponent implements OnInit, OnChanges {\n @ViewChild('editPanel') editPanel!: CredentialEditPanelComponent;\n\n @Input() Visible = false;\n @Input() Credential: MJCredentialEntity | null = null;\n @Input() PreselectedTypeId: string | undefined;\n @Input() PreselectedCategoryId: string | undefined;\n @Input() Title: string | undefined;\n @Input() Width = 600;\n\n @Output() close = new EventEmitter<CredentialDialogResult>();\n\n public IsLoading = false;\n public credentialTypes: MJCredentialTypeEntity[] = [];\n\n private _dialogTitle = 'Credential';\n\n constructor(private cdr: ChangeDetectorRef) {\n super();}\n\n ngOnInit(): void {\n if (this.Visible) {\n this.loadCredentialTypes();\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['Visible'] && changes['Visible'].currentValue === true) {\n // When dialog becomes visible, load credential types and initialize the panel\n this.loadCredentialTypes().then(() => {\n // Wait for next change detection cycle to ensure panel is rendered\n // (panel is only rendered when IsLoading is false)\n this.cdr.detectChanges();\n // Use setTimeout to ensure ViewChild is resolved after render\n setTimeout(() => {\n if (this.editPanel) {\n this.editPanel.open(this.Credential, this.PreselectedTypeId, this.PreselectedCategoryId);\n }\n }, 0);\n });\n }\n }\n\n public get dialogTitle(): string {\n if (this.Title) {\n return this.Title;\n }\n return this.Credential?.ID ? 'Edit Credential' : 'Create Credential';\n }\n\n /**\n * Opens the dialog with the specified options\n */\n public async open(options?: CredentialDialogOptions): Promise<void> {\n this.Credential = options?.credential ?? null;\n this.PreselectedTypeId = options?.preselectedTypeId;\n this.PreselectedCategoryId = options?.preselectedCategoryId;\n this.Title = options?.title;\n if (options?.width) {\n this.Width = options.width;\n }\n\n this.Visible = true;\n\n await this.loadCredentialTypes();\n\n // Force synchronous render so @if (Visible) creates the editPanel ViewChild\n this.cdr.detectChanges();\n\n // Initialize the edit panel after types are loaded and template is rendered\n if (this.editPanel) {\n await this.editPanel.open(this.Credential, this.PreselectedTypeId, this.PreselectedCategoryId);\n }\n }\n\n private async loadCredentialTypes(): Promise<void> {\n if (this.credentialTypes.length > 0) {\n return; // Already loaded\n }\n\n this.IsLoading = true;\n this.cdr.markForCheck();\n\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJCredentialTypeEntity>({\n EntityName: 'MJ: Credential Types',\n OrderBy: 'Category, Name',\n ResultType: 'entity_object'\n });\n\n if (result.Success) {\n this.credentialTypes = result.Results;\n }\n } catch (error) {\n console.error('Error loading credential types:', error);\n } finally {\n this.IsLoading = false;\n this.cdr.markForCheck();\n }\n }\n\n public onSaved(credential: MJCredentialEntity): void {\n this.Visible = false;\n this.close.emit({\n success: true,\n credential,\n action: 'saved'\n });\n this.cdr.markForCheck();\n }\n\n public onDeleted(credentialId: string): void {\n this.Visible = false;\n this.close.emit({\n success: true,\n deletedId: credentialId,\n action: 'deleted'\n });\n this.cdr.markForCheck();\n }\n\n public onCancel(): void {\n this.Visible = false;\n this.close.emit({\n success: false,\n action: 'cancelled'\n });\n this.cdr.markForCheck();\n }\n}\n"]}
1
+ {"version":3,"file":"credential-dialog.component.js","sourceRoot":"","sources":["../../../src/lib/dialogs/credential-dialog.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAqB,uBAAuB,EAAE,SAAS,EAAoC,MAAM,eAAe,CAAC;AAChK,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;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AC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;IAC5B,CAAC;wGAjIQ,yBAAyB;4FAAzB,yBAAyB,obAnCxB;;;;;;;;;;;;;;;;;;KAkBT;;4FAiBQ,yBAAyB;kBAtCrC,SAAS;iCACI,KAAK,YACL,sBAAsB,YACtB;;;;;;;;;;;;;;;;;;KAkBT,mBAegB,uBAAuB,CAAC,MAAM;;sBAG9C,SAAS;uBAAC,WAAW;;sBAErB,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBAEL,MAAM","sourcesContent":["/**\n * @fileoverview Credential Dialog Component\n *\n * A dialog wrapper for the CredentialEditPanelComponent that provides\n * a convenient way to create or edit credentials in a modal dialog.\n */\n\nimport { Component, Input, Output, EventEmitter, ChangeDetectorRef, ChangeDetectionStrategy, ViewChild, OnInit, OnChanges, SimpleChanges } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { MJCredentialEntity, MJCredentialTypeEntity } from '@memberjunction/core-entities';\nimport { RunView } from '@memberjunction/core';\nimport { CredentialEditPanelComponent } from '../panels/credential-edit-panel/credential-edit-panel.component';\n\n/**\n * Configuration options for opening the credential dialog\n */\nexport interface CredentialDialogOptions {\n /** The credential to edit, or null for creating a new credential */\n credential?: MJCredentialEntity | null;\n /** Pre-selected credential type ID for new credentials */\n preselectedTypeId?: string;\n /** Pre-selected category ID for new credentials */\n preselectedCategoryId?: string;\n /** Dialog title override */\n title?: string;\n /** Dialog width in pixels */\n width?: number;\n}\n\n/**\n * Result returned when the dialog closes\n */\nexport interface CredentialDialogResult {\n /** Whether a credential was saved or deleted */\n success: boolean;\n /** The saved credential entity (if save was successful) */\n credential?: MJCredentialEntity;\n /** The ID of the deleted credential (if delete was successful) */\n deletedId?: string;\n /** The action that was taken */\n action: 'saved' | 'deleted' | 'cancelled';\n}\n\n@Component({\n standalone: false,\n selector: 'mj-credential-dialog',\n template: `\n @if (Visible) {\n @if (IsLoading) {\n <div class=\"loading-backdrop\">\n <mj-loading text=\"Loading credential types...\"></mj-loading>\n </div>\n } @else {\n <mj-credential-edit-panel\n #editPanel\n [credential]=\"Credential\"\n [credentialTypes]=\"credentialTypes\"\n [isOpen]=\"Visible\"\n (saved)=\"onSaved($event)\"\n (deleted)=\"onDeleted($event)\"\n (close)=\"onCancel()\">\n </mj-credential-edit-panel>\n }\n }\n `,\n styles: [`\n .loading-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 display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class CredentialDialogComponent extends BaseAngularComponent implements OnInit, OnChanges {\n @ViewChild('editPanel') editPanel!: CredentialEditPanelComponent;\n\n @Input() Visible = false;\n @Input() Credential: MJCredentialEntity | null = null;\n @Input() PreselectedTypeId: string | undefined;\n @Input() PreselectedCategoryId: string | undefined;\n @Input() Title: string | undefined;\n @Input() Width = 600;\n\n @Output() close = new EventEmitter<CredentialDialogResult>();\n\n public IsLoading = false;\n public credentialTypes: MJCredentialTypeEntity[] = [];\n\n private _dialogTitle = 'Credential';\n\n constructor(private cdr: ChangeDetectorRef) {\n super();}\n\n ngOnInit(): void {\n if (this.Visible) {\n this.loadCredentialTypes();\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['Visible'] && changes['Visible'].currentValue === true) {\n // When dialog becomes visible, load credential types and initialize the panel\n this.loadCredentialTypes().then(() => {\n // Wait for next change detection cycle to ensure panel is rendered\n // (panel is only rendered when IsLoading is false)\n this.cdr.detectChanges();\n // Use setTimeout to ensure ViewChild is resolved after render\n setTimeout(() => {\n if (this.editPanel) {\n this.editPanel.open(this.Credential, this.PreselectedTypeId, this.PreselectedCategoryId);\n }\n }, 0);\n });\n }\n }\n\n public get dialogTitle(): string {\n if (this.Title) {\n return this.Title;\n }\n return this.Credential?.ID ? 'Edit Credential' : 'Create Credential';\n }\n\n /**\n * Opens the dialog with the specified options\n */\n public async open(options?: CredentialDialogOptions): Promise<void> {\n this.Credential = options?.credential ?? null;\n this.PreselectedTypeId = options?.preselectedTypeId;\n this.PreselectedCategoryId = options?.preselectedCategoryId;\n this.Title = options?.title;\n if (options?.width) {\n this.Width = options.width;\n }\n\n this.Visible = true;\n\n await this.loadCredentialTypes();\n\n // Force synchronous render so @if (Visible) creates the editPanel ViewChild\n this.cdr.detectChanges();\n\n // Initialize the edit panel after types are loaded and template is rendered\n if (this.editPanel) {\n await this.editPanel.open(this.Credential, this.PreselectedTypeId, this.PreselectedCategoryId);\n }\n }\n\n private async loadCredentialTypes(): Promise<void> {\n if (this.credentialTypes.length > 0) {\n return; // Already loaded\n }\n\n this.IsLoading = true;\n this.cdr.markForCheck();\n\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJCredentialTypeEntity>({\n EntityName: 'MJ: Credential Types',\n OrderBy: 'Category, Name',\n ResultType: 'entity_object'\n });\n\n if (result.Success) {\n this.credentialTypes = result.Results;\n }\n } catch (error) {\n console.error('Error loading credential types:', error);\n } finally {\n this.IsLoading = false;\n this.cdr.markForCheck();\n }\n }\n\n public onSaved(credential: MJCredentialEntity): void {\n this.Visible = false;\n this.close.emit({\n success: true,\n credential,\n action: 'saved'\n });\n this.cdr.markForCheck();\n }\n\n public onDeleted(credentialId: string): void {\n this.Visible = false;\n this.close.emit({\n success: true,\n deletedId: credentialId,\n action: 'deleted'\n });\n this.cdr.markForCheck();\n }\n\n public onCancel(): void {\n this.Visible = false;\n this.close.emit({\n success: false,\n action: 'cancelled'\n });\n this.cdr.markForCheck();\n }\n}\n"]}
@@ -219,10 +219,10 @@ export class CredentialCategoryEditPanelComponent extends BaseAngularComponent {
219
219
  }
220
220
  return parts.join(' / ');
221
221
  }
222
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: CredentialCategoryEditPanelComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.MJConfirmService }], target: i0.ɵɵFactoryTarget.Component });
223
- 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" }, usesInheritance: true, 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]=\"'color-mix(in srgb, var(--mj-brand-primary) 8%, var(--mj-bg-surface))'\" [style.color]=\"'var(--mj-brand-primary)'\">\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: var(--mj-bg-surface);\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 var(--mj-border-default);\n background: var(--mj-bg-surface-card);\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: var(--mj-text-primary);\n margin: 0 0 4px 0;\n}\n\n.header-subtitle {\n font-size: 13px;\n color: var(--mj-text-muted);\n}\n\n.close-btn {\n width: 36px;\n height: 36px;\n border: none;\n background: var(--mj-bg-surface-sunken);\n border-radius: 8px;\n cursor: pointer;\n color: var(--mj-text-muted);\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: var(--mj-border-default);\n color: var(--mj-text-secondary);\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: var(--mj-text-secondary);\n margin: 0 0 16px 0;\n padding-bottom: 10px;\n border-bottom: 1px solid var(--mj-bg-surface-sunken);\n}\n\n.section-title i {\n color: var(--mj-brand-primary);\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: var(--mj-text-secondary);\n margin-bottom: 6px;\n}\n\n.form-group label.required::after {\n content: '*';\n color: var(--mj-status-error);\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 var(--mj-border-strong);\n border-radius: 8px;\n font-size: 14px;\n color: var(--mj-text-primary);\n background: var(--mj-bg-surface);\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: var(--mj-brand-primary);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--mj-brand-primary) 10%, transparent);\n}\n\n.form-group input:disabled,\n.form-group select:disabled,\n.form-group textarea:disabled {\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-disabled);\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: var(--mj-text-disabled);\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: var(--mj-text-muted);\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 var(--mj-border-default);\n border-radius: 8px;\n background: var(--mj-bg-surface);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 16px;\n color: var(--mj-text-muted);\n transition: all 0.15s ease;\n}\n\n.icon-btn:hover:not(:disabled) {\n border-color: var(--mj-brand-primary);\n color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 8%, var(--mj-bg-surface));\n}\n\n.icon-btn.selected {\n border-color: var(--mj-brand-primary);\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\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: var(--mj-text-muted);\n}\n\n.preview-icon {\n width: 48px;\n height: 48px;\n border-radius: 12px;\n background: var(--mj-brand-primary);\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--mj-text-inverse);\n font-size: 20px;\n box-shadow: 0 4px 12px color-mix(in srgb, var(--mj-brand-primary) 30%, transparent);\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 var(--mj-border-default);\n background: var(--mj-bg-surface-card);\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: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n}\n\n.btn-primary:hover:not(:disabled) {\n background: var(--mj-brand-primary-hover);\n}\n\n.btn-primary:disabled {\n background: color-mix(in srgb, var(--mj-brand-primary) 25%, var(--mj-bg-surface));\n cursor: not-allowed;\n}\n\n.btn-secondary {\n background: var(--mj-bg-surface);\n color: var(--mj-text-secondary);\n border: 1px solid var(--mj-border-strong);\n}\n\n.btn-secondary:hover:not(:disabled) {\n background: var(--mj-bg-surface-sunken);\n border-color: var(--mj-text-disabled);\n}\n\n.btn-secondary:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.btn-delete {\n background: transparent;\n color: var(--mj-status-error);\n padding: 10px 16px;\n}\n\n.btn-delete:hover:not(:disabled) {\n background: color-mix(in srgb, var(--mj-status-error) 8%, var(--mj-bg-surface));\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: color-mix(in srgb, var(--mj-status-error) 8%, var(--mj-bg-surface));\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: var(--mj-border-strong);\n border-radius: 3px;\n}\n\n.panel-body::-webkit-scrollbar-thumb:hover {\n background: var(--mj-text-disabled);\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: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.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: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],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.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i3.LoadingComponent, selector: "mj-loading", inputs: ["text", "showText", "animationDuration", "size", "textColor", "logoColor", "logoGradient", "animation"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
222
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: CredentialCategoryEditPanelComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.MJConfirmService }], target: i0.ɵɵFactoryTarget.Component });
223
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: CredentialCategoryEditPanelComponent, isStandalone: false, selector: "mj-credential-category-edit-panel", inputs: { category: "category", isOpen: "isOpen" }, outputs: { close: "close", saved: "saved", deleted: "deleted" }, usesInheritance: true, 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]=\"'color-mix(in srgb, var(--mj-brand-primary) 8%, var(--mj-bg-surface))'\" [style.color]=\"'var(--mj-brand-primary)'\">\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: var(--mj-bg-surface);\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 var(--mj-border-default);\n background: var(--mj-bg-surface-card);\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: var(--mj-text-primary);\n margin: 0 0 4px 0;\n}\n\n.header-subtitle {\n font-size: 13px;\n color: var(--mj-text-muted);\n}\n\n.close-btn {\n width: 36px;\n height: 36px;\n border: none;\n background: var(--mj-bg-surface-sunken);\n border-radius: 8px;\n cursor: pointer;\n color: var(--mj-text-muted);\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: var(--mj-border-default);\n color: var(--mj-text-secondary);\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: var(--mj-text-secondary);\n margin: 0 0 16px 0;\n padding-bottom: 10px;\n border-bottom: 1px solid var(--mj-bg-surface-sunken);\n}\n\n.section-title i {\n color: var(--mj-brand-primary);\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: var(--mj-text-secondary);\n margin-bottom: 6px;\n}\n\n.form-group label.required::after {\n content: '*';\n color: var(--mj-status-error);\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 var(--mj-border-strong);\n border-radius: 8px;\n font-size: 14px;\n color: var(--mj-text-primary);\n background: var(--mj-bg-surface);\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: var(--mj-brand-primary);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--mj-brand-primary) 10%, transparent);\n}\n\n.form-group input:disabled,\n.form-group select:disabled,\n.form-group textarea:disabled {\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-disabled);\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: var(--mj-text-disabled);\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: var(--mj-text-muted);\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 var(--mj-border-default);\n border-radius: 8px;\n background: var(--mj-bg-surface);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 16px;\n color: var(--mj-text-muted);\n transition: all 0.15s ease;\n}\n\n.icon-btn:hover:not(:disabled) {\n border-color: var(--mj-brand-primary);\n color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 8%, var(--mj-bg-surface));\n}\n\n.icon-btn.selected {\n border-color: var(--mj-brand-primary);\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\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: var(--mj-text-muted);\n}\n\n.preview-icon {\n width: 48px;\n height: 48px;\n border-radius: 12px;\n background: var(--mj-brand-primary);\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--mj-text-inverse);\n font-size: 20px;\n box-shadow: 0 4px 12px color-mix(in srgb, var(--mj-brand-primary) 30%, transparent);\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 var(--mj-border-default);\n background: var(--mj-bg-surface-card);\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: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n}\n\n.btn-primary:hover:not(:disabled) {\n background: var(--mj-brand-primary-hover);\n}\n\n.btn-primary:disabled {\n background: color-mix(in srgb, var(--mj-brand-primary) 25%, var(--mj-bg-surface));\n cursor: not-allowed;\n}\n\n.btn-secondary {\n background: var(--mj-bg-surface);\n color: var(--mj-text-secondary);\n border: 1px solid var(--mj-border-strong);\n}\n\n.btn-secondary:hover:not(:disabled) {\n background: var(--mj-bg-surface-sunken);\n border-color: var(--mj-text-disabled);\n}\n\n.btn-secondary:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.btn-delete {\n background: transparent;\n color: var(--mj-status-error);\n padding: 10px 16px;\n}\n\n.btn-delete:hover:not(:disabled) {\n background: color-mix(in srgb, var(--mj-status-error) 8%, var(--mj-bg-surface));\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: color-mix(in srgb, var(--mj-status-error) 8%, var(--mj-bg-surface));\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: var(--mj-border-strong);\n border-radius: 3px;\n}\n\n.panel-body::-webkit-scrollbar-thumb:hover {\n background: var(--mj-text-disabled);\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: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.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: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],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.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i3.LoadingComponent, selector: "mj-loading", inputs: ["text", "showText", "animationDuration", "size", "textColor", "logoColor", "logoGradient", "animation"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
224
224
  }
225
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: CredentialCategoryEditPanelComponent, decorators: [{
225
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: CredentialCategoryEditPanelComponent, decorators: [{
226
226
  type: Component,
227
227
  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]=\"'color-mix(in srgb, var(--mj-brand-primary) 8%, var(--mj-bg-surface))'\" [style.color]=\"'var(--mj-brand-primary)'\">\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: var(--mj-bg-surface);\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 var(--mj-border-default);\n background: var(--mj-bg-surface-card);\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: var(--mj-text-primary);\n margin: 0 0 4px 0;\n}\n\n.header-subtitle {\n font-size: 13px;\n color: var(--mj-text-muted);\n}\n\n.close-btn {\n width: 36px;\n height: 36px;\n border: none;\n background: var(--mj-bg-surface-sunken);\n border-radius: 8px;\n cursor: pointer;\n color: var(--mj-text-muted);\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: var(--mj-border-default);\n color: var(--mj-text-secondary);\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: var(--mj-text-secondary);\n margin: 0 0 16px 0;\n padding-bottom: 10px;\n border-bottom: 1px solid var(--mj-bg-surface-sunken);\n}\n\n.section-title i {\n color: var(--mj-brand-primary);\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: var(--mj-text-secondary);\n margin-bottom: 6px;\n}\n\n.form-group label.required::after {\n content: '*';\n color: var(--mj-status-error);\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 var(--mj-border-strong);\n border-radius: 8px;\n font-size: 14px;\n color: var(--mj-text-primary);\n background: var(--mj-bg-surface);\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: var(--mj-brand-primary);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--mj-brand-primary) 10%, transparent);\n}\n\n.form-group input:disabled,\n.form-group select:disabled,\n.form-group textarea:disabled {\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-disabled);\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: var(--mj-text-disabled);\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: var(--mj-text-muted);\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 var(--mj-border-default);\n border-radius: 8px;\n background: var(--mj-bg-surface);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 16px;\n color: var(--mj-text-muted);\n transition: all 0.15s ease;\n}\n\n.icon-btn:hover:not(:disabled) {\n border-color: var(--mj-brand-primary);\n color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 8%, var(--mj-bg-surface));\n}\n\n.icon-btn.selected {\n border-color: var(--mj-brand-primary);\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\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: var(--mj-text-muted);\n}\n\n.preview-icon {\n width: 48px;\n height: 48px;\n border-radius: 12px;\n background: var(--mj-brand-primary);\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--mj-text-inverse);\n font-size: 20px;\n box-shadow: 0 4px 12px color-mix(in srgb, var(--mj-brand-primary) 30%, transparent);\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 var(--mj-border-default);\n background: var(--mj-bg-surface-card);\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: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n}\n\n.btn-primary:hover:not(:disabled) {\n background: var(--mj-brand-primary-hover);\n}\n\n.btn-primary:disabled {\n background: color-mix(in srgb, var(--mj-brand-primary) 25%, var(--mj-bg-surface));\n cursor: not-allowed;\n}\n\n.btn-secondary {\n background: var(--mj-bg-surface);\n color: var(--mj-text-secondary);\n border: 1px solid var(--mj-border-strong);\n}\n\n.btn-secondary:hover:not(:disabled) {\n background: var(--mj-bg-surface-sunken);\n border-color: var(--mj-text-disabled);\n}\n\n.btn-secondary:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.btn-delete {\n background: transparent;\n color: var(--mj-status-error);\n padding: 10px 16px;\n}\n\n.btn-delete:hover:not(:disabled) {\n background: color-mix(in srgb, var(--mj-status-error) 8%, var(--mj-bg-surface));\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: color-mix(in srgb, var(--mj-status-error) 8%, var(--mj-bg-surface));\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: var(--mj-border-strong);\n border-radius: 3px;\n}\n\n.panel-body::-webkit-scrollbar-thumb:hover {\n background: var(--mj-text-disabled);\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"] }]
228
228
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1.MJConfirmService }], propDecorators: { category: [{
@@ -1 +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,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;;;;AASrE,MAAM,OAAO,oCAAqC,SAAQ,oBAAoB;IAuCtD;IAAgC;IAtC3C,QAAQ,GAAsC,IAAI,CAAC;IACnD,MAAM,GAAG,KAAK,CAAC;IAEd,KAAK,GAAG,IAAI,YAAY,EAAQ,CAAC;IACjC,KAAK,GAAG,IAAI,YAAY,EAA8B,CAAC;IACvD,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,GAAiC,EAAE,CAAC;IAExD,cAAc;IACP,IAAI,GAAG,EAAE,CAAC;IACV,WAAW,GAAG,EAAE,CAAC;IACjB,QAAQ,GAAG,EAAE,CAAC;IACd,SAAS,GAAG,E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Input, Output, EventEmitter, ChangeDetectorRef, ChangeDetectionStrategy, OnInit } from '@angular/core';\nimport { MJCredentialCategoryEntity } from '@memberjunction/core-entities';\nimport { RunView } from '@memberjunction/core';\nimport { UUIDsEqual } from '@memberjunction/global';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { MJConfirmService } from '@memberjunction/ng-ui-components';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\n\n@Component({\n standalone: false,\n selector: 'mj-credential-category-edit-panel',\n templateUrl: './credential-category-edit-panel.component.html',\n styleUrls: ['./credential-category-edit-panel.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class CredentialCategoryEditPanelComponent extends BaseAngularComponent implements OnInit {\n @Input() category: MJCredentialCategoryEntity | null = null;\n @Input() isOpen = false;\n\n @Output() close = new EventEmitter<void>();\n @Output() saved = new EventEmitter<MJCredentialCategoryEntity>();\n @Output() deleted = new EventEmitter<string>();\n\n public isLoading = false;\n public isSaving = false;\n public isNew = false;\n\n // All categories for parent selection\n public allCategories: MJCredentialCategoryEntity[] = [];\n\n // Form fields\n public name = '';\n public description = '';\n public parentId = '';\n public iconClass = '';\n\n // Icon suggestions\n public iconSuggestions: { icon: string; label: string }[] = [\n { icon: 'fa-solid fa-folder', label: 'Folder' },\n { icon: 'fa-solid fa-lock', label: 'Lock' },\n { icon: 'fa-solid fa-shield-halved', label: 'Shield' },\n { icon: 'fa-solid fa-key', label: 'Key' },\n { icon: 'fa-solid fa-cloud', label: 'Cloud' },\n { icon: 'fa-solid fa-database', label: 'Database' },\n { icon: 'fa-solid fa-brain', label: 'AI' },\n { icon: 'fa-solid fa-envelope', label: 'Email' },\n { icon: 'fa-solid fa-plug', label: 'Integration' },\n { icon: 'fa-solid fa-server', label: 'Server' },\n { icon: 'fa-solid fa-code', label: 'Code' },\n { icon: 'fa-solid fa-globe', label: 'Web' }\n ];\n\n private get _metadata() { return this.ProviderToUse; }\n\n constructor(private cdr: ChangeDetectorRef, private confirmService: MJConfirmService) { super(); }\n\n ngOnInit(): void {\n this.loadCategories();\n }\n\n public get panelTitle(): string {\n return this.isNew ? 'Create Category' : 'Edit Category';\n }\n\n public get canSave(): boolean {\n return this.name.trim().length > 0;\n }\n\n public get availableParentCategories(): MJCredentialCategoryEntity[] {\n // Exclude the current category and its descendants from parent options\n if (!this.category || this.isNew) {\n return this.allCategories;\n }\n\n const currentId = this.category.ID;\n const descendantIds = this.getDescendantIds(currentId);\n descendantIds.add(currentId);\n\n return this.allCategories.filter(c => !descendantIds.has(c.ID));\n }\n\n private getDescendantIds(categoryId: string): Set<string> {\n const descendants = new Set<string>();\n const findChildren = (parentId: string): void => {\n for (const cat of this.allCategories) {\n if (UUIDsEqual(cat.ParentID, parentId)) {\n descendants.add(cat.ID);\n findChildren(cat.ID);\n }\n }\n };\n findChildren(categoryId);\n return descendants;\n }\n\n public async open(category: MJCredentialCategoryEntity | null, preselectedParentId?: string): Promise<void> {\n this.isLoading = true;\n this.isOpen = true;\n this.category = category;\n this.isNew = !category || !category.ID;\n this.cdr.markForCheck();\n\n await this.loadCategories();\n this.resetForm();\n\n if (category && category.ID) {\n this.populateFromCategory(category);\n } else if (preselectedParentId) {\n this.parentId = preselectedParentId;\n }\n\n this.isLoading = false;\n this.cdr.markForCheck();\n }\n\n private async loadCategories(): Promise<void> {\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJCredentialCategoryEntity>({\n EntityName: 'MJ: Credential Categories',\n OrderBy: 'Name',\n ResultType: 'entity_object'\n });\n\n if (result.Success) {\n this.allCategories = result.Results;\n }\n } catch (error) {\n console.error('Error loading categories:', error);\n }\n this.cdr.markForCheck();\n }\n\n private resetForm(): void {\n this.name = '';\n this.description = '';\n this.parentId = '';\n this.iconClass = '';\n }\n\n private populateFromCategory(category: MJCredentialCategoryEntity): void {\n this.name = category.Name || '';\n this.description = category.Description || '';\n this.parentId = category.ParentID || '';\n this.iconClass = category.IconClass || '';\n }\n\n public selectIcon(icon: string): void {\n this.iconClass = icon;\n this.cdr.markForCheck();\n }\n\n public async save(): Promise<void> {\n if (!this.canSave) {\n MJNotificationService.Instance.CreateSimpleNotification('Please enter a category name', 'warning', 3000);\n return;\n }\n\n this.isSaving = true;\n this.cdr.markForCheck();\n\n try {\n let entity: MJCredentialCategoryEntity;\n\n if (this.isNew) {\n entity = await this._metadata.GetEntityObject<MJCredentialCategoryEntity>('MJ: Credential Categories');\n } else {\n entity = this.category!;\n }\n\n entity.Name = this.name.trim();\n entity.Description = this.description.trim() || null;\n entity.ParentID = this.parentId || null;\n entity.IconClass = this.iconClass.trim() || null;\n\n const success = await entity.Save();\n\n if (success) {\n const action = this.isNew ? 'created' : 'updated';\n MJNotificationService.Instance.CreateSimpleNotification(\n `Category \"${entity.Name}\" ${action} successfully`,\n 'success',\n 3000\n );\n this.saved.emit(entity);\n this.closePanel();\n } else {\n const errorMessage = entity.LatestResult?.Message || 'Unknown error';\n console.error('Save failed:', errorMessage);\n MJNotificationService.Instance.CreateSimpleNotification(\n `Failed to save category: ${errorMessage}`,\n 'error',\n 5000\n );\n }\n } catch (error) {\n console.error('Error saving category:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error saving category',\n 'error',\n 3000\n );\n } finally {\n this.isSaving = false;\n this.cdr.markForCheck();\n }\n }\n\n public async deleteCategory(): Promise<void> {\n if (this.isNew || !this.category) return;\n\n const confirmed = await this.confirmService.ConfirmDelete({ title: 'Delete Category', message: `Delete \"${this.category.Name}\"?`, detail: 'This action cannot be undone.' });\n if (!confirmed) return;\n\n this.isSaving = true;\n this.cdr.markForCheck();\n\n try {\n const success = await this.category.Delete();\n if (success) {\n MJNotificationService.Instance.CreateSimpleNotification(\n `Category \"${this.category.Name}\" deleted successfully`,\n 'success',\n 3000\n );\n this.deleted.emit(this.category.ID);\n this.closePanel();\n } else {\n const errorMessage = this.category.LatestResult?.Message || 'Unknown error';\n MJNotificationService.Instance.CreateSimpleNotification(\n `Failed to delete category: ${errorMessage}`,\n 'error',\n 5000\n );\n }\n } catch (error) {\n console.error('Error deleting category:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error deleting category',\n 'error',\n 3000\n );\n } finally {\n this.isSaving = false;\n this.cdr.markForCheck();\n }\n }\n\n public closePanel(): void {\n this.isOpen = false;\n this.category = null;\n this.resetForm();\n this.close.emit();\n this.cdr.markForCheck();\n }\n\n public onBackdropClick(event: MouseEvent): void {\n if ((event.target as HTMLElement).classList.contains('panel-backdrop')) {\n this.closePanel();\n }\n }\n\n public getParentPath(categoryId: string): string {\n const parts: string[] = [];\n let current = this.allCategories.find(c => UUIDsEqual(c.ID, categoryId));\n\n while (current) {\n parts.unshift(current.Name);\n current = current.ParentID ? this.allCategories.find(c => UUIDsEqual(c.ID, current!.ParentID)) : undefined;\n }\n\n return parts.join(' / ');\n }\n}\n","@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]=\"'color-mix(in srgb, var(--mj-brand-primary) 8%, var(--mj-bg-surface))'\" [style.color]=\"'var(--mj-brand-primary)'\">\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"]}
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,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;;;;AASrE,MAAM,OAAO,oCAAqC,SAAQ,oBAAoB;IAuCtD;IAAgC;IAtC3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,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,OAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC/G,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;wGAjQQ,oCAAoC;4FAApC,oCAAoC,0OCfjD,4sMAsKA;;4FDvJa,oCAAoC;kBAPhD,SAAS;iCACI,KAAK,YACL,mCAAmC,mBAG5B,uBAAuB,CAAC,MAAM;;sBAG9C,KAAK;;sBACL,KAAK;;sBAEL,MAAM;;sBACN,MAAM;;sBACN,MAAM","sourcesContent":["import { Component, Input, Output, EventEmitter, ChangeDetectorRef, ChangeDetectionStrategy, OnInit } from '@angular/core';\nimport { MJCredentialCategoryEntity } from '@memberjunction/core-entities';\nimport { RunView } from '@memberjunction/core';\nimport { UUIDsEqual } from '@memberjunction/global';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { MJConfirmService } from '@memberjunction/ng-ui-components';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\n\n@Component({\n standalone: false,\n selector: 'mj-credential-category-edit-panel',\n templateUrl: './credential-category-edit-panel.component.html',\n styleUrls: ['./credential-category-edit-panel.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class CredentialCategoryEditPanelComponent extends BaseAngularComponent implements OnInit {\n @Input() category: MJCredentialCategoryEntity | null = null;\n @Input() isOpen = false;\n\n @Output() close = new EventEmitter<void>();\n @Output() saved = new EventEmitter<MJCredentialCategoryEntity>();\n @Output() deleted = new EventEmitter<string>();\n\n public isLoading = false;\n public isSaving = false;\n public isNew = false;\n\n // All categories for parent selection\n public allCategories: MJCredentialCategoryEntity[] = [];\n\n // Form fields\n public name = '';\n public description = '';\n public parentId = '';\n public iconClass = '';\n\n // Icon suggestions\n public iconSuggestions: { icon: string; label: string }[] = [\n { icon: 'fa-solid fa-folder', label: 'Folder' },\n { icon: 'fa-solid fa-lock', label: 'Lock' },\n { icon: 'fa-solid fa-shield-halved', label: 'Shield' },\n { icon: 'fa-solid fa-key', label: 'Key' },\n { icon: 'fa-solid fa-cloud', label: 'Cloud' },\n { icon: 'fa-solid fa-database', label: 'Database' },\n { icon: 'fa-solid fa-brain', label: 'AI' },\n { icon: 'fa-solid fa-envelope', label: 'Email' },\n { icon: 'fa-solid fa-plug', label: 'Integration' },\n { icon: 'fa-solid fa-server', label: 'Server' },\n { icon: 'fa-solid fa-code', label: 'Code' },\n { icon: 'fa-solid fa-globe', label: 'Web' }\n ];\n\n private get _metadata() { return this.ProviderToUse; }\n\n constructor(private cdr: ChangeDetectorRef, private confirmService: MJConfirmService) { super(); }\n\n ngOnInit(): void {\n this.loadCategories();\n }\n\n public get panelTitle(): string {\n return this.isNew ? 'Create Category' : 'Edit Category';\n }\n\n public get canSave(): boolean {\n return this.name.trim().length > 0;\n }\n\n public get availableParentCategories(): MJCredentialCategoryEntity[] {\n // Exclude the current category and its descendants from parent options\n if (!this.category || this.isNew) {\n return this.allCategories;\n }\n\n const currentId = this.category.ID;\n const descendantIds = this.getDescendantIds(currentId);\n descendantIds.add(currentId);\n\n return this.allCategories.filter(c => !descendantIds.has(c.ID));\n }\n\n private getDescendantIds(categoryId: string): Set<string> {\n const descendants = new Set<string>();\n const findChildren = (parentId: string): void => {\n for (const cat of this.allCategories) {\n if (UUIDsEqual(cat.ParentID, parentId)) {\n descendants.add(cat.ID);\n findChildren(cat.ID);\n }\n }\n };\n findChildren(categoryId);\n return descendants;\n }\n\n public async open(category: MJCredentialCategoryEntity | null, preselectedParentId?: string): Promise<void> {\n this.isLoading = true;\n this.isOpen = true;\n this.category = category;\n this.isNew = !category || !category.ID;\n this.cdr.markForCheck();\n\n await this.loadCategories();\n this.resetForm();\n\n if (category && category.ID) {\n this.populateFromCategory(category);\n } else if (preselectedParentId) {\n this.parentId = preselectedParentId;\n }\n\n this.isLoading = false;\n this.cdr.markForCheck();\n }\n\n private async loadCategories(): Promise<void> {\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJCredentialCategoryEntity>({\n EntityName: 'MJ: Credential Categories',\n OrderBy: 'Name',\n ResultType: 'entity_object'\n });\n\n if (result.Success) {\n this.allCategories = result.Results;\n }\n } catch (error) {\n console.error('Error loading categories:', error);\n }\n this.cdr.markForCheck();\n }\n\n private resetForm(): void {\n this.name = '';\n this.description = '';\n this.parentId = '';\n this.iconClass = '';\n }\n\n private populateFromCategory(category: MJCredentialCategoryEntity): void {\n this.name = category.Name || '';\n this.description = category.Description || '';\n this.parentId = category.ParentID || '';\n this.iconClass = category.IconClass || '';\n }\n\n public selectIcon(icon: string): void {\n this.iconClass = icon;\n this.cdr.markForCheck();\n }\n\n public async save(): Promise<void> {\n if (!this.canSave) {\n MJNotificationService.Instance.CreateSimpleNotification('Please enter a category name', 'warning', 3000);\n return;\n }\n\n this.isSaving = true;\n this.cdr.markForCheck();\n\n try {\n let entity: MJCredentialCategoryEntity;\n\n if (this.isNew) {\n entity = await this._metadata.GetEntityObject<MJCredentialCategoryEntity>('MJ: Credential Categories');\n } else {\n entity = this.category!;\n }\n\n entity.Name = this.name.trim();\n entity.Description = this.description.trim() || null;\n entity.ParentID = this.parentId || null;\n entity.IconClass = this.iconClass.trim() || null;\n\n const success = await entity.Save();\n\n if (success) {\n const action = this.isNew ? 'created' : 'updated';\n MJNotificationService.Instance.CreateSimpleNotification(\n `Category \"${entity.Name}\" ${action} successfully`,\n 'success',\n 3000\n );\n this.saved.emit(entity);\n this.closePanel();\n } else {\n const errorMessage = entity.LatestResult?.Message || 'Unknown error';\n console.error('Save failed:', errorMessage);\n MJNotificationService.Instance.CreateSimpleNotification(\n `Failed to save category: ${errorMessage}`,\n 'error',\n 5000\n );\n }\n } catch (error) {\n console.error('Error saving category:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error saving category',\n 'error',\n 3000\n );\n } finally {\n this.isSaving = false;\n this.cdr.markForCheck();\n }\n }\n\n public async deleteCategory(): Promise<void> {\n if (this.isNew || !this.category) return;\n\n const confirmed = await this.confirmService.ConfirmDelete({ title: 'Delete Category', message: `Delete \"${this.category.Name}\"?`, detail: 'This action cannot be undone.' });\n if (!confirmed) return;\n\n this.isSaving = true;\n this.cdr.markForCheck();\n\n try {\n const success = await this.category.Delete();\n if (success) {\n MJNotificationService.Instance.CreateSimpleNotification(\n `Category \"${this.category.Name}\" deleted successfully`,\n 'success',\n 3000\n );\n this.deleted.emit(this.category.ID);\n this.closePanel();\n } else {\n const errorMessage = this.category.LatestResult?.Message || 'Unknown error';\n MJNotificationService.Instance.CreateSimpleNotification(\n `Failed to delete category: ${errorMessage}`,\n 'error',\n 5000\n );\n }\n } catch (error) {\n console.error('Error deleting category:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error deleting category',\n 'error',\n 3000\n );\n } finally {\n this.isSaving = false;\n this.cdr.markForCheck();\n }\n }\n\n public closePanel(): void {\n this.isOpen = false;\n this.category = null;\n this.resetForm();\n this.close.emit();\n this.cdr.markForCheck();\n }\n\n public onBackdropClick(event: MouseEvent): void {\n if ((event.target as HTMLElement).classList.contains('panel-backdrop')) {\n this.closePanel();\n }\n }\n\n public getParentPath(categoryId: string): string {\n const parts: string[] = [];\n let current = this.allCategories.find(c => UUIDsEqual(c.ID, categoryId));\n\n while (current) {\n parts.unshift(current.Name);\n current = current.ParentID ? this.allCategories.find(c => UUIDsEqual(c.ID, current!.ParentID)) : undefined;\n }\n\n return parts.join(' / ');\n }\n}\n","@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]=\"'color-mix(in srgb, var(--mj-brand-primary) 8%, var(--mj-bg-surface))'\" [style.color]=\"'var(--mj-brand-primary)'\">\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"]}