@memberjunction/ng-credentials 0.0.1 → 3.4.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 +21 -0
  2. package/dist/lib/credentials.module.d.ts.map +1 -0
  3. package/dist/lib/credentials.module.js +86 -0
  4. package/dist/lib/credentials.module.js.map +1 -0
  5. package/dist/lib/dialogs/credential-dialog.component.d.ts +68 -0
  6. package/dist/lib/dialogs/credential-dialog.component.d.ts.map +1 -0
  7. package/dist/lib/dialogs/credential-dialog.component.js +188 -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 +44 -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 +237 -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 +96 -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 +533 -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 +56 -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 +278 -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,21 @@
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
+ /**
17
+ * Loads all credential components to prevent tree-shaking.
18
+ * Call this from your application's module initialization.
19
+ */
20
+ export declare function LoadCredentialsModule(): void;
21
+ //# 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;AAElC;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAK5C"}
@@ -0,0 +1,86 @@
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, LoadCredentialEditPanel } from './panels/credential-edit-panel/credential-edit-panel.component';
18
+ import { CredentialTypeEditPanelComponent, LoadCredentialTypeEditPanel } from './panels/credential-type-edit-panel/credential-type-edit-panel.component';
19
+ import { CredentialCategoryEditPanelComponent, LoadCredentialCategoryEditPanel } from './panels/credential-category-edit-panel/credential-category-edit-panel.component';
20
+ // Dialog components
21
+ import { CredentialDialogComponent, LoadCredentialDialog } 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: "18.2.14", ngImport: i0, type: CredentialsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
25
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", 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: "18.2.14", ngImport: i0, type: CredentialsModule, imports: [CommonModule,
43
+ FormsModule,
44
+ DialogModule,
45
+ ButtonsModule,
46
+ SharedGenericModule] });
47
+ }
48
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", 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
+ /**
77
+ * Loads all credential components to prevent tree-shaking.
78
+ * Call this from your application's module initialization.
79
+ */
80
+ export function LoadCredentialsModule() {
81
+ LoadCredentialEditPanel();
82
+ LoadCredentialTypeEditPanel();
83
+ LoadCredentialCategoryEditPanel();
84
+ LoadCredentialDialog();
85
+ }
86
+ //# 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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J;;AAGD;;;GAGG;AACH,MAAM,UAAU,qBAAqB;IACjC,uBAAuB,EAAE,CAAC;IAC1B,2BAA2B,EAAE,CAAC;IAC9B,+BAA+B,EAAE,CAAC;IAClC,oBAAoB,EAAE,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,68 @@
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
+ export declare function LoadCredentialDialog(): void;
12
+ /**
13
+ * Configuration options for opening the credential dialog
14
+ */
15
+ export interface CredentialDialogOptions {
16
+ /** The credential to edit, or null for creating a new credential */
17
+ credential?: CredentialEntity | null;
18
+ /** Pre-selected credential type ID for new credentials */
19
+ preselectedTypeId?: string;
20
+ /** Pre-selected category ID for new credentials */
21
+ preselectedCategoryId?: string;
22
+ /** Dialog title override */
23
+ title?: string;
24
+ /** Dialog width in pixels */
25
+ width?: number;
26
+ }
27
+ /**
28
+ * Result returned when the dialog closes
29
+ */
30
+ export interface CredentialDialogResult {
31
+ /** Whether a credential was saved or deleted */
32
+ success: boolean;
33
+ /** The saved credential entity (if save was successful) */
34
+ credential?: CredentialEntity;
35
+ /** The ID of the deleted credential (if delete was successful) */
36
+ deletedId?: string;
37
+ /** The action that was taken */
38
+ action: 'saved' | 'deleted' | 'cancelled';
39
+ }
40
+ export declare class CredentialDialogComponent implements OnInit, OnChanges {
41
+ private cdr;
42
+ editPanel: CredentialEditPanelComponent;
43
+ Visible: boolean;
44
+ Credential: CredentialEntity | null;
45
+ PreselectedTypeId: string | undefined;
46
+ PreselectedCategoryId: string | undefined;
47
+ Title: string | undefined;
48
+ Width: number;
49
+ close: EventEmitter<CredentialDialogResult>;
50
+ IsLoading: boolean;
51
+ credentialTypes: CredentialTypeEntity[];
52
+ private _dialogTitle;
53
+ constructor(cdr: ChangeDetectorRef);
54
+ ngOnInit(): void;
55
+ ngOnChanges(changes: SimpleChanges): void;
56
+ get dialogTitle(): string;
57
+ /**
58
+ * Opens the dialog with the specified options
59
+ */
60
+ open(options?: CredentialDialogOptions): Promise<void>;
61
+ private loadCredentialTypes;
62
+ onSaved(credential: CredentialEntity): void;
63
+ onDeleted(credentialId: string): void;
64
+ onCancel(): void;
65
+ static ɵfac: i0.ɵɵFactoryDeclaration<CredentialDialogComponent, never>;
66
+ 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>;
67
+ }
68
+ //# 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,wBAAgB,oBAAoB,SAEnC;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,oEAAoE;IACpE,UAAU,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC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AAY,EAAE,MAAM,GAAG,IAAI;IAUrC,QAAQ,IAAI,IAAI;yCAvHd,yBAAyB;2CAAzB,yBAAyB;CA+HrC"}
@@ -0,0 +1,188 @@
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 function LoadCredentialDialog() {
13
+ // Prevents tree-shaking
14
+ }
15
+ export class CredentialDialogComponent {
16
+ cdr;
17
+ editPanel;
18
+ Visible = false;
19
+ Credential = null;
20
+ PreselectedTypeId;
21
+ PreselectedCategoryId;
22
+ Title;
23
+ Width = 600;
24
+ close = new EventEmitter();
25
+ IsLoading = false;
26
+ credentialTypes = [];
27
+ _dialogTitle = 'Credential';
28
+ constructor(cdr) {
29
+ this.cdr = cdr;
30
+ }
31
+ ngOnInit() {
32
+ if (this.Visible) {
33
+ this.loadCredentialTypes();
34
+ }
35
+ }
36
+ ngOnChanges(changes) {
37
+ if (changes['Visible'] && changes['Visible'].currentValue === true) {
38
+ // When dialog becomes visible, load credential types and initialize the panel
39
+ this.loadCredentialTypes().then(() => {
40
+ // Wait for next change detection cycle to ensure panel is rendered
41
+ // (panel is only rendered when IsLoading is false)
42
+ this.cdr.detectChanges();
43
+ // Use setTimeout to ensure ViewChild is resolved after render
44
+ setTimeout(() => {
45
+ if (this.editPanel) {
46
+ this.editPanel.open(this.Credential, this.PreselectedTypeId, this.PreselectedCategoryId);
47
+ }
48
+ }, 0);
49
+ });
50
+ }
51
+ }
52
+ get dialogTitle() {
53
+ if (this.Title) {
54
+ return this.Title;
55
+ }
56
+ return this.Credential?.ID ? 'Edit Credential' : 'Create Credential';
57
+ }
58
+ /**
59
+ * Opens the dialog with the specified options
60
+ */
61
+ async open(options) {
62
+ this.Credential = options?.credential ?? null;
63
+ this.PreselectedTypeId = options?.preselectedTypeId;
64
+ this.PreselectedCategoryId = options?.preselectedCategoryId;
65
+ this.Title = options?.title;
66
+ if (options?.width) {
67
+ this.Width = options.width;
68
+ }
69
+ this.Visible = true;
70
+ this.cdr.markForCheck();
71
+ await this.loadCredentialTypes();
72
+ // Initialize the edit panel after types are loaded
73
+ if (this.editPanel) {
74
+ await this.editPanel.open(this.Credential, this.PreselectedTypeId, this.PreselectedCategoryId);
75
+ }
76
+ }
77
+ async loadCredentialTypes() {
78
+ if (this.credentialTypes.length > 0) {
79
+ return; // Already loaded
80
+ }
81
+ this.IsLoading = true;
82
+ this.cdr.markForCheck();
83
+ try {
84
+ const rv = new RunView();
85
+ const result = await rv.RunView({
86
+ EntityName: 'MJ: Credential Types',
87
+ OrderBy: 'Category, Name',
88
+ ResultType: 'entity_object'
89
+ });
90
+ if (result.Success) {
91
+ this.credentialTypes = result.Results;
92
+ }
93
+ }
94
+ catch (error) {
95
+ console.error('Error loading credential types:', error);
96
+ }
97
+ finally {
98
+ this.IsLoading = false;
99
+ this.cdr.markForCheck();
100
+ }
101
+ }
102
+ onSaved(credential) {
103
+ this.Visible = false;
104
+ this.close.emit({
105
+ success: true,
106
+ credential,
107
+ action: 'saved'
108
+ });
109
+ this.cdr.markForCheck();
110
+ }
111
+ onDeleted(credentialId) {
112
+ this.Visible = false;
113
+ this.close.emit({
114
+ success: true,
115
+ deletedId: credentialId,
116
+ action: 'deleted'
117
+ });
118
+ this.cdr.markForCheck();
119
+ }
120
+ onCancel() {
121
+ this.Visible = false;
122
+ this.close.emit({
123
+ success: false,
124
+ action: 'cancelled'
125
+ });
126
+ this.cdr.markForCheck();
127
+ }
128
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CredentialDialogComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
129
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: CredentialDialogComponent, 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: `
130
+ @if (Visible) {
131
+ @if (IsLoading) {
132
+ <div class="loading-backdrop">
133
+ <mj-loading text="Loading credential types..."></mj-loading>
134
+ </div>
135
+ } @else {
136
+ <mj-credential-edit-panel
137
+ #editPanel
138
+ [credential]="Credential"
139
+ [credentialTypes]="credentialTypes"
140
+ [isOpen]="Visible"
141
+ (saved)="onSaved($event)"
142
+ (deleted)="onDeleted($event)"
143
+ (close)="onCancel()">
144
+ </mj-credential-edit-panel>
145
+ }
146
+ }
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
+ }
149
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CredentialDialogComponent, decorators: [{
150
+ type: Component,
151
+ args: [{ selector: 'mj-credential-dialog', template: `
152
+ @if (Visible) {
153
+ @if (IsLoading) {
154
+ <div class="loading-backdrop">
155
+ <mj-loading text="Loading credential types..."></mj-loading>
156
+ </div>
157
+ } @else {
158
+ <mj-credential-edit-panel
159
+ #editPanel
160
+ [credential]="Credential"
161
+ [credentialTypes]="credentialTypes"
162
+ [isOpen]="Visible"
163
+ (saved)="onSaved($event)"
164
+ (deleted)="onDeleted($event)"
165
+ (close)="onCancel()">
166
+ </mj-credential-edit-panel>
167
+ }
168
+ }
169
+ `, 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 "] }]
170
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { editPanel: [{
171
+ type: ViewChild,
172
+ args: ['editPanel']
173
+ }], Visible: [{
174
+ type: Input
175
+ }], Credential: [{
176
+ type: Input
177
+ }], PreselectedTypeId: [{
178
+ type: Input
179
+ }], PreselectedCategoryId: [{
180
+ type: Input
181
+ }], Title: [{
182
+ type: Input
183
+ }], Width: [{
184
+ type: Input
185
+ }], close: [{
186
+ type: Output
187
+ }] } });
188
+ //# 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;;;;AAG/C,MAAM,UAAU,oBAAoB;IAChC,wBAAwB;AAC5B,CAAC;AAqED,MAAM,OAAO,yBAAyB;IAiBd;IAhBI,SAAS,CAAgC;IAExD,OAAO,GAAG,KAAK,CAAC;IAChB,UAAU,GAA4B,IAAI,CAAC;IAC3C,iBAAiB,C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BAAC,WAAW;gBAEb,OAAO;sBAAf,KAAK;gBACG,UAAU;sBAAlB,KAAK;gBACG,iBAAiB;sBAAzB,KAAK;gBACG,qBAAqB;sBAA7B,KAAK;gBACG,KAAK;sBAAb,KAAK;gBACG,KAAK;sBAAb,KAAK;gBAEI,KAAK;sBAAd,MAAM"}
@@ -0,0 +1,44 @@
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 function LoadCredentialCategoryEditPanel(): void;
5
+ export declare class CredentialCategoryEditPanelComponent implements OnInit {
6
+ private cdr;
7
+ category: CredentialCategoryEntity | null;
8
+ isOpen: boolean;
9
+ close: EventEmitter<void>;
10
+ saved: EventEmitter<CredentialCategoryEntity>;
11
+ deleted: EventEmitter<string>;
12
+ isLoading: boolean;
13
+ isSaving: boolean;
14
+ isNew: boolean;
15
+ allCategories: CredentialCategoryEntity[];
16
+ name: string;
17
+ description: string;
18
+ parentId: string;
19
+ iconClass: string;
20
+ iconSuggestions: {
21
+ icon: string;
22
+ label: string;
23
+ }[];
24
+ private _metadata;
25
+ constructor(cdr: ChangeDetectorRef);
26
+ ngOnInit(): void;
27
+ get panelTitle(): string;
28
+ get canSave(): boolean;
29
+ get availableParentCategories(): CredentialCategoryEntity[];
30
+ private getDescendantIds;
31
+ open(category: CredentialCategoryEntity | null, preselectedParentId?: string): Promise<void>;
32
+ private loadCategories;
33
+ private resetForm;
34
+ private populateFromCategory;
35
+ selectIcon(icon: string): void;
36
+ save(): Promise<void>;
37
+ deleteCategory(): Promise<void>;
38
+ closePanel(): void;
39
+ onBackdropClick(event: MouseEvent): void;
40
+ getParentPath(categoryId: string): string;
41
+ static ɵfac: i0.ɵɵFactoryDeclaration<CredentialCategoryEditPanelComponent, never>;
42
+ 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>;
43
+ }
44
+ //# 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,wBAAgB,+BAA+B,SAE9C;AAED,qBAMa,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,GAAG,EAAE,iBAAiB;IAE1C,QAAQ,IAAI,IAAI;IAIhB,IAAW,UAAU,IAAI,MAAM,CAE9B;IAED,IAAW,OAAO,IAAI,OAAO,CAE5B;IAED,IAAW,yBAAyB,IAAI,wBAAwB,EAAE,CAWjE;IAED,OAAO,CAAC,gBAAgB;IAcX,IAAI,CAAC,QAAQ,EAAE,wBAAwB,GAAG,IAAI,EAAE,mBAAmB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;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