@memberjunction/ng-generic-dialog 6.1.4 → 6.2.0-edge.1

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.
@@ -75,9 +75,13 @@ export declare class GenericDialogComponent implements AfterContentInit {
75
75
  * Returns true if the dialog has custom actions defined in the custom-actions slot
76
76
  */
77
77
  get HasCustomActions(): boolean;
78
- customActions: ElementRef;
78
+ CustomActions: ElementRef;
79
+ /** @deprecated Use {@link CustomActions}. */
80
+ get customActions(): ElementRef;
81
+ /** @deprecated Use {@link CustomActions}. */
82
+ set customActions(value: ElementRef);
79
83
  ngAfterContentInit(): void;
80
84
  static ɵfac: i0.ɵɵFactoryDeclaration<GenericDialogComponent, never>;
81
- static ɵcmp: i0.ɵɵComponentDeclaration<GenericDialogComponent, "mj-generic-dialog", never, { "DialogTitle": { "alias": "DialogTitle"; "required": false; }; "DialogWidth": { "alias": "DialogWidth"; "required": false; }; "DialogHeight": { "alias": "DialogHeight"; "required": false; }; "ShowOKButton": { "alias": "ShowOKButton"; "required": false; }; "OKButtonText": { "alias": "OKButtonText"; "required": false; }; "CancelButtonText": { "alias": "CancelButtonText"; "required": false; }; "ShowCancelButton": { "alias": "ShowCancelButton"; "required": false; }; "DialogVisible": { "alias": "DialogVisible"; "required": false; }; }, { "DialogClosed": "DialogClosed"; "RefreshData": "RefreshData"; }, ["customActions"], ["*", "[custom-actions]"], false, never>;
85
+ static ɵcmp: i0.ɵɵComponentDeclaration<GenericDialogComponent, "mj-generic-dialog", never, { "DialogTitle": { "alias": "DialogTitle"; "required": false; }; "DialogWidth": { "alias": "DialogWidth"; "required": false; }; "DialogHeight": { "alias": "DialogHeight"; "required": false; }; "ShowOKButton": { "alias": "ShowOKButton"; "required": false; }; "OKButtonText": { "alias": "OKButtonText"; "required": false; }; "CancelButtonText": { "alias": "CancelButtonText"; "required": false; }; "ShowCancelButton": { "alias": "ShowCancelButton"; "required": false; }; "DialogVisible": { "alias": "DialogVisible"; "required": false; }; }, { "DialogClosed": "DialogClosed"; "RefreshData": "RefreshData"; }, ["CustomActions"], ["*", "[custom-actions]"], false, never>;
82
86
  }
83
87
  //# sourceMappingURL=dialog.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.component.d.ts","sourceRoot":"","sources":["../../src/lib/dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,YAAY,EAAS,iBAAiB,EAAE,UAAU,EAAgB,gBAAgB,EAAE,MAAM,eAAe,CAAC;;AAEtI;;;;;;;;;;;;;;;GAeG;AACH,qBAMa,sBAAuB,YAAW,gBAAgB;IACjD,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,iBAAiB;IAE1C;;OAEG;IACM,WAAW,EAAE,MAAM,CAAmB;IAC/C;;OAEG;IACM,WAAW,EAAE,MAAM,CAAW;IACvC;;OAEG;IACM,YAAY,EAAE,MAAM,CAAW;IAExC;;OAEG;IACM,YAAY,EAAE,OAAO,CAAQ;IAEtC;;OAEG;IACM,YAAY,EAAE,MAAM,CAAQ;IAErC;;OAEG;IACM,gBAAgB,EAAE,MAAM,CAAY;IAE7C;;OAEG;IACM,gBAAgB,EAAE,OAAO,CAAQ;IAE1C;;;OAGG;IACH,IAAa,aAAa,IAAI,OAAO,CAEpC;IACD,IAAI,aAAa,CAAC,KAAK,EAAE,OAAO,EAO/B;IACD,OAAO,CAAC,cAAc,CAAkB;IAGxC;;OAEG;IACO,YAAY,wBAA+B;IAErD;;OAEG;IACO,WAAW,qBAA4B;IAEjD;;OAEG;IACI,iBAAiB;IAKxB;;OAEG;IACI,aAAa;IAKpB,OAAO,CAAC,iBAAiB,CAAkB;IAC3C;;OAEG;IACH,IAAW,gBAAgB,IAAI,OAAO,CAErC;IAEkD,aAAa,EAAG,UAAU,CAAC;IAE9E,kBAAkB;yCA1FP,sBAAsB;2CAAtB,sBAAsB;CA6FlC"}
1
+ {"version":3,"file":"dialog.component.d.ts","sourceRoot":"","sources":["../../src/lib/dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,YAAY,EAAS,iBAAiB,EAAE,UAAU,EAAgB,gBAAgB,EAAE,MAAM,eAAe,CAAC;;AAEtI;;;;;;;;;;;;;;;GAeG;AACH,qBAMa,sBAAuB,YAAW,gBAAgB;IACjD,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,iBAAiB;IAE1C;;OAEG;IACM,WAAW,EAAE,MAAM,CAAmB;IAC/C;;OAEG;IACM,WAAW,EAAE,MAAM,CAAW;IACvC;;OAEG;IACM,YAAY,EAAE,MAAM,CAAW;IAExC;;OAEG;IACM,YAAY,EAAE,OAAO,CAAQ;IAEtC;;OAEG;IACM,YAAY,EAAE,MAAM,CAAQ;IAErC;;OAEG;IACM,gBAAgB,EAAE,MAAM,CAAY;IAE7C;;OAEG;IACM,gBAAgB,EAAE,OAAO,CAAQ;IAE1C;;;OAGG;IACH,IAAa,aAAa,IAAI,OAAO,CAEpC;IACD,IAAI,aAAa,CAAC,KAAK,EAAE,OAAO,EAO/B;IACD,OAAO,CAAC,cAAc,CAAkB;IAGxC;;OAEG;IACO,YAAY,wBAA+B;IAErD;;OAEG;IACO,WAAW,qBAA4B;IAEjD;;OAEG;IACI,iBAAiB;IAKxB;;OAEG;IACI,aAAa;IAKpB,OAAO,CAAC,iBAAiB,CAAkB;IAC3C;;OAEG;IACH,IAAW,gBAAgB,IAAI,OAAO,CAErC;IAEkD,aAAa,EAAG,UAAU,CAAC;IAE9E,6CAA6C;IAC7C,IAAI,aAAa,IAAI,UAAU,CAE9B;IACD,6CAA6C;IAC7C,IAAI,aAAa,CAAC,KAAK,EAAE,UAAU,EAElC;IAED,kBAAkB;yCAnGP,sBAAsB;2CAAtB,sBAAsB;CAsGlC"}
@@ -146,16 +146,24 @@ export class GenericDialogComponent {
146
146
  get HasCustomActions() {
147
147
  return this._hasCustomActions;
148
148
  }
149
- customActions;
149
+ CustomActions;
150
+ /** @deprecated Use {@link CustomActions}. */
151
+ get customActions() {
152
+ return this.CustomActions;
153
+ }
154
+ /** @deprecated Use {@link CustomActions}. */
155
+ set customActions(value) {
156
+ this.CustomActions = value;
157
+ }
150
158
  ngAfterContentInit() {
151
- this._hasCustomActions = !!this.customActions;
159
+ this._hasCustomActions = !!this.CustomActions;
152
160
  }
153
161
  static ɵfac = function GenericDialogComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || GenericDialogComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
154
162
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: GenericDialogComponent, selectors: [["mj-generic-dialog"]], contentQueries: function GenericDialogComponent_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
155
163
  i0.ɵɵcontentQuery(dirIndex, _c0, 5);
156
164
  } if (rf & 2) {
157
165
  let _t;
158
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.customActions = _t.first);
166
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.CustomActions = _t.first);
159
167
  } }, inputs: { DialogTitle: "DialogTitle", DialogWidth: "DialogWidth", DialogHeight: "DialogHeight", ShowOKButton: "ShowOKButton", OKButtonText: "OKButtonText", CancelButtonText: "CancelButtonText", ShowCancelButton: "ShowCancelButton", DialogVisible: "DialogVisible" }, outputs: { DialogClosed: "DialogClosed", RefreshData: "RefreshData" }, standalone: false, ngContentSelectors: _c2, decls: 1, vars: 1, consts: [[3, "Visible", "Width", "Height", "Title"], [3, "Close", "Visible", "Width", "Height", "Title"], ["mjButton", "", "variant", "primary"], ["mjButton", ""], ["mjButton", "", "variant", "primary", 3, "click"], ["mjButton", "", 3, "click"]], template: function GenericDialogComponent_Template(rf, ctx) { if (rf & 1) {
160
168
  i0.ɵɵprojectionDef(_c1);
161
169
  i0.ɵɵconditionalCreate(0, GenericDialogComponent_Conditional_0_Template, 7, 7, "mj-dialog", 0);
@@ -186,7 +194,7 @@ export class GenericDialogComponent {
186
194
  type: Output
187
195
  }], RefreshData: [{
188
196
  type: Output
189
- }], customActions: [{
197
+ }], CustomActions: [{
190
198
  type: ContentChild,
191
199
  args: ['custom-actions', { static: false }]
192
200
  }] }); })();
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.component.js","sourceRoot":"","sources":["../../src/lib/dialog.component.ts","../../src/lib/dialog.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAiC,YAAY,EAAoB,MAAM,eAAe,CAAC;;;;;;;;ICWtH,iCAA6D;IAA1B,yMAAS,sBAAe,KAAC;IAAC,YAAgB;IAAA,iBAAS;;;IAAzB,cAAgB;IAAhB,yCAAgB;;;;IAG7E,iCAA+C;IAA9B,yMAAS,0BAAmB,KAAC;IAAC,YAAoB;IAAA,iBAAS;;;IAA7B,cAAoB;IAApB,6CAAoB;;;IAOnE,4BAAM;IAAA,oFAAoE;IAAA,iBAAO;;;;IApB7F,oCAMC;IADG,6LAAS,0BAAmB,KAAC;IAE7B,kBAAyB;IACzB,yCAAmB;IACf,yGAAmB;IAGnB,yGAAuB;IAKvB,qBAAmD;IAEnD,oGAA8D;IAItE,AADI,iBAAoB,EACZ;;;IAnBR,AADA,AADA,AADA,8BAAgB,6BACK,+BACE,6BACF;IAKjB,eAEC;IAFD,8CAEC;IACD,cAEC;IAFD,kDAEC;IAKD,eAEC;IAFD,uGAEC;;ADpBb;;;;;;;;;;;;;;;GAeG;AAOH,MAAM,OAAO,sBAAsB;IACb;IAApB,YAAoB,GAAsB;QAAtB,QAAG,GAAH,GAAG,CAAmB;IAAG,CAAC;IAE9C;;OAEG;IACM,WAAW,GAAW,eAAe,CAAC;IAC/C;;OAEG;IACM,WAAW,GAAW,OAAO,CAAC;IACvC;;OAEG;IACM,YAAY,GAAW,OAAO,CAAC;IAExC;;OAEG;IACM,YAAY,GAAY,IAAI,CAAC;IAEtC;;OAEG;IACM,YAAY,GAAW,IAAI,CAAC;IAErC;;OAEG;IACM,gBAAgB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AAK;;kBAIL,KAAK;;kBAIL,KAAK;;kBAKL,KAAK;;kBAKL,KAAK;;kBAKL,KAAK;;kBAKL,KAAK;;kBAML,KAAK;;kBAiBL,MAAM;;kBAKN,MAAM;;kBA0BN,YAAY;mBAAC,gBAAgB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;;kFAxFtC,sBAAsB","sourcesContent":["import { Component, Output, EventEmitter, Input, ChangeDetectorRef, ElementRef, ContentChild, AfterContentInit } from '@angular/core';\n\n/**\n * Generic base dialog component that can be used as a base for other dialogs by using this component as shown here in any other Angular component.\n * The custom-actions slot shown below is entirely optional, if you don't need anything beyond OK/Cancel, you can leave this out entirely. You can also turn off the\n * built-in OK and Cancel buttons using the ShowOKButton and ShowCancelButton properties.\n * \n * <mj-generic-dialog DialogTitle=\"Your Dialog Title\" [DialogVisible]=\"YourVisibleStateVariable\" (DialogClosed)=\"YourDialogClosedEventHandler($event)\">\n * <div>\n * Your content goes in here\n * </div>\n * <div custom-actions>\n * <button mjButton variant=\"primary\" (click)=\"customOkClick()\">Custom OK</button>\n * <button mjButton (click)=\"customCancelClick()\">Custom Cancel</button>\n * <button mjButton (click)=\"additionalAction()\">Additional Action</button>\n * </div>\n * </mj-generic-dialog>\n */\n@Component({\n standalone: false,\n selector: 'mj-generic-dialog',\n templateUrl: './dialog.component.html',\n styleUrls: ['./dialog.component.css']\n})\nexport class GenericDialogComponent implements AfterContentInit {\n constructor(private cdr: ChangeDetectorRef) {}\n\n /**\n * Dialog title\n */\n @Input() DialogTitle: string = 'Default Title';\n /**\n * Optional, width of the dialog in pixels or percentage \n */\n @Input() DialogWidth: string = '700px';\n /**\n * Optional, height of the dialog in pixels or percentage \n */\n @Input() DialogHeight: string = '450px';\n\n /**\n * Ability to turn off the built-in OK button if it is not desired\n */\n @Input() ShowOKButton: boolean = true;\n\n /**\n * Text displayed on the OK button, defaults to \"OK\" if not provided\n */\n @Input() OKButtonText: string = \"OK\";\n\n /**\n * Text displayed on the Cancel button, defaults to \"Cancel\" if not provided\n */\n @Input() CancelButtonText: string = \"Cancel\";\n\n /**\n * Ability to turn off the built-in Cancel button if it is not desired\n */\n @Input() ShowCancelButton: boolean = true;\n\n /**\n * Determines if the dialog is visible or not, bind this to a variable in your containing component that is changed to true when you want the dialog shown. When the user closes the dialog this property will \n * be set to false automatically.\n */\n @Input() get DialogVisible(): boolean {\n return this._dialogVisible;\n }\n set DialogVisible(value: boolean) {\n if (value !== this._dialogVisible && value) {\n // showing the dialog when it wasn't shown, refresh the data\n this.RefreshData.emit();\n }\n this._dialogVisible = value;\n this.cdr.detectChanges(); // Ensure visibility updates immediately\n }\n private _dialogVisible: boolean = false;\n\n\n /**\n * Emits when the dialog is closed, the parameter is true if the dialog was closed with the OK button, false if it was closed with the Cancel button\n */\n @Output() DialogClosed = new EventEmitter<boolean>();\n\n /**\n * This event is fired during the component lifecycle if the dialog wants the user of the dialog to refresh the data provided within its content.\n */\n @Output() RefreshData = new EventEmitter<void>();\n\n /**\n * Internal event handler for the Cancel button, you can call this method directly if you want to simulate the user clicking on the Cancel button\n */\n public HandleCancelClick() {\n this.DialogVisible = false;\n this.DialogClosed.emit(false);\n }\n\n /**\n * Internal event handler for the OK button, you can call this method directly if you want to simulate the user clicking on the OK button\n */\n public HandleOKClick() {\n this.DialogVisible = false;\n this.DialogClosed.emit(true);\n }\n\n private _hasCustomActions: boolean = false;\n /**\n * Returns true if the dialog has custom actions defined in the custom-actions slot\n */\n public get HasCustomActions(): boolean {\n return this._hasCustomActions;\n }\n\n @ContentChild('custom-actions', { static: false }) customActions!: ElementRef;\n\n ngAfterContentInit() {\n this._hasCustomActions = !!this.customActions;\n }\n}\n","@if (DialogVisible) {\n <mj-dialog\n [Visible]=\"true\"\n [Width]=\"DialogWidth\"\n [Height]=\"DialogHeight\"\n [Title]=\"DialogTitle\"\n (Close)=\"HandleCancelClick()\"\n >\n <ng-content></ng-content>\n <mj-dialog-actions>\n @if(ShowOKButton) {\n <button mjButton variant=\"primary\" (click)=\"HandleOKClick()\">{{OKButtonText}}</button>\n }\n @if(ShowCancelButton) {\n <button mjButton (click)=\"HandleCancelClick()\">{{CancelButtonText}}</button>\n }\n\n <!-- Named slot for custom actions/buttons -->\n <ng-content select=\"[custom-actions]\"></ng-content>\n\n @if(!ShowOKButton && !ShowCancelButton && !HasCustomActions) {\n <span>No actions available - enable built-in actions or add custom actions</span>\n }\n </mj-dialog-actions>\n </mj-dialog>\n}\n"]}
1
+ {"version":3,"file":"dialog.component.js","sourceRoot":"","sources":["../../src/lib/dialog.component.ts","../../src/lib/dialog.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAiC,YAAY,EAAoB,MAAM,eAAe,CAAC;;;;;;;;ICWtH,iCAA6D;IAA1B,yMAAS,sBAAe,KAAC;IAAC,YAAgB;IAAA,iBAAS;;;IAAzB,cAAgB;IAAhB,yCAAgB;;;;IAG7E,iCAA+C;IAA9B,yMAAS,0BAAmB,KAAC;IAAC,YAAoB;IAAA,iBAAS;;;IAA7B,cAAoB;IAApB,6CAAoB;;;IAOnE,4BAAM;IAAA,oFAAoE;IAAA,iBAAO;;;;IApB7F,oCAMC;IADG,6LAAS,0BAAmB,KAAC;IAE7B,kBAAyB;IACzB,yCAAmB;IACf,yGAAmB;IAGnB,yGAAuB;IAKvB,qBAAmD;IAEnD,oGAA8D;IAItE,AADI,iBAAoB,EACZ;;;IAnBR,AADA,AADA,AADA,8BAAgB,6BACK,+BACE,6BACF;IAKjB,eAEC;IAFD,8CAEC;IACD,cAEC;IAFD,kDAEC;IAKD,eAEC;IAFD,uGAEC;;ADpBb;;;;;;;;;;;;;;;GAeG;AAOH,MAAM,OAAO,sBAAsB;IACb;IAApB,YAAoB,GAAsB;QAAtB,QAAG,GAAH,GAAG,CAAmB;IAAG,CAAC;IAE9C;;OAEG;IACM,WAAW,GAAW,eAAe,CAAC;IAC/C;;OAEG;IACM,WAAW,GAAW,OAAO,CAAC;I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IACD,6CAA6C;IAC7C,IAAI,aAAa,CAAC,KAAiB;QACjC,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;IAC7B,CAAC;IAED,kBAAkB;QACd,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC;IAClD,CAAC;gHArGU,sBAAsB;6DAAtB,sBAAsB;;;;;;;YCxBnC,8FAAqB;;YAArB,4CAyBC;;;iFDDY,sBAAsB;cANlC,SAAS;6BACI,KAAK,YACP,mBAAmB;;kBAU5B,KAAK;;kBAIL,KAAK;;kBAIL,KAAK;;kBAKL,KAAK;;kBAKL,KAAK;;kBAKL,KAAK;;kBAKL,KAAK;;kBAML,KAAK;;kBAiBL,MAAM;;kBAKN,MAAM;;kBA0BN,YAAY;mBAAC,gBAAgB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;;kFAxFtC,sBAAsB","sourcesContent":["import { Component, Output, EventEmitter, Input, ChangeDetectorRef, ElementRef, ContentChild, AfterContentInit } from '@angular/core';\n\n/**\n * Generic base dialog component that can be used as a base for other dialogs by using this component as shown here in any other Angular component.\n * The custom-actions slot shown below is entirely optional, if you don't need anything beyond OK/Cancel, you can leave this out entirely. You can also turn off the\n * built-in OK and Cancel buttons using the ShowOKButton and ShowCancelButton properties.\n * \n * <mj-generic-dialog DialogTitle=\"Your Dialog Title\" [DialogVisible]=\"YourVisibleStateVariable\" (DialogClosed)=\"YourDialogClosedEventHandler($event)\">\n * <div>\n * Your content goes in here\n * </div>\n * <div custom-actions>\n * <button mjButton variant=\"primary\" (click)=\"customOkClick()\">Custom OK</button>\n * <button mjButton (click)=\"customCancelClick()\">Custom Cancel</button>\n * <button mjButton (click)=\"additionalAction()\">Additional Action</button>\n * </div>\n * </mj-generic-dialog>\n */\n@Component({\n standalone: false,\n selector: 'mj-generic-dialog',\n templateUrl: './dialog.component.html',\n styleUrls: ['./dialog.component.css']\n})\nexport class GenericDialogComponent implements AfterContentInit {\n constructor(private cdr: ChangeDetectorRef) {}\n\n /**\n * Dialog title\n */\n @Input() DialogTitle: string = 'Default Title';\n /**\n * Optional, width of the dialog in pixels or percentage \n */\n @Input() DialogWidth: string = '700px';\n /**\n * Optional, height of the dialog in pixels or percentage \n */\n @Input() DialogHeight: string = '450px';\n\n /**\n * Ability to turn off the built-in OK button if it is not desired\n */\n @Input() ShowOKButton: boolean = true;\n\n /**\n * Text displayed on the OK button, defaults to \"OK\" if not provided\n */\n @Input() OKButtonText: string = \"OK\";\n\n /**\n * Text displayed on the Cancel button, defaults to \"Cancel\" if not provided\n */\n @Input() CancelButtonText: string = \"Cancel\";\n\n /**\n * Ability to turn off the built-in Cancel button if it is not desired\n */\n @Input() ShowCancelButton: boolean = true;\n\n /**\n * Determines if the dialog is visible or not, bind this to a variable in your containing component that is changed to true when you want the dialog shown. When the user closes the dialog this property will \n * be set to false automatically.\n */\n @Input() get DialogVisible(): boolean {\n return this._dialogVisible;\n }\n set DialogVisible(value: boolean) {\n if (value !== this._dialogVisible && value) {\n // showing the dialog when it wasn't shown, refresh the data\n this.RefreshData.emit();\n }\n this._dialogVisible = value;\n this.cdr.detectChanges(); // Ensure visibility updates immediately\n }\n private _dialogVisible: boolean = false;\n\n\n /**\n * Emits when the dialog is closed, the parameter is true if the dialog was closed with the OK button, false if it was closed with the Cancel button\n */\n @Output() DialogClosed = new EventEmitter<boolean>();\n\n /**\n * This event is fired during the component lifecycle if the dialog wants the user of the dialog to refresh the data provided within its content.\n */\n @Output() RefreshData = new EventEmitter<void>();\n\n /**\n * Internal event handler for the Cancel button, you can call this method directly if you want to simulate the user clicking on the Cancel button\n */\n public HandleCancelClick() {\n this.DialogVisible = false;\n this.DialogClosed.emit(false);\n }\n\n /**\n * Internal event handler for the OK button, you can call this method directly if you want to simulate the user clicking on the OK button\n */\n public HandleOKClick() {\n this.DialogVisible = false;\n this.DialogClosed.emit(true);\n }\n\n private _hasCustomActions: boolean = false;\n /**\n * Returns true if the dialog has custom actions defined in the custom-actions slot\n */\n public get HasCustomActions(): boolean {\n return this._hasCustomActions;\n }\n\n @ContentChild('custom-actions', { static: false }) CustomActions!: ElementRef;\n\n /** @deprecated Use {@link CustomActions}. */\n get customActions(): ElementRef {\n return this.CustomActions;\n }\n /** @deprecated Use {@link CustomActions}. */\n set customActions(value: ElementRef) {\n this.CustomActions = value;\n }\n\n ngAfterContentInit() {\n this._hasCustomActions = !!this.CustomActions;\n }\n}\n","@if (DialogVisible) {\n <mj-dialog\n [Visible]=\"true\"\n [Width]=\"DialogWidth\"\n [Height]=\"DialogHeight\"\n [Title]=\"DialogTitle\"\n (Close)=\"HandleCancelClick()\"\n >\n <ng-content></ng-content>\n <mj-dialog-actions>\n @if(ShowOKButton) {\n <button mjButton variant=\"primary\" (click)=\"HandleOKClick()\">{{OKButtonText}}</button>\n }\n @if(ShowCancelButton) {\n <button mjButton (click)=\"HandleCancelClick()\">{{CancelButtonText}}</button>\n }\n\n <!-- Named slot for custom actions/buttons -->\n <ng-content select=\"[custom-actions]\"></ng-content>\n\n @if(!ShowOKButton && !ShowCancelButton && !HasCustomActions) {\n <span>No actions available - enable built-in actions or add custom actions</span>\n }\n </mj-dialog-actions>\n </mj-dialog>\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-generic-dialog",
3
- "version": "6.1.4",
3
+ "version": "6.2.0-edge.1",
4
4
  "description": "MemberJunction: Angular component for a generic dialog",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
@@ -13,7 +13,7 @@
13
13
  "devDependencies": {
14
14
  "@angular/compiler": "21.2.22",
15
15
  "@angular/compiler-cli": "21.2.22",
16
- "@memberjunction/ng-test-utils": "6.1.4",
16
+ "@memberjunction/ng-test-utils": "6.2.0-edge.1",
17
17
  "vitest": "^4.0.18"
18
18
  },
19
19
  "peerDependencies": {
@@ -21,7 +21,7 @@
21
21
  "@angular/core": "^21.2.22"
22
22
  },
23
23
  "dependencies": {
24
- "@memberjunction/ng-ui-components": "6.1.4",
24
+ "@memberjunction/ng-ui-components": "6.2.0-edge.1",
25
25
  "tslib": "^2.8.1"
26
26
  },
27
27
  "sideEffects": false,