@memberjunction/ng-entity-form-dialog 5.21.0 → 5.23.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.
@@ -3,8 +3,7 @@ import { SharedService } from '@memberjunction/ng-shared';
3
3
  import { MJGlobal } from '@memberjunction/global';
4
4
  import { BaseFormComponent, BaseFormSectionComponent } from '@memberjunction/ng-base-forms';
5
5
  import * as i0 from "@angular/core";
6
- import * as i1 from "@progress/kendo-angular-dialog";
7
- import * as i2 from "@progress/kendo-angular-buttons";
6
+ import * as i1 from "@memberjunction/ng-ui-components";
8
7
  const _c0 = ["dynamicFormContainer"];
9
8
  function EntityFormDialogComponent_Conditional_0_ng_template_1_Template(rf, ctx) { }
10
9
  function EntityFormDialogComponent_Conditional_0_Conditional_3_Conditional_1_Template(rf, ctx) { if (rf & 1) {
@@ -22,7 +21,7 @@ function EntityFormDialogComponent_Conditional_0_Conditional_3_Conditional_2_Tem
22
21
  i0.ɵɵelementEnd();
23
22
  } }
24
23
  function EntityFormDialogComponent_Conditional_0_Conditional_3_Template(rf, ctx) { if (rf & 1) {
25
- i0.ɵɵelementStart(0, "kendo-dialog-actions");
24
+ i0.ɵɵelementStart(0, "mj-dialog-actions");
26
25
  i0.ɵɵconditionalCreate(1, EntityFormDialogComponent_Conditional_0_Conditional_3_Conditional_1_Template, 2, 0, "button", 3);
27
26
  i0.ɵɵconditionalCreate(2, EntityFormDialogComponent_Conditional_0_Conditional_3_Conditional_2_Template, 2, 0, "button", 4);
28
27
  i0.ɵɵelementEnd();
@@ -35,14 +34,14 @@ function EntityFormDialogComponent_Conditional_0_Conditional_3_Template(rf, ctx)
35
34
  } }
36
35
  function EntityFormDialogComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
37
36
  const _r1 = i0.ɵɵgetCurrentView();
38
- i0.ɵɵelementStart(0, "kendo-dialog", 2);
39
- i0.ɵɵlistener("close", function EntityFormDialogComponent_Conditional_0_Template_kendo_dialog_close_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.CloseWindow("Cancel")); });
37
+ i0.ɵɵelementStart(0, "mj-dialog", 2);
38
+ i0.ɵɵlistener("Close", function EntityFormDialogComponent_Conditional_0_Template_mj_dialog_Close_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.CloseWindow("Cancel")); });
40
39
  i0.ɵɵtemplate(1, EntityFormDialogComponent_Conditional_0_ng_template_1_Template, 0, 0, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
41
- i0.ɵɵconditionalCreate(3, EntityFormDialogComponent_Conditional_0_Conditional_3_Template, 3, 2, "kendo-dialog-actions");
40
+ i0.ɵɵconditionalCreate(3, EntityFormDialogComponent_Conditional_0_Conditional_3_Template, 3, 2, "mj-dialog-actions");
42
41
  i0.ɵɵelementEnd();
43
42
  } if (rf & 2) {
44
43
  const ctx_r1 = i0.ɵɵnextContext();
45
- i0.ɵɵproperty("title", ctx_r1.Title)("width", ctx_r1.Width)("height", ctx_r1.Height);
44
+ i0.ɵɵproperty("Visible", true)("Title", ctx_r1.Title)("Width", ctx_r1.Width)("Height", ctx_r1.Height);
46
45
  i0.ɵɵadvance(3);
47
46
  i0.ɵɵconditional(ctx_r1.ShowSaveButton || ctx_r1.ShowCancelButton ? 3 : -1);
48
47
  } }
@@ -174,15 +173,15 @@ export class EntityFormDialogComponent {
174
173
  } if (rf & 2) {
175
174
  let _t;
176
175
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.container = _t.first);
177
- } }, inputs: { Title: "Title", ShowSaveButton: "ShowSaveButton", ShowCancelButton: "ShowCancelButton", Width: "Width", Height: "Height", Mode: "Mode", SectionName: "SectionName", Record: "Record", HandleSave: "HandleSave", AutoRevertOnCancel: "AutoRevertOnCancel", Visible: "Visible" }, outputs: { DialogClosed: "DialogClosed" }, standalone: false, decls: 1, vars: 1, consts: [["dynamicFormContainer", ""], [3, "title", "width", "height"], [3, "close", "title", "width", "height"], ["kendoButton", "", "themeColor", "primary"], ["kendoButton", ""], ["kendoButton", "", "themeColor", "primary", 3, "click"], ["kendoButton", "", 3, "click"]], template: function EntityFormDialogComponent_Template(rf, ctx) { if (rf & 1) {
178
- i0.ɵɵconditionalCreate(0, EntityFormDialogComponent_Conditional_0_Template, 4, 4, "kendo-dialog", 1);
176
+ } }, inputs: { Title: "Title", ShowSaveButton: "ShowSaveButton", ShowCancelButton: "ShowCancelButton", Width: "Width", Height: "Height", Mode: "Mode", SectionName: "SectionName", Record: "Record", HandleSave: "HandleSave", AutoRevertOnCancel: "AutoRevertOnCancel", Visible: "Visible" }, outputs: { DialogClosed: "DialogClosed" }, standalone: false, decls: 1, vars: 1, consts: [["dynamicFormContainer", ""], [3, "Visible", "Title", "Width", "Height"], [3, "Close", "Visible", "Title", "Width", "Height"], ["mjButton", "", "variant", "primary"], ["mjButton", ""], ["mjButton", "", "variant", "primary", 3, "click"], ["mjButton", "", 3, "click"]], template: function EntityFormDialogComponent_Template(rf, ctx) { if (rf & 1) {
177
+ i0.ɵɵconditionalCreate(0, EntityFormDialogComponent_Conditional_0_Template, 4, 5, "mj-dialog", 1);
179
178
  } if (rf & 2) {
180
179
  i0.ɵɵconditional(ctx.Visible ? 0 : -1);
181
- } }, dependencies: [i1.DialogComponent, i1.DialogActionsComponent, i2.ButtonComponent], encapsulation: 2 });
180
+ } }, dependencies: [i1.MJButtonDirective, i1.MJDialogComponent, i1.MJDialogActionsComponent], encapsulation: 2 });
182
181
  }
183
182
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EntityFormDialogComponent, [{
184
183
  type: Component,
185
- args: [{ standalone: false, selector: 'mj-entity-form-dialog', template: "@if (Visible) {\n <kendo-dialog\n [title]=\"Title\"\n [width]=\"Width\"\n [height]=\"Height\"\n (close)=\"CloseWindow('Cancel')\" >\n <ng-template #dynamicFormContainer></ng-template>\n @if (ShowSaveButton || ShowCancelButton) {\n <kendo-dialog-actions>\n @if (ShowSaveButton) {\n <button kendoButton (click)=\"CloseWindow('Save')\" themeColor=\"primary\">Save</button>\n }\n @if (ShowCancelButton) {\n <button kendoButton (click)=\"CloseWindow('Cancel')\">Cancel</button>\n }\n </kendo-dialog-actions>\n }\n </kendo-dialog>\n}" }]
184
+ args: [{ standalone: false, selector: 'mj-entity-form-dialog', template: "@if (Visible) {\n <mj-dialog\n [Visible]=\"true\"\n [Title]=\"Title\"\n [Width]=\"Width\"\n [Height]=\"Height\"\n (Close)=\"CloseWindow('Cancel')\">\n <ng-template #dynamicFormContainer></ng-template>\n @if (ShowSaveButton || ShowCancelButton) {\n <mj-dialog-actions>\n @if (ShowSaveButton) {\n <button mjButton variant=\"primary\" (click)=\"CloseWindow('Save')\">Save</button>\n }\n @if (ShowCancelButton) {\n <button mjButton (click)=\"CloseWindow('Cancel')\">Cancel</button>\n }\n </mj-dialog-actions>\n }\n </mj-dialog>\n}\n" }]
186
185
  }], null, { Title: [{
187
186
  type: Input
188
187
  }], ShowSaveButton: [{
@@ -1 +1 @@
1
- {"version":3,"file":"entity-form-dialog.component.js","sourceRoot":"","sources":["../../../src/lib/entity-form-dialog/entity-form-dialog.component.ts","../../../src/lib/entity-form-dialog/entity-form-dialog.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAGpG,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,EAAqB,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;;;;;;;;ICKlF,iCAAwE;IAApD,0NAAS,mBAAY,MAAM,CAAC,KAAC;IAAuB,oBAAI;IAAA,iBAAS;;;;IAGrF,iC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BAKL,KAAK;;kBAIL,KAAK;;kBAKL,MAAM;;kBAMN,KAAK;;kBAcL,SAAS;mBAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;;kFApElD,yBAAyB","sourcesContent":["import { Component, Input, Output, ViewChild, ViewContainerRef, EventEmitter } from '@angular/core';\n\nimport { BaseEntity } from '@memberjunction/core';\nimport { SharedService } from '@memberjunction/ng-shared'\nimport { ClassRegistration, MJGlobal } from '@memberjunction/global';\nimport { BaseFormComponent, BaseFormSectionComponent } from '@memberjunction/ng-base-forms';\n \n\n/**\n * This dialog will display the form for a given entity. Using the configuration settings you can display the entire form\n * or a specific section of the form. You can also control the visibility of the Save and Cancel buttons, and the behavior\n * of the Save and Cancel buttons.\n */\n@Component({\n standalone: false,\n selector: 'mj-entity-form-dialog',\n templateUrl: './entity-form-dialog.component.html',\n styleUrls: ['./entity-form-dialog.component.css']\n})\nexport class EntityFormDialogComponent {\n /**\n * The title of the dialog\n */\n @Input() Title: string = '';\n /**\n * If set to true the Save button will be displayed. If set to false, the Save button will be hidden.\n */\n @Input() ShowSaveButton: boolean = true;\n /**\n * If set to true the Cancel button will be displayed. If set to false, the Cancel button will be hidden.\n */\n @Input() ShowCancelButton: boolean = true;\n\n /**\n * Initial width of the dialog\n */\n @Input() Width: number = 800;\n /**\n * Initial height of the dialog\n */\n @Input() Height: number = 600;\n\n /**\n * When set to complete, the entire form will be displayed. When set to section, only the specified section of the form will be displayed that is specified in the SectionName property.\n */\n @Input() Mode: 'complete' | 'section' = 'complete';\n /**\n * If Mode is set to section, this property will specify the name of the section to display. This property is ignored if Mode is set to complete.\n */\n @Input() SectionName: string = '';\n /**\n * The record to display in the form. This property is required. The record must be an instance a BaseEntity derived class.\n */\n @Input() Record: BaseEntity | null = null;\n\n /**\n * If true, when the user clicks the Save button, the Record will be saved. Only applicable if ShowSaveButton is true.\n */\n @Input() HandleSave: boolean = true;\n /**\n * If true, when the user clicks the Cancel button, the Record will be reverted to its original state. Only applicable if ShowCancelButton is true.\n */\n @Input() AutoRevertOnCancel: boolean = true;\n\n /**\n * This event will be emitted when the dialog is closed. The event will contain the status of the dialog, which will be either 'Save' or 'Cancel'.\n */\n @Output() DialogClosed: EventEmitter<'Save' | 'Cancel'> = new EventEmitter<'Save' | 'Cancel'>();\n\n private _visible = false;\n /**\n * Controls the visibility of the dialog. When set to true, the dialog will be displayed. When set to false, the dialog will be hidden.\n */\n @Input()\n set Visible(val: boolean) {\n this._visible = val;\n if (val) {\n Promise.resolve().then(() => {\n // At this point, the DOM should be updated, and `this.container` should be available.\n this.ShowForm();\n }); \n }\n }\n get Visible(): boolean {\n return this._visible;\n }\n\n @ViewChild('dynamicFormContainer', { read: ViewContainerRef }) container!: ViewContainerRef;\n\n /**\n * This method can be called to show the form. \n */\n public ShowForm() {\n if (!this.Visible) {\n this.Visible = true; // set to visible and bail as the rest will end up calling this function again but after a promise which will allow Angular to update the DOM\n return;\n }\n \n if (!this.container) \n throw new Error('Container not found');\n if (!this.Record)\n throw new Error('Record is a required property');\n\n // Ensure the container is clear before inserting a new component\n this.container.clear();\n\n // here we want to grab the right type of object to instantiate based on the settings either mode of complete or section\n // if section, we grab a sub-class of BaseFormSectionComponent, if complete, we grab a sub-class of the BaseForComponent class\n let reg: ClassRegistration | null;\n if (this.Mode === 'complete') {\n reg = MJGlobal.Instance.ClassFactory.GetRegistration(BaseFormComponent, this.Record?.EntityInfo.Name);\n } else {\n reg = MJGlobal.Instance.ClassFactory.GetRegistration(BaseFormSectionComponent, this.Record?.EntityInfo.Name + '.' + this.SectionName);\n }\n\n if (reg && reg.SubClass) {\n // we have our class registration\n const component = this.container.createComponent(reg.SubClass);\n if (this.Record && component.instance instanceof BaseFormSectionComponent) {\n component.instance.record = this.Record;\n component.instance.EditMode = true;\n }\n else if (this.Record && component.instance instanceof BaseFormComponent) {\n component.instance.record = this.Record;\n component.instance.EditMode = true;\n }\n }\n }\n\n /**\n * This method can be called to close the dialog. It will emit the 'close' event with the status of the dialog.\n * @param status \n */\n public async CloseWindow(status: 'Save' | 'Cancel') {\n this.Visible = false;\n if (this.Record) {\n if (this.HandleSave && status === 'Save') {\n if (!await this.Record.Save()) {\n SharedService.Instance.CreateSimpleNotification(`Error saving ${this.Record.EntityInfo.Name} record, rolling back changes`, 'error');\n this.Record.Revert(); \n }\n }\n if (this.AutoRevertOnCancel && status === 'Cancel') {\n this.Record.Revert();\n }\n }\n this.DialogClosed.emit(status);\n }\n}\n","@if (Visible) {\n <kendo-dialog\n [title]=\"Title\"\n [width]=\"Width\"\n [height]=\"Height\"\n (close)=\"CloseWindow('Cancel')\" >\n <ng-template #dynamicFormContainer></ng-template>\n @if (ShowSaveButton || ShowCancelButton) {\n <kendo-dialog-actions>\n @if (ShowSaveButton) {\n <button kendoButton (click)=\"CloseWindow('Save')\" themeColor=\"primary\">Save</button>\n }\n @if (ShowCancelButton) {\n <button kendoButton (click)=\"CloseWindow('Cancel')\">Cancel</button>\n }\n </kendo-dialog-actions>\n }\n </kendo-dialog>\n}"]}
1
+ {"version":3,"file":"entity-form-dialog.component.js","sourceRoot":"","sources":["../../../src/lib/entity-form-dialog/entity-form-dialog.component.ts","../../../src/lib/entity-form-dialog/entity-form-dialog.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAGpG,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,EAAqB,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;;;;;;;ICMlF,iCAAiE;IAA9B,0NAAS,mBAAY,MAAM,CAAC,KAAC;IAAC,oBAAI;IAAA,iBAAS;;;;IAG9E,iCAAiD;IAAhC,0NAAS,mBAAY,QAAQ,CAAC,KAAC;IAAC,sBAAM;IAAA,iBAAS;;;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,SAAS;mBAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;;kFApElD,yBAAyB","sourcesContent":["import { Component, Input, Output, ViewChild, ViewContainerRef, EventEmitter } from '@angular/core';\n\nimport { BaseEntity } from '@memberjunction/core';\nimport { SharedService } from '@memberjunction/ng-shared'\nimport { ClassRegistration, MJGlobal } from '@memberjunction/global';\nimport { BaseFormComponent, BaseFormSectionComponent } from '@memberjunction/ng-base-forms';\n \n\n/**\n * This dialog will display the form for a given entity. Using the configuration settings you can display the entire form\n * or a specific section of the form. You can also control the visibility of the Save and Cancel buttons, and the behavior\n * of the Save and Cancel buttons.\n */\n@Component({\n standalone: false,\n selector: 'mj-entity-form-dialog',\n templateUrl: './entity-form-dialog.component.html',\n styleUrls: ['./entity-form-dialog.component.css']\n})\nexport class EntityFormDialogComponent {\n /**\n * The title of the dialog\n */\n @Input() Title: string = '';\n /**\n * If set to true the Save button will be displayed. If set to false, the Save button will be hidden.\n */\n @Input() ShowSaveButton: boolean = true;\n /**\n * If set to true the Cancel button will be displayed. If set to false, the Cancel button will be hidden.\n */\n @Input() ShowCancelButton: boolean = true;\n\n /**\n * Initial width of the dialog\n */\n @Input() Width: number = 800;\n /**\n * Initial height of the dialog\n */\n @Input() Height: number = 600;\n\n /**\n * When set to complete, the entire form will be displayed. When set to section, only the specified section of the form will be displayed that is specified in the SectionName property.\n */\n @Input() Mode: 'complete' | 'section' = 'complete';\n /**\n * If Mode is set to section, this property will specify the name of the section to display. This property is ignored if Mode is set to complete.\n */\n @Input() SectionName: string = '';\n /**\n * The record to display in the form. This property is required. The record must be an instance a BaseEntity derived class.\n */\n @Input() Record: BaseEntity | null = null;\n\n /**\n * If true, when the user clicks the Save button, the Record will be saved. Only applicable if ShowSaveButton is true.\n */\n @Input() HandleSave: boolean = true;\n /**\n * If true, when the user clicks the Cancel button, the Record will be reverted to its original state. Only applicable if ShowCancelButton is true.\n */\n @Input() AutoRevertOnCancel: boolean = true;\n\n /**\n * This event will be emitted when the dialog is closed. The event will contain the status of the dialog, which will be either 'Save' or 'Cancel'.\n */\n @Output() DialogClosed: EventEmitter<'Save' | 'Cancel'> = new EventEmitter<'Save' | 'Cancel'>();\n\n private _visible = false;\n /**\n * Controls the visibility of the dialog. When set to true, the dialog will be displayed. When set to false, the dialog will be hidden.\n */\n @Input()\n set Visible(val: boolean) {\n this._visible = val;\n if (val) {\n Promise.resolve().then(() => {\n // At this point, the DOM should be updated, and `this.container` should be available.\n this.ShowForm();\n }); \n }\n }\n get Visible(): boolean {\n return this._visible;\n }\n\n @ViewChild('dynamicFormContainer', { read: ViewContainerRef }) container!: ViewContainerRef;\n\n /**\n * This method can be called to show the form. \n */\n public ShowForm() {\n if (!this.Visible) {\n this.Visible = true; // set to visible and bail as the rest will end up calling this function again but after a promise which will allow Angular to update the DOM\n return;\n }\n \n if (!this.container) \n throw new Error('Container not found');\n if (!this.Record)\n throw new Error('Record is a required property');\n\n // Ensure the container is clear before inserting a new component\n this.container.clear();\n\n // here we want to grab the right type of object to instantiate based on the settings either mode of complete or section\n // if section, we grab a sub-class of BaseFormSectionComponent, if complete, we grab a sub-class of the BaseForComponent class\n let reg: ClassRegistration | null;\n if (this.Mode === 'complete') {\n reg = MJGlobal.Instance.ClassFactory.GetRegistration(BaseFormComponent, this.Record?.EntityInfo.Name);\n } else {\n reg = MJGlobal.Instance.ClassFactory.GetRegistration(BaseFormSectionComponent, this.Record?.EntityInfo.Name + '.' + this.SectionName);\n }\n\n if (reg && reg.SubClass) {\n // we have our class registration\n const component = this.container.createComponent(reg.SubClass);\n if (this.Record && component.instance instanceof BaseFormSectionComponent) {\n component.instance.record = this.Record;\n component.instance.EditMode = true;\n }\n else if (this.Record && component.instance instanceof BaseFormComponent) {\n component.instance.record = this.Record;\n component.instance.EditMode = true;\n }\n }\n }\n\n /**\n * This method can be called to close the dialog. It will emit the 'close' event with the status of the dialog.\n * @param status \n */\n public async CloseWindow(status: 'Save' | 'Cancel') {\n this.Visible = false;\n if (this.Record) {\n if (this.HandleSave && status === 'Save') {\n if (!await this.Record.Save()) {\n SharedService.Instance.CreateSimpleNotification(`Error saving ${this.Record.EntityInfo.Name} record, rolling back changes`, 'error');\n this.Record.Revert(); \n }\n }\n if (this.AutoRevertOnCancel && status === 'Cancel') {\n this.Record.Revert();\n }\n }\n this.DialogClosed.emit(status);\n }\n}\n","@if (Visible) {\n <mj-dialog\n [Visible]=\"true\"\n [Title]=\"Title\"\n [Width]=\"Width\"\n [Height]=\"Height\"\n (Close)=\"CloseWindow('Cancel')\">\n <ng-template #dynamicFormContainer></ng-template>\n @if (ShowSaveButton || ShowCancelButton) {\n <mj-dialog-actions>\n @if (ShowSaveButton) {\n <button mjButton variant=\"primary\" (click)=\"CloseWindow('Save')\">Save</button>\n }\n @if (ShowCancelButton) {\n <button mjButton (click)=\"CloseWindow('Cancel')\">Cancel</button>\n }\n </mj-dialog-actions>\n }\n </mj-dialog>\n}\n"]}
@@ -2,11 +2,10 @@ import * as i0 from "@angular/core";
2
2
  import * as i1 from "./entity-form-dialog/entity-form-dialog.component";
3
3
  import * as i2 from "@angular/common";
4
4
  import * as i3 from "@angular/forms";
5
- import * as i4 from "@progress/kendo-angular-dialog";
6
- import * as i5 from "@progress/kendo-angular-buttons";
5
+ import * as i4 from "@memberjunction/ng-ui-components";
7
6
  export declare class EntityFormDialogModule {
8
7
  static ɵfac: i0.ɵɵFactoryDeclaration<EntityFormDialogModule, never>;
9
- static ɵmod: i0.ɵɵNgModuleDeclaration<EntityFormDialogModule, [typeof i1.EntityFormDialogComponent], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i4.DialogsModule, typeof i5.ButtonsModule, typeof i4.DialogsModule], [typeof i1.EntityFormDialogComponent]>;
8
+ static ɵmod: i0.ɵɵNgModuleDeclaration<EntityFormDialogModule, [typeof i1.EntityFormDialogComponent], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i4.MJButtonDirective, typeof i4.MJDialogComponent, typeof i4.MJDialogActionsComponent], [typeof i1.EntityFormDialogComponent]>;
10
9
  static ɵinj: i0.ɵɵInjectorDeclaration<EntityFormDialogModule>;
11
10
  }
12
11
  //# sourceMappingURL=module.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/lib/module.ts"],"names":[],"mappings":";;;;;;AAUA,qBAea,sBAAsB;yCAAtB,sBAAsB;0CAAtB,sBAAsB;0CAAtB,sBAAsB;CAAI"}
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/lib/module.ts"],"names":[],"mappings":";;;;;AASA,qBAea,sBAAsB;yCAAtB,sBAAsB;0CAAtB,sBAAsB;0CAAtB,sBAAsB;CAAI"}
@@ -1,9 +1,8 @@
1
1
  import { NgModule } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
- // Kendo UI Angular imports
4
- import { DialogsModule } from "@progress/kendo-angular-dialog";
5
- import { ButtonsModule } from '@progress/kendo-angular-buttons';
6
3
  import { FormsModule } from '@angular/forms';
4
+ // MJ UI Components
5
+ import { MJButtonDirective, MJDialogComponent, MJDialogActionsComponent } from '@memberjunction/ng-ui-components';
7
6
  import { EntityFormDialogComponent } from './entity-form-dialog/entity-form-dialog.component';
8
7
  import * as i0 from "@angular/core";
9
8
  export class EntityFormDialogModule {
@@ -11,9 +10,8 @@ export class EntityFormDialogModule {
11
10
  static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: EntityFormDialogModule });
12
11
  static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule,
13
12
  FormsModule,
14
- DialogsModule,
15
- ButtonsModule,
16
- DialogsModule] });
13
+ MJDialogComponent,
14
+ MJDialogActionsComponent] });
17
15
  }
18
16
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EntityFormDialogModule, [{
19
17
  type: NgModule,
@@ -24,9 +22,9 @@ export class EntityFormDialogModule {
24
22
  imports: [
25
23
  CommonModule,
26
24
  FormsModule,
27
- DialogsModule,
28
- ButtonsModule,
29
- DialogsModule,
25
+ MJButtonDirective,
26
+ MJDialogComponent,
27
+ MJDialogActionsComponent,
30
28
  ],
31
29
  exports: [
32
30
  EntityFormDialogComponent
@@ -35,7 +33,7 @@ export class EntityFormDialogModule {
35
33
  }], null, null); })();
36
34
  (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(EntityFormDialogModule, { declarations: [EntityFormDialogComponent], imports: [CommonModule,
37
35
  FormsModule,
38
- DialogsModule,
39
- ButtonsModule,
40
- DialogsModule], exports: [EntityFormDialogComponent] }); })();
36
+ MJButtonDirective,
37
+ MJDialogComponent,
38
+ MJDialogActionsComponent], exports: [EntityFormDialogComponent] }); })();
41
39
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/lib/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,2BAA2B;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,mDAAmD,CAAC;;AAiB9F,MAAM,OAAO,sBAAsB;gHAAtB,sBAAsB;4DAAtB,sBAAsB;gEAV/B,YAAY;YACZ,WAAW;YACX,aAAa;YACb,aAAa;YACb,aAAa;;iFAMJ,sBAAsB;cAflC,QAAQ;eAAC;gBACR,YAAY,EAAE;oBACZ,yBAAyB;iBAC1B;gBACD,OAAO,EAAE;oBACP,YAAY;oBACZ,WAAW;oBACX,aAAa;oBACb,aAAa;oBACb,aAAa;iBACd;gBACD,OAAO,EAAE;oBACP,yBAAyB;iBAC1B;aACF;;wFACY,sBAAsB,mBAb/B,yBAAyB,aAGzB,YAAY;QACZ,WAAW;QACX,aAAa;QACb,aAAa;QACb,aAAa,aAGb,yBAAyB","sourcesContent":["import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n// Kendo UI Angular imports\nimport { DialogsModule } from \"@progress/kendo-angular-dialog\";\nimport { ButtonsModule } from '@progress/kendo-angular-buttons'; \n\nimport { FormsModule } from '@angular/forms';\nimport { EntityFormDialogComponent } from './entity-form-dialog/entity-form-dialog.component';\n\n@NgModule({\n declarations: [\n EntityFormDialogComponent\n ],\n imports: [\n CommonModule,\n FormsModule,\n DialogsModule,\n ButtonsModule,\n DialogsModule,\n ],\n exports: [\n EntityFormDialogComponent\n ]\n})\nexport class EntityFormDialogModule { }"]}
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/lib/module.ts"],"names":[],"mappings":"AAAA,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,mBAAmB;AACnB,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,OAAO,EAAE,yBAAyB,EAAE,MAAM,mDAAmD,CAAC;;AAiB9F,MAAM,OAAO,sBAAsB;gHAAtB,sBAAsB;4DAAtB,sBAAsB;gEAV/B,YAAY;YACZ,WAAW;YAEX,iBAAiB;YACjB,wBAAwB;;iFAMf,sBAAsB;cAflC,QAAQ;eAAC;gBACR,YAAY,EAAE;oBACZ,yBAAyB;iBAC1B;gBACD,OAAO,EAAE;oBACP,YAAY;oBACZ,WAAW;oBACX,iBAAiB;oBACjB,iBAAiB;oBACjB,wBAAwB;iBACzB;gBACD,OAAO,EAAE;oBACP,yBAAyB;iBAC1B;aACF;;wFACY,sBAAsB,mBAb/B,yBAAyB,aAGzB,YAAY;QACZ,WAAW;QACX,iBAAiB;QACjB,iBAAiB;QACjB,wBAAwB,aAGxB,yBAAyB","sourcesContent":["import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\n\n// MJ UI Components\nimport { MJButtonDirective, MJDialogComponent, MJDialogActionsComponent } from '@memberjunction/ng-ui-components';\n\nimport { EntityFormDialogComponent } from './entity-form-dialog/entity-form-dialog.component';\n\n@NgModule({\n declarations: [\n EntityFormDialogComponent\n ],\n imports: [\n CommonModule,\n FormsModule,\n MJButtonDirective,\n MJDialogComponent,\n MJDialogActionsComponent,\n ],\n exports: [\n EntityFormDialogComponent\n ]\n})\nexport class EntityFormDialogModule { }\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-entity-form-dialog",
3
- "version": "5.21.0",
3
+ "version": "5.23.0",
4
4
  "description": "MemberJunction: Dialog component that is able to display a form for display and/or editing for any record from any entity in MemberJunction.",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
@@ -25,14 +25,13 @@
25
25
  "@angular/router": "21.1.3"
26
26
  },
27
27
  "dependencies": {
28
- "@memberjunction/core-entities": "5.21.0",
29
- "@memberjunction/global": "5.21.0",
30
- "@memberjunction/core": "5.21.0",
31
- "@memberjunction/ng-container-directives": "5.21.0",
32
- "@memberjunction/ng-shared": "5.21.0",
33
- "@memberjunction/ng-base-forms": "5.21.0",
34
- "@progress/kendo-angular-buttons": "22.0.1",
35
- "@progress/kendo-angular-dialog": "22.0.1",
28
+ "@memberjunction/core": "5.23.0",
29
+ "@memberjunction/core-entities": "5.23.0",
30
+ "@memberjunction/global": "5.23.0",
31
+ "@memberjunction/ng-base-forms": "5.23.0",
32
+ "@memberjunction/ng-container-directives": "5.23.0",
33
+ "@memberjunction/ng-shared": "5.23.0",
34
+ "@memberjunction/ng-ui-components": "5.23.0",
36
35
  "tslib": "^2.8.1"
37
36
  },
38
37
  "sideEffects": false,