@memberjunction/ng-credentials 0.0.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/lib/credentials.module.d.ts +16 -0
  2. package/dist/lib/credentials.module.d.ts.map +1 -0
  3. package/dist/lib/credentials.module.js +76 -0
  4. package/dist/lib/credentials.module.js.map +1 -0
  5. package/dist/lib/dialogs/credential-dialog.component.d.ts +67 -0
  6. package/dist/lib/dialogs/credential-dialog.component.d.ts.map +1 -0
  7. package/dist/lib/dialogs/credential-dialog.component.js +185 -0
  8. package/dist/lib/dialogs/credential-dialog.component.js.map +1 -0
  9. package/dist/lib/panels/credential-category-edit-panel/credential-category-edit-panel.component.d.ts +43 -0
  10. package/dist/lib/panels/credential-category-edit-panel/credential-category-edit-panel.component.d.ts.map +1 -0
  11. package/dist/lib/panels/credential-category-edit-panel/credential-category-edit-panel.component.js +233 -0
  12. package/dist/lib/panels/credential-category-edit-panel/credential-category-edit-panel.component.js.map +1 -0
  13. package/dist/lib/panels/credential-edit-panel/credential-edit-panel.component.d.ts +95 -0
  14. package/dist/lib/panels/credential-edit-panel/credential-edit-panel.component.d.ts.map +1 -0
  15. package/dist/lib/panels/credential-edit-panel/credential-edit-panel.component.js +529 -0
  16. package/dist/lib/panels/credential-edit-panel/credential-edit-panel.component.js.map +1 -0
  17. package/dist/lib/panels/credential-type-edit-panel/credential-type-edit-panel.component.d.ts +55 -0
  18. package/dist/lib/panels/credential-type-edit-panel/credential-type-edit-panel.component.d.ts.map +1 -0
  19. package/dist/lib/panels/credential-type-edit-panel/credential-type-edit-panel.component.js +274 -0
  20. package/dist/lib/panels/credential-type-edit-panel/credential-type-edit-panel.component.js.map +1 -0
  21. package/dist/lib/services/credential-dialog.service.d.ts +89 -0
  22. package/dist/lib/services/credential-dialog.service.d.ts.map +1 -0
  23. package/dist/lib/services/credential-dialog.service.js +166 -0
  24. package/dist/lib/services/credential-dialog.service.js.map +1 -0
  25. package/dist/public-api.d.ts +15 -0
  26. package/dist/public-api.d.ts.map +1 -0
  27. package/dist/public-api.js +19 -0
  28. package/dist/public-api.js.map +1 -0
  29. package/package.json +43 -6
  30. package/README.md +0 -45
@@ -0,0 +1,16 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./panels/credential-edit-panel/credential-edit-panel.component";
3
+ import * as i2 from "./panels/credential-type-edit-panel/credential-type-edit-panel.component";
4
+ import * as i3 from "./panels/credential-category-edit-panel/credential-category-edit-panel.component";
5
+ import * as i4 from "./dialogs/credential-dialog.component";
6
+ import * as i5 from "@angular/common";
7
+ import * as i6 from "@angular/forms";
8
+ import * as i7 from "@progress/kendo-angular-dialog";
9
+ import * as i8 from "@progress/kendo-angular-buttons";
10
+ import * as i9 from "@memberjunction/ng-shared-generic";
11
+ export declare class CredentialsModule {
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<CredentialsModule, never>;
13
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CredentialsModule, [typeof i1.CredentialEditPanelComponent, typeof i2.CredentialTypeEditPanelComponent, typeof i3.CredentialCategoryEditPanelComponent, typeof i4.CredentialDialogComponent], [typeof i5.CommonModule, typeof i6.FormsModule, typeof i7.DialogModule, typeof i8.ButtonsModule, typeof i9.SharedGenericModule], [typeof i1.CredentialEditPanelComponent, typeof i2.CredentialTypeEditPanelComponent, typeof i3.CredentialCategoryEditPanelComponent, typeof i4.CredentialDialogComponent]>;
14
+ static ɵinj: i0.ɵɵInjectorDeclaration<CredentialsModule>;
15
+ }
16
+ //# sourceMappingURL=credentials.module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentials.module.d.ts","sourceRoot":"","sources":["../../src/lib/credentials.module.ts"],"names":[],"mappings":";;;;;;;;;;AA2BA,qBAyBa,iBAAiB;yCAAjB,iBAAiB;0CAAjB,iBAAiB;0CAAjB,iBAAiB;CAAI"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * @fileoverview Credentials Module
3
+ *
4
+ * Angular module providing reusable credential management components.
5
+ * Includes panels and dialogs for creating and editing credentials,
6
+ * credential types, and credential categories.
7
+ */
8
+ import { NgModule } from '@angular/core';
9
+ import { CommonModule } from '@angular/common';
10
+ import { FormsModule } from '@angular/forms';
11
+ // Kendo UI Angular imports
12
+ import { DialogModule } from '@progress/kendo-angular-dialog';
13
+ import { ButtonsModule } from '@progress/kendo-angular-buttons';
14
+ // MemberJunction modules
15
+ import { SharedGenericModule } from '@memberjunction/ng-shared-generic';
16
+ // Panel components
17
+ import { CredentialEditPanelComponent } from './panels/credential-edit-panel/credential-edit-panel.component';
18
+ import { CredentialTypeEditPanelComponent } from './panels/credential-type-edit-panel/credential-type-edit-panel.component';
19
+ import { CredentialCategoryEditPanelComponent } from './panels/credential-category-edit-panel/credential-category-edit-panel.component';
20
+ // Dialog components
21
+ import { CredentialDialogComponent } from './dialogs/credential-dialog.component';
22
+ import * as i0 from "@angular/core";
23
+ export class CredentialsModule {
24
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: CredentialsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
25
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.3", ngImport: i0, type: CredentialsModule, declarations: [
26
+ // Panels
27
+ CredentialEditPanelComponent,
28
+ CredentialTypeEditPanelComponent,
29
+ CredentialCategoryEditPanelComponent,
30
+ // Dialogs
31
+ CredentialDialogComponent], imports: [CommonModule,
32
+ FormsModule,
33
+ DialogModule,
34
+ ButtonsModule,
35
+ SharedGenericModule], exports: [
36
+ // Panels
37
+ CredentialEditPanelComponent,
38
+ CredentialTypeEditPanelComponent,
39
+ CredentialCategoryEditPanelComponent,
40
+ // Dialogs
41
+ CredentialDialogComponent] });
42
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: CredentialsModule, imports: [CommonModule,
43
+ FormsModule,
44
+ DialogModule,
45
+ ButtonsModule,
46
+ SharedGenericModule] });
47
+ }
48
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: CredentialsModule, decorators: [{
49
+ type: NgModule,
50
+ args: [{
51
+ declarations: [
52
+ // Panels
53
+ CredentialEditPanelComponent,
54
+ CredentialTypeEditPanelComponent,
55
+ CredentialCategoryEditPanelComponent,
56
+ // Dialogs
57
+ CredentialDialogComponent
58
+ ],
59
+ imports: [
60
+ CommonModule,
61
+ FormsModule,
62
+ DialogModule,
63
+ ButtonsModule,
64
+ SharedGenericModule
65
+ ],
66
+ exports: [
67
+ // Panels
68
+ CredentialEditPanelComponent,
69
+ CredentialTypeEditPanelComponent,
70
+ CredentialCategoryEditPanelComponent,
71
+ // Dialogs
72
+ CredentialDialogComponent
73
+ ]
74
+ }]
75
+ }] });
76
+ //# sourceMappingURL=credentials.module.js.map
@@ -0,0 +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,2BAA2B;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,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;;AA2BlF,MAAM,OAAO,iBAAiB;uGAAjB,iBAAiB;wGAAjB,iBAAiB;YAvBtB,SAAS;YACT,4BAA4B;YAC5B,gCAAgC;YAChC,oCAAoC;YACpC,UAAU;YACV,yBAAyB,aAGzB,YAAY;YACZ,WAAW;YACX,YAAY;YACZ,aAAa;YACb,mBAAmB;YAGnB,SAAS;YACT,4BAA4B;YAC5B,gCAAgC;YAChC,oCAAoC;YACpC,UAAU;YACV,yBAAyB;wGAGpB,iBAAiB,YAftB,YAAY;YACZ,WAAW;YACX,YAAY;YACZ,aAAa;YACb,mBAAmB;;2FAWd,iBAAiB;kBAzB7B,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,YAAY;wBACZ,aAAa;wBACb,mBAAmB;qBACtB;oBACD,OAAO,EAAE;wBACL,SAAS;wBACT,4BAA4B;wBAC5B,gCAAgC;wBAChC,oCAAoC;wBACpC,UAAU;wBACV,yBAAyB;qBAC5B;iBACJ"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * @fileoverview Credential Dialog Component
3
+ *
4
+ * A dialog wrapper for the CredentialEditPanelComponent that provides
5
+ * a convenient way to create or edit credentials in a modal dialog.
6
+ */
7
+ import { EventEmitter, ChangeDetectorRef, OnInit, OnChanges, SimpleChanges } from '@angular/core';
8
+ import { CredentialEntity, CredentialTypeEntity } from '@memberjunction/core-entities';
9
+ import { CredentialEditPanelComponent } from '../panels/credential-edit-panel/credential-edit-panel.component';
10
+ import * as i0 from "@angular/core";
11
+ /**
12
+ * Configuration options for opening the credential dialog
13
+ */
14
+ export interface CredentialDialogOptions {
15
+ /** The credential to edit, or null for creating a new credential */
16
+ credential?: CredentialEntity | null;
17
+ /** Pre-selected credential type ID for new credentials */
18
+ preselectedTypeId?: string;
19
+ /** Pre-selected category ID for new credentials */
20
+ preselectedCategoryId?: string;
21
+ /** Dialog title override */
22
+ title?: string;
23
+ /** Dialog width in pixels */
24
+ width?: number;
25
+ }
26
+ /**
27
+ * Result returned when the dialog closes
28
+ */
29
+ export interface CredentialDialogResult {
30
+ /** Whether a credential was saved or deleted */
31
+ success: boolean;
32
+ /** The saved credential entity (if save was successful) */
33
+ credential?: CredentialEntity;
34
+ /** The ID of the deleted credential (if delete was successful) */
35
+ deletedId?: string;
36
+ /** The action that was taken */
37
+ action: 'saved' | 'deleted' | 'cancelled';
38
+ }
39
+ export declare class CredentialDialogComponent implements OnInit, OnChanges {
40
+ private cdr;
41
+ editPanel: CredentialEditPanelComponent;
42
+ Visible: boolean;
43
+ Credential: CredentialEntity | null;
44
+ PreselectedTypeId: string | undefined;
45
+ PreselectedCategoryId: string | undefined;
46
+ Title: string | undefined;
47
+ Width: number;
48
+ close: EventEmitter<CredentialDialogResult>;
49
+ IsLoading: boolean;
50
+ credentialTypes: CredentialTypeEntity[];
51
+ private _dialogTitle;
52
+ constructor(cdr: ChangeDetectorRef);
53
+ ngOnInit(): void;
54
+ ngOnChanges(changes: SimpleChanges): void;
55
+ get dialogTitle(): string;
56
+ /**
57
+ * Opens the dialog with the specified options
58
+ */
59
+ open(options?: CredentialDialogOptions): Promise<void>;
60
+ private loadCredentialTypes;
61
+ onSaved(credential: CredentialEntity): void;
62
+ onDeleted(credentialId: string): void;
63
+ onCancel(): void;
64
+ static ɵfac: i0.ɵɵFactoryDeclaration<CredentialDialogComponent, never>;
65
+ static ɵcmp: i0.ɵɵComponentDeclaration<CredentialDialogComponent, "mj-credential-dialog", never, { "Visible": { "alias": "Visible"; "required": false; }; "Credential": { "alias": "Credential"; "required": false; }; "PreselectedTypeId": { "alias": "PreselectedTypeId"; "required": false; }; "PreselectedCategoryId": { "alias": "PreselectedCategoryId"; "required": false; }; "Title": { "alias": "Title"; "required": false; }; "Width": { "alias": "Width"; "required": false; }; }, { "close": "close"; }, never, never, false, never>;
66
+ }
67
+ //# sourceMappingURL=credential-dialog.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-dialog.component.d.ts","sourceRoot":"","sources":["../../../src/lib/dialogs/credential-dialog.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAA4B,YAAY,EAAE,iBAAiB,EAAsC,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAChK,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAEvF,OAAO,EAAE,4BAA4B,EAAE,MAAM,iEAAiE,CAAC;;AAE/G;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,oEAAoE;IACpE,UAAU,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACrC,0DAA0D;IAC1D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mDAAmD;IACnD,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;CAC7C;AAED,qBAsCa,yBAA0B,YAAW,MAAM,EAAE,SAAS;IAiBnD,OAAO,CAAC,GAAG;IAhBC,SAAS,EAAG,4BAA4B,CAAC;IAExD,OAAO,UAAS;IAChB,UAAU,EAAE,gBAAgB,GAAG,IAAI,CAAQ;IAC3C,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,KAAK,SAAO;IAEX,KAAK,uCAA8C;IAEtD,SAAS,UAAS;IAClB,eAAe,EAAE,oBAAoB,EAAE,CAAM;IAEpD,OAAO,CAAC,YAAY,CAAgB;gBAEhB,GAAG,EAAE,iBAAiB;IAE1C,QAAQ,IAAI,IAAI;IAMhB,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAiBzC,IAAW,WAAW,IAAI,MAAM,CAK/B;IAED;;OAEG;IACU,IAAI,CAAC,OAAO,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;YAoBrD,mBAAmB;IA2B1B,OAAO,CAAC,UAAU,EAAE,gBAAgB,GAAG,IAAI;IAU3C,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAUrC,QAAQ,IAAI,IAAI;yCAvHd,yBAAyB;2CAAzB,yBAAyB;CA+HrC"}
@@ -0,0 +1,185 @@
1
+ /**
2
+ * @fileoverview Credential Dialog Component
3
+ *
4
+ * A dialog wrapper for the CredentialEditPanelComponent that provides
5
+ * a convenient way to create or edit credentials in a modal dialog.
6
+ */
7
+ import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy, ViewChild } from '@angular/core';
8
+ import { RunView } from '@memberjunction/core';
9
+ import * as i0 from "@angular/core";
10
+ import * as i1 from "@memberjunction/ng-shared-generic";
11
+ import * as i2 from "../panels/credential-edit-panel/credential-edit-panel.component";
12
+ export class CredentialDialogComponent {
13
+ cdr;
14
+ editPanel;
15
+ Visible = false;
16
+ Credential = null;
17
+ PreselectedTypeId;
18
+ PreselectedCategoryId;
19
+ Title;
20
+ Width = 600;
21
+ close = new EventEmitter();
22
+ IsLoading = false;
23
+ credentialTypes = [];
24
+ _dialogTitle = 'Credential';
25
+ constructor(cdr) {
26
+ this.cdr = cdr;
27
+ }
28
+ ngOnInit() {
29
+ if (this.Visible) {
30
+ this.loadCredentialTypes();
31
+ }
32
+ }
33
+ ngOnChanges(changes) {
34
+ if (changes['Visible'] && changes['Visible'].currentValue === true) {
35
+ // When dialog becomes visible, load credential types and initialize the panel
36
+ this.loadCredentialTypes().then(() => {
37
+ // Wait for next change detection cycle to ensure panel is rendered
38
+ // (panel is only rendered when IsLoading is false)
39
+ this.cdr.detectChanges();
40
+ // Use setTimeout to ensure ViewChild is resolved after render
41
+ setTimeout(() => {
42
+ if (this.editPanel) {
43
+ this.editPanel.open(this.Credential, this.PreselectedTypeId, this.PreselectedCategoryId);
44
+ }
45
+ }, 0);
46
+ });
47
+ }
48
+ }
49
+ get dialogTitle() {
50
+ if (this.Title) {
51
+ return this.Title;
52
+ }
53
+ return this.Credential?.ID ? 'Edit Credential' : 'Create Credential';
54
+ }
55
+ /**
56
+ * Opens the dialog with the specified options
57
+ */
58
+ async open(options) {
59
+ this.Credential = options?.credential ?? null;
60
+ this.PreselectedTypeId = options?.preselectedTypeId;
61
+ this.PreselectedCategoryId = options?.preselectedCategoryId;
62
+ this.Title = options?.title;
63
+ if (options?.width) {
64
+ this.Width = options.width;
65
+ }
66
+ this.Visible = true;
67
+ this.cdr.markForCheck();
68
+ await this.loadCredentialTypes();
69
+ // Initialize the edit panel after types are loaded
70
+ if (this.editPanel) {
71
+ await this.editPanel.open(this.Credential, this.PreselectedTypeId, this.PreselectedCategoryId);
72
+ }
73
+ }
74
+ async loadCredentialTypes() {
75
+ if (this.credentialTypes.length > 0) {
76
+ return; // Already loaded
77
+ }
78
+ this.IsLoading = true;
79
+ this.cdr.markForCheck();
80
+ try {
81
+ const rv = new RunView();
82
+ const result = await rv.RunView({
83
+ EntityName: 'MJ: Credential Types',
84
+ OrderBy: 'Category, Name',
85
+ ResultType: 'entity_object'
86
+ });
87
+ if (result.Success) {
88
+ this.credentialTypes = result.Results;
89
+ }
90
+ }
91
+ catch (error) {
92
+ console.error('Error loading credential types:', error);
93
+ }
94
+ finally {
95
+ this.IsLoading = false;
96
+ this.cdr.markForCheck();
97
+ }
98
+ }
99
+ onSaved(credential) {
100
+ this.Visible = false;
101
+ this.close.emit({
102
+ success: true,
103
+ credential,
104
+ action: 'saved'
105
+ });
106
+ this.cdr.markForCheck();
107
+ }
108
+ onDeleted(credentialId) {
109
+ this.Visible = false;
110
+ this.close.emit({
111
+ success: true,
112
+ deletedId: credentialId,
113
+ action: 'deleted'
114
+ });
115
+ this.cdr.markForCheck();
116
+ }
117
+ onCancel() {
118
+ this.Visible = false;
119
+ this.close.emit({
120
+ success: false,
121
+ action: 'cancelled'
122
+ });
123
+ this.cdr.markForCheck();
124
+ }
125
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: CredentialDialogComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
126
+ 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 }], usesOnChanges: true, ngImport: i0, template: `
127
+ @if (Visible) {
128
+ @if (IsLoading) {
129
+ <div class="loading-backdrop">
130
+ <mj-loading text="Loading credential types..."></mj-loading>
131
+ </div>
132
+ } @else {
133
+ <mj-credential-edit-panel
134
+ #editPanel
135
+ [credential]="Credential"
136
+ [credentialTypes]="credentialTypes"
137
+ [isOpen]="Visible"
138
+ (saved)="onSaved($event)"
139
+ (deleted)="onDeleted($event)"
140
+ (close)="onCancel()">
141
+ </mj-credential-edit-panel>
142
+ }
143
+ }
144
+ `, 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 });
145
+ }
146
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: CredentialDialogComponent, decorators: [{
147
+ type: Component,
148
+ args: [{ standalone: false, selector: 'mj-credential-dialog', template: `
149
+ @if (Visible) {
150
+ @if (IsLoading) {
151
+ <div class="loading-backdrop">
152
+ <mj-loading text="Loading credential types..."></mj-loading>
153
+ </div>
154
+ } @else {
155
+ <mj-credential-edit-panel
156
+ #editPanel
157
+ [credential]="Credential"
158
+ [credentialTypes]="credentialTypes"
159
+ [isOpen]="Visible"
160
+ (saved)="onSaved($event)"
161
+ (deleted)="onDeleted($event)"
162
+ (close)="onCancel()">
163
+ </mj-credential-edit-panel>
164
+ }
165
+ }
166
+ `, changeDetection: ChangeDetectionStrategy.OnPush, 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 "] }]
167
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { editPanel: [{
168
+ type: ViewChild,
169
+ args: ['editPanel']
170
+ }], Visible: [{
171
+ type: Input
172
+ }], Credential: [{
173
+ type: Input
174
+ }], PreselectedTypeId: [{
175
+ type: Input
176
+ }], PreselectedCategoryId: [{
177
+ type: Input
178
+ }], Title: [{
179
+ type: Input
180
+ }], Width: [{
181
+ type: Input
182
+ }], close: [{
183
+ type: Output
184
+ }] } });
185
+ //# sourceMappingURL=credential-dialog.component.js.map
@@ -0,0 +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;AAEhK,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;;;;AAuE/C,MAAM,OAAO,yBAAyB;IAiBd;IAhBI,SAAS,CAAgC;IAExD,OAAO,GAAG,KAAK,CAAC;IAChB,UAAU,GAA4B,IAAI,CAAC;IAC3C,iBAAiB,CAAqB;IACtC,qBAAqB,CAAqB;IAC1C,KAAK,CAAqB;IAC1B,KAAK,GAAG,GAAG,CAAC;IAEX,KAAK,GAAG,IAAI,YAAY,EAA0B,CAAC;IAEtD,SAAS,GAAG,KAAK,CAAC;IAClB,eAAe,GAA2B,EAAE,CAAC;IAE5C,YAAY,GAAG,YAAY,CAAC;IAEpC,YAAoB,GAAsB;QAAtB,QAAG,GAAH,GAAG,CAAmB;IAAG,CAAC;IAE9C,QAAQ;QACJ,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC/B,CAAC;IACL,CAAC;IAED,WAAW,CAAC,OAAsB;QAC9B,IAAI,OAAO,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC,YAAY,KAAK,IAAI,EAAE,CAAC;YACjE,8EAA8E;YAC9E,IAAI,CAAC,mBAAmB,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;gBACjC,mEAAmE;gBACnE,mDAAmD;gBACnD,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;gBACzB,8DAA8D;gBAC9D,UAAU,CAAC,GAAG,EAAE;oBACZ,IAAI,IAAI,CAAC,SAAS,EA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AAY,EAAE,CAAC;IAC5B,CAAC;IAEM,QAAQ;QACX,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;YACZ,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,WAAW;SACtB,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;IAC5B,CAAC;uGA9HQ,yBAAyB;2FAAzB,yBAAyB,6ZAnCxB;;;;;;;;;;;;;;;;;;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"}
@@ -0,0 +1,43 @@
1
+ import { EventEmitter, ChangeDetectorRef, OnInit } from '@angular/core';
2
+ import { CredentialCategoryEntity } from '@memberjunction/core-entities';
3
+ import * as i0 from "@angular/core";
4
+ export declare class CredentialCategoryEditPanelComponent implements OnInit {
5
+ private cdr;
6
+ category: CredentialCategoryEntity | null;
7
+ isOpen: boolean;
8
+ close: EventEmitter<void>;
9
+ saved: EventEmitter<CredentialCategoryEntity>;
10
+ deleted: EventEmitter<string>;
11
+ isLoading: boolean;
12
+ isSaving: boolean;
13
+ isNew: boolean;
14
+ allCategories: CredentialCategoryEntity[];
15
+ name: string;
16
+ description: string;
17
+ parentId: string;
18
+ iconClass: string;
19
+ iconSuggestions: {
20
+ icon: string;
21
+ label: string;
22
+ }[];
23
+ private _metadata;
24
+ constructor(cdr: ChangeDetectorRef);
25
+ ngOnInit(): void;
26
+ get panelTitle(): string;
27
+ get canSave(): boolean;
28
+ get availableParentCategories(): CredentialCategoryEntity[];
29
+ private getDescendantIds;
30
+ open(category: CredentialCategoryEntity | null, preselectedParentId?: string): Promise<void>;
31
+ private loadCategories;
32
+ private resetForm;
33
+ private populateFromCategory;
34
+ selectIcon(icon: string): void;
35
+ save(): Promise<void>;
36
+ deleteCategory(): Promise<void>;
37
+ closePanel(): void;
38
+ onBackdropClick(event: MouseEvent): void;
39
+ getParentPath(categoryId: string): string;
40
+ static ɵfac: i0.ɵɵFactoryDeclaration<CredentialCategoryEditPanelComponent, never>;
41
+ static ɵcmp: i0.ɵɵComponentDeclaration<CredentialCategoryEditPanelComponent, "mj-credential-category-edit-panel", never, { "category": { "alias": "category"; "required": false; }; "isOpen": { "alias": "isOpen"; "required": false; }; }, { "close": "close"; "saved": "saved"; "deleted": "deleted"; }, never, never, false, never>;
42
+ }
43
+ //# sourceMappingURL=credential-category-edit-panel.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-category-edit-panel.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/panels/credential-category-edit-panel/credential-category-edit-panel.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAE,iBAAiB,EAA2B,MAAM,EAAE,MAAM,eAAe,CAAC;AAC3H,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;;AAIzE,qBAOa,oCAAqC,YAAW,MAAM;IAuCnD,OAAO,CAAC,GAAG;IAtCd,QAAQ,EAAE,wBAAwB,GAAG,IAAI,CAAQ;IACjD,MAAM,UAAS;IAEd,KAAK,qBAA4B;IACjC,KAAK,yCAAgD;IACrD,OAAO,uBAA8B;IAExC,SAAS,UAAS;IAClB,QAAQ,UAAS;IACjB,KAAK,UAAS;IAGd,aAAa,EAAE,wBAAwB,EAAE,CAAM;IAG/C,IAAI,SAAM;IACV,WAAW,SAAM;IACjB,QAAQ,SAAM;IACd,SAAS,SAAM;IAGf,eAAe,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAavD;IAEF,OAAO,CAAC,SAAS,CAAkB;gBAEf,G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