@memberjunction/ng-join-grid 6.2.0-edge.0 → 6.2.0-edge.2

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.
@@ -154,8 +154,16 @@ export declare class JoinGridComponent extends BaseAngularComponent implements A
154
154
  */
155
155
  EditMode: 'None' | 'Save' | 'Queue';
156
156
  constructor(cdr: ChangeDetectorRef, elementRef: ElementRef);
157
- _GridData: JoinGridRow[];
158
- _IsLoading: boolean;
157
+ GridData: JoinGridRow[];
158
+ /** @deprecated Use {@link GridData}. */
159
+ get _GridData(): JoinGridRow[];
160
+ /** @deprecated Use {@link GridData}. */
161
+ set _GridData(value: JoinGridRow[]);
162
+ IsLoading: boolean;
163
+ /** @deprecated Use {@link IsLoading}. */
164
+ get _IsLoading(): boolean;
165
+ /** @deprecated Use {@link IsLoading}. */
166
+ set _IsLoading(value: boolean);
159
167
  protected _rowsEntityInfo: EntityInfo | null;
160
168
  protected _columnsEntityInfo: EntityInfo | null;
161
169
  protected _columnsEntityData: BaseEntity[] | undefined;
@@ -181,7 +189,11 @@ export declare class JoinGridComponent extends BaseAngularComponent implements A
181
189
  protected PopulateGridData(): Promise<void>;
182
190
  protected _pendingDeletes: BaseEntity[];
183
191
  protected _pendingInserts: BaseEntity[];
192
+ FlipRecord(event: MouseEvent, row: JoinGridRow, cell: JoinGridCell, stopPropagation?: boolean): Promise<void>;
193
+ /** @deprecated Use {@link FlipRecord}. */
184
194
  _FlipRecord(event: MouseEvent, row: JoinGridRow, cell: JoinGridCell, stopPropagation?: boolean): Promise<void>;
195
+ IsColumnChecked(cell: JoinGridCell): boolean;
196
+ /** @deprecated Use {@link IsColumnChecked}. */
185
197
  _IsColumnChecked(cell: JoinGridCell): boolean;
186
198
  OnDropdownValueChange(row: JoinGridRow, colIndex: number, newValue: unknown): void;
187
199
  UpdateCellValueDirect(row: JoinGridRow, colIndex: number, newValue: string): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"join-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EAAE,MAAM,GAAG,eAAe;IAWpD,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE;IAI1D,IAAW,iBAAiB;;;;;MAE3B;yCA5qBU,iBAAiB;2CAAjB,iBAAiB;CA6qB7B"}
@@ -236,17 +236,17 @@ function JoinGridComponent_Conditional_4_Template(rf, ctx) { if (rf & 1) {
236
236
  i0.ɵɵrepeater(ctx_r1._GridData);
237
237
  } }
238
238
  export class JoinGridCell {
239
- index;
239
+ index; // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply
240
240
  RowForeignKeyValue;
241
241
  ColumnForeignKeyValue;
242
242
  /**
243
243
  * Used when the ColumnsMode is set to Entity. This is the BaseEntity object that represents the data in the JoinEntity that links the Row and Column entities together.
244
244
  */
245
- data;
245
+ data; // case-violation-ok-legacy-back-compat: an accessor cannot be optional, so a stub would turn this into a required member
246
246
  /**
247
247
  * Used when the ColumnsMode is set to Fields. This is an array of values from the JoinEntity that are displayed as columns in the grid.
248
248
  */
249
- value;
249
+ value; // case-violation-ok-legacy-back-compat: an accessor cannot be optional, so a stub would turn this into a required member
250
250
  }
251
251
  export class JoinGridRow {
252
252
  FirstColValue;
@@ -399,8 +399,24 @@ export class JoinGridComponent extends BaseAngularComponent {
399
399
  this.elementRef = elementRef;
400
400
  }
401
401
  /*The below members are public because the Angular template needs access to them, but by naming convention we prefix with an _ so that it is clear they are not to be used outside of the component */
402
- _GridData = [];
403
- _IsLoading = false;
402
+ GridData = [];
403
+ /** @deprecated Use {@link GridData}. */
404
+ get _GridData() {
405
+ return this.GridData;
406
+ }
407
+ /** @deprecated Use {@link GridData}. */
408
+ set _GridData(value) {
409
+ this.GridData = value;
410
+ }
411
+ IsLoading = false;
412
+ /** @deprecated Use {@link IsLoading}. */
413
+ get _IsLoading() {
414
+ return this.IsLoading;
415
+ }
416
+ /** @deprecated Use {@link IsLoading}. */
417
+ set _IsLoading(value) {
418
+ this.IsLoading = value;
419
+ }
404
420
  /* protected internal members */
405
421
  _rowsEntityInfo = null;
406
422
  _columnsEntityInfo = null;
@@ -485,7 +501,7 @@ export class JoinGridComponent extends BaseAngularComponent {
485
501
  // go through all of the pending deletes and remove them from the array
486
502
  // and go through all of the pending inserts and remove them from the array
487
503
  // before removing stuff from arrays we need to go back through all of hte grid cells and restore to original data
488
- this._GridData.forEach(row => {
504
+ this.GridData.forEach(row => {
489
505
  row.ColumnData.forEach(cell => {
490
506
  // for each cell, if we have a data object, look for a match in the pending inserts array, that means it is a NEW record
491
507
  if (cell.data) {
@@ -532,7 +548,7 @@ export class JoinGridComponent extends BaseAngularComponent {
532
548
  * This method is called automatically when the component is first loaded. Call the method anytime if you want to refresh the grid.
533
549
  */
534
550
  async Refresh() {
535
- this._IsLoading = true; // turn on the loading spinner
551
+ this.IsLoading = true; // turn on the loading spinner
536
552
  this.cdr.detectChanges(); // let angular know we have changes
537
553
  this._pendingDeletes = [];
538
554
  this._pendingInserts = [];
@@ -575,7 +591,7 @@ export class JoinGridComponent extends BaseAngularComponent {
575
591
  this._joinEntityData = result.Results;
576
592
  this.PopulateGridData();
577
593
  }
578
- this._IsLoading = false; // turn off the loading spinner
594
+ this.IsLoading = false; // turn off the loading spinner
579
595
  this.cdr.detectChanges(); // let Angular know we have changes
580
596
  }
581
597
  async PopulateRowsAndColsData() {
@@ -659,11 +675,11 @@ export class JoinGridComponent extends BaseAngularComponent {
659
675
  }
660
676
  gridData.push(rowData);
661
677
  });
662
- this._GridData = gridData;
678
+ this.GridData = gridData;
663
679
  }
664
680
  _pendingDeletes = [];
665
681
  _pendingInserts = [];
666
- async _FlipRecord(event, row, cell, stopPropagation = false) {
682
+ async FlipRecord(event, row, cell, stopPropagation = false) {
667
683
  if (stopPropagation)
668
684
  event.stopPropagation();
669
685
  if (!cell)
@@ -699,9 +715,17 @@ export class JoinGridComponent extends BaseAngularComponent {
699
715
  }
700
716
  this.cdr.detectChanges();
701
717
  }
702
- _IsColumnChecked(cell) {
718
+ /** @deprecated Use {@link FlipRecord}. */
719
+ async _FlipRecord(event, row, cell, stopPropagation = false) {
720
+ return this.FlipRecord(event, row, cell, stopPropagation);
721
+ }
722
+ IsColumnChecked(cell) {
703
723
  return cell?.data !== undefined;
704
724
  }
725
+ /** @deprecated Use {@link IsColumnChecked}. */
726
+ _IsColumnChecked(cell) {
727
+ return this.IsColumnChecked(cell);
728
+ }
705
729
  OnDropdownValueChange(row, colIndex, newValue) {
706
730
  this.UpdateCellValueDirect(row, colIndex, String(newValue));
707
731
  }
@@ -1 +1 @@
1
- {"version":3,"file":"join-grid.component.js","sourceRoot":"","sources":["../../../src/lib/join-grid/join-grid.component.ts","../../../src/lib/join-grid/join-grid.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgD,MAAM,eAAe,CAAC;AAC/F,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE,OAAO,EAA+B,iBAAiB,EAAc,QAAQ,EAAE,OAAO,EAAsC,MAAM,sBAAsB,CAAC;AACzJ,OAAO,EAAW,WAAW,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAA0B,2BAA2B,EAA4B,MAAM,+BAA+B,CAAC;;;;;;;ICJhJ,2BAAK;IAAA,gCAA0D;IAAA,iBAAM;;IAApD,cAAkB;IAAlB,gCAAkB;;;;IAGnC,iCAAqE;IAAjB,qLAAS,aAAM,KAAC;IAAC,oBAAI;IAAA,iBAAS;;;IAA1E,uDAAkC;;;;IAG1C,iCAA2E;IAAvB,qLAAS,mBAAY,KAAC;IAAC,sBAAM;IAAA,iBAAS;;;IAAlF,uDAAkC;;;IAUhC,6BAA4B;IAAA,YAAiD;IAAA,iBAAK;;;;IAAtD,cAAiD;IAAjD,wEAAiD;;;IAD/E,iIAEC;;;IAFD,wCAEC;;;IAKD,0BAAI;IAAA,YAAW;I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FAvJK,iBAAiB","sourcesContent":["import { Component, Input, AfterViewInit, ChangeDetectorRef, ElementRef } from '@angular/core';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { IsDescendantElement } from '@memberjunction/ng-shared-generic';\n\nimport { BaseEntity, EntityFieldInfo, EntityFieldTSType, EntityInfo, LogError, RunView, RunViewParams, ValidationErrorInfo } from '@memberjunction/core';\nimport { MJEvent, MJEventType, MJGlobal } from '@memberjunction/global';\nimport { BaseAngularComponent, BaseFormComponentEvent, BaseFormComponentEventCodes, FormEditingCompleteEvent } from '@memberjunction/ng-base-types';\n\nexport class JoinGridCell {\n index!: number;\n RowForeignKeyValue: any;\n ColumnForeignKeyValue?: any;\n /**\n * Used when the ColumnsMode is set to Entity. This is the BaseEntity object that represents the data in the JoinEntity that links the Row and Column entities together.\n */\n data?: BaseEntity | undefined;\n /**\n * Used when the ColumnsMode is set to Fields. This is an array of values from the JoinEntity that are displayed as columns in the grid.\n */\n value?: any\n}\nexport class JoinGridRow {\n FirstColValue: any;\n JoinExists: boolean = false;\n RowForeignKeyValue: any;\n ColumnData: JoinGridCell[] = []\n GetColumnValue(colIndex: number): any {\n return this.ColumnData && this.ColumnData.length > colIndex ? this.ColumnData[colIndex].value : undefined\n }\n constructor (data: any) {\n this.FirstColValue = data.FirstColValue;\n this.JoinExists = data.JoinExists;\n this.RowForeignKeyValue = data.RowForeignKeyValue;\n this.ColumnData = data.ColumnData;\n }\n}\n\n@Component({\n standalone: false,\n selector: 'mj-join-grid',\n templateUrl: './join-grid.component.html',\n styleUrls: ['./join-grid.component.css']\n})\nexport class JoinGridComponent extends BaseAngularComponent implements AfterViewInit {\n /**\n * Required: the name of the entity that will be used for displaying data for rows. This means that each row in the RowsEntity will be shown as a row in the grid\n * where the RowsEntityDisplayField will be used in the first column of the grid.\n */\n @Input() RowsEntityName!: string\n /**\n * Optional: if provided, this value will be shown in the top-left corner of the grid instead of the RowsEntityName\n */\n @Input() RowsEntityDisplayName?: string\n\n public get RowsEntityDisplayNameOrName(): string {\n return this.RowsEntityDisplayName ? this.RowsEntityDisplayName : this.RowsEntityName;\n }\n\n /**\n * Required: the field name in the RowsEntityName that will be shown in the first column in the grid\n */\n @Input() RowsEntityDisplayField!: string\n /**\n * Determines how the row data will be fetched. \n * * When set to FullEntity, all rows in the specified RowEntityName will be used.\n * * When set to ViewName, the RowsEntityViewName will be used to fetch the rows from a defined User View\n * * When set to Array, the RowsEntityData array will be used to fetch the rows\n */\n @Input() RowsEntityDataSource: 'FullEntity' | 'ViewName' | 'Array' = 'FullEntity'\n\n /**\n * For RowsEntityDataSource = FullEntity or ViewName, this is the extra filter to apply to the rows entity when fetching data. This is optional.\n */\n @Input() RowsExtraFilter?: string\n\n /**\n * For RowsEntityDataSource = FullEntity or ViewName, this is the order by clause to apply to the rows entity when fetching data. This is optional.\n */\n @Input() RowsOrderBy?: string\n\n /**\n * Used when RowsEntityDataSource = ViewName, this will be the name of the User View for the specified RowsEntity to run to get data\n */\n @Input() RowsEntityViewName?: string\n\n /**\n * Required: provide an array of BaseEntity objects that will be used to display the rows in the grid.\n */\n @Input() RowsEntityArray?: BaseEntity[];\n\n /**\n * When set to Entity, the ColumnsEntity and related settings will be used to build the columns in the grid. When set to Fields, fields from the JoinEntity will be used to build the columns in the grid.\n */\n @Input() ColumnsMode: 'Entity' | 'Fields' = 'Entity'\n\n /**\n * Required when ColumnsMode is set to Entity: the name of the entity that will be used for displaying data for columns. This means that each row in the ColumnsEntity will be shown as a column in the grid\n */\n @Input() ColumnsEntityName!: string\n\n /**\n * Required when ColumnsMode is set to Entity: the field name in the ColumnsEntityName that will be shown as columns in the grid\n */\n @Input() ColumnsEntityDisplayField!: string\n\n /**\n * Determines how the column data will be fetched.\n * * When set to FullEntity, all columns in the specified ColumnsEntityName will be used.\n * * When set to ViewName, the ColumnsEntityViewName will be used to fetch the columns from a defined User View\n * * When set to Array, the ColumnsEntityArray array will be used to fetch the columns\n */\n @Input() ColumnsEntityDataSource: 'FullEntity' | 'ViewName' | 'Array' = 'FullEntity'\n\n /**\n * For ColumnsEntityDataSource = FullEntity or ViewName, this is the extra filter to apply to the columns entity when fetching data. This is optional.\n */\n @Input() ColumnsExtraFilter?: string\n\n /**\n * For ColumnsEntityDataSource = FullEntity or ViewName, this is the order by clause to apply to the columns entity when fetching data. This is optional.\n */\n @Input() ColumnsOrderBy?: string\n\n /**\n * Used when ColumnsEntityDataSource = ViewName, this will be the name of the User View for the specified ColumnsEntity to run to get data\n */\n @Input() ColumnsEntityViewName?: string\n\n /**\n * Required when ColumnsMode is set to Entity: provide an array of BaseEntity objects that will be used to display the columns in the grid.\n */ \n @Input() ColumnsEntityArray?: BaseEntity[] \n\n /**\n * The name of the entity that will be used for joining the RowsEntity and ColumnsEntity. Or, in the case of ColumnsMode = Fields, there is no true \"joining\" happening but we are joining the data from the RowsEntity and JoinEntity together.\n */\n @Input() JoinEntityName!: string\n\n /**\n * The name of the foreign key field in the JoinEntity that will be used to link to the Primary Key field in the RowsEntity\n */\n @Input() JoinEntityRowForeignKey!: string\n\n /**\n * The name of the foreign key field in the JoinEntity that will be used to link to the Primary Key field in the ColumnsEntity\n */\n @Input() JoinEntityColumnForeignKey!: string\n\n /**\n * The names of the columns from the JoinEntity to display as columns in the grid. This is only used when ColumnsMode is set to Fields.\n */\n @Input() JoinEntityDisplayColumns?: string[]\n\n /**\n * When specified, this filter is used to further constrain the data in the JoinEntity. This is optional but is generally\n * most useful when ColumnsMode is set to Fields and you want to filter the data in the JoinEntity based on some criteria.\n */\n @Input() JoinEntityExtraFilter?: string\n\n /**\n * ONLY USED WHEN ColumnsMode=Entity\n * When this property is set to JoinRecordExists the grid will operate as follows:\n * * When a user checks the checkbox in the grid, a record will be created in the JoinEntity with the Row and Column foreign keys.\n * * When a user unchecks the checkbox in the grid, the record in the JoinEntity will be deleted.\n * In comparison, when the CheckBoxValueMode is set to ColumnValue, the grid will operate as follows:\n * * When a user checks the checkbox in the grid, a value in the JoinEntity will be set to true in the CheckBoxValueField field.\n * * When a user unchecks the checkbox in the grid, the value in the JoinEntity will be set to false in the CheckBoxValueField field.\n */\n @Input() CheckBoxValueMode: 'RecordExists' | 'ColumnValue' = 'RecordExists'\n\n /**\n * Required when CheckBoxValueMode is set to ColumnValue: the name of the field in the JoinEntity that will be used to store the value of the checkbox.\n */\n @Input() CheckBoxValueField!: string\n\n /**\n * When the CheckBoxValueMode is set to RecordExists this means the grid will be adding and removing records from the JoinEntity. In some cases, entities require additional values\n * beyond the foreign keys that are automatically set, in those cases, use this property to provide additional default values for the new records that are created.\n */\n @Input() NewRecordDefaultValues?: { [key: string]: any }\n\n /**\n * When set to true, the Save button is shown\n */\n @Input() ShowSaveButton: boolean = true\n /**\n * When set to true, the Cancel button is shown\n */\n @Input() ShowCancelButton: boolean = true;\n\n /**\n * Change the value of this property to true or false when you want to enter or exit edit mode. Only use this when the grid\n * is embedded in another form and you are not showing the built-in save/cancel buttons\n */\n @Input() EditMode: 'None' | 'Save' | 'Queue' = 'None';\n\n constructor(private cdr: ChangeDetectorRef, private elementRef: ElementRef) {\n super();\n }\n\n\n /*The below members are public because the Angular template needs access to them, but by naming convention we prefix with an _ so that it is clear they are not to be used outside of the component */\n public _GridData: JoinGridRow[] = [];\n public _IsLoading: boolean = false;\n\n /* protected internal members */\n protected _rowsEntityInfo: EntityInfo | null = null;\n protected _columnsEntityInfo: EntityInfo | null = null;\n protected _columnsEntityData: BaseEntity[] | undefined = undefined;\n protected _rowsEntityData: BaseEntity[] | undefined = undefined;\n protected _joinEntityData: BaseEntity[] | undefined = undefined;\n\n /**\n * Saves all of the changes made in the grid. This includes adding new records, updating existing records, and deleting records.\n */\n public async Save(): Promise<boolean> {\n // for each pending delete, we need to delete the record\n // for each pending insert, we need to save the record\n // do it all in one transaction\n const p = this.ProviderToUse;\n const tg = await p.CreateTransactionGroup();\n\n if (this.ColumnsMode === 'Entity') {\n let validated = true;\n const valErrors: ValidationErrorInfo[][] = [];\n for (const obj of this._pendingDeletes) {\n obj.TransactionGroup = tg;\n await obj.Delete();\n }\n for (const obj of this._pendingInserts) {\n obj.TransactionGroup = tg;\n const valResult = obj.Validate()\n validated = validated && valResult.Success;\n valErrors.push(valResult.Errors);\n await obj.Save();\n }\n\n if (validated) {\n if (!await tg.Submit()) {\n alert ('Error saving changes');\n return false;\n }\n else {\n await this.Refresh(); // refresh afterwards\n return true; \n } \n }\n else {\n alert ('Error validating changes, details in console');\n console.log(valErrors);\n return false;\n } \n }\n else {\n // in fields mode we use the _joinEntityData array to save the changes\n let validated = true;\n const valErrors: ValidationErrorInfo[][] = [];\n if (this._joinEntityData) {\n for (const obj of this._joinEntityData) {\n if (obj.Dirty) {\n obj.TransactionGroup = tg;\n const valResult = obj.Validate()\n validated = validated && valResult.Success;\n valErrors.push(valResult.Errors);\n await obj.Save();\n }\n }\n }\n\n if (validated) {\n if (!await tg.Submit()) {\n alert ('Error saving changes');\n return false;\n }\n else {\n await this.Refresh(); // refresh afterwards\n return true; \n } \n }\n else {\n alert ('Error validating changes, details in console');\n console.log(valErrors);\n return false;\n }\n }\n }\n\n /**\n * Cancels any changes and reverts to the prior state of the grid that reflects the last saved state.\n */\n public async CancelEdit() {\n // go through all of the pending deletes and remove them from the array\n // and go through all of the pending inserts and remove them from the array\n // before removing stuff from arrays we need to go back through all of hte grid cells and restore to original data\n this._GridData.forEach(row => {\n row.ColumnData.forEach(cell => {\n // for each cell, if we have a data object, look for a match in the pending inserts array, that means it is a NEW record\n if (cell.data) {\n const match = this._pendingInserts.find(obj => obj.Get(this.JoinEntityColumnForeignKey) === cell.ColumnForeignKeyValue && obj.Get(this.JoinEntityRowForeignKey) === row.RowForeignKeyValue);\n if (match) {\n // means that the current cell is a new record, so we need to remove it\n cell.data = undefined;\n this._pendingInserts.splice(this._pendingInserts.indexOf(match), 1);\n }\n }\n else {\n // we need to check if a match exists in the pending deletes array, if so, we need to restore the data\n const match = this._pendingDeletes.find(obj => obj.Get(this.JoinEntityColumnForeignKey) === cell.ColumnForeignKeyValue && obj.Get(this.JoinEntityRowForeignKey) === row.RowForeignKeyValue);\n if (match) {\n cell.data = match;\n this._pendingDeletes.splice(this._pendingDeletes.indexOf(match), 1);\n }\n }\n });\n })\n }\n\n public get NumDirtyRecords(): number {\n return this._pendingDeletes.length + this._pendingInserts.length;\n }\n\n public IsRecordReallyDirty(row: JoinGridRow): boolean {\n return false;\n }\n\n public IsCellReallyDirty(cell: JoinGridCell): boolean {\n if (cell.data) {\n // we have a record here, check if it is dirty or not as step 1\n if (cell.data.Dirty)\n return true;\n }\n else {\n // we need to see if we previoulsy HAD a data element in the cell but we removed it and it is located in the pendingDeletes array\n const record = this._pendingDeletes.find(obj => obj.Get(this.JoinEntityColumnForeignKey) === cell.ColumnForeignKeyValue && \n obj.Get(this.JoinEntityRowForeignKey) === cell.RowForeignKeyValue);\n if (record)\n return true; // found a pending delete, we're dirty\n }\n return false;\n }\n\n /**\n * This method is called automatically when the component is first loaded. Call the method anytime if you want to refresh the grid.\n */\n public async Refresh() {\n this._IsLoading = true; // turn on the loading spinner\n this.cdr.detectChanges(); // let angular know we have changes\n\n this._pendingDeletes = [];\n this._pendingInserts = [];\n this._joinEntityData = undefined;\n\n // we are provided an array of Column and Row objects. We need to get the rows from the JoinEntity that link them up.\n const md = this.ProviderToUse;\n // The join entity's JoinEntityRowForeignKey / JoinEntityColumnForeignKey are single foreign-key columns,\n // so the rows and columns entities they reference must be single-column keyed — a composite key\n // cannot be the target of one FK column. Fail loudly rather than silently truncating the key.\n if (this.ColumnsMode === 'Entity') {\n this._columnsEntityInfo = md.EntityByName(this.ColumnsEntityName) ?? null;\n if (!this._columnsEntityInfo)\n throw new Error('Invalid entity name provided for columns entity.');\n if (this._columnsEntityInfo.PrimaryKeys.length !== 1)\n throw new Error(`Columns entity '${this.ColumnsEntityName}' must have a single-column primary key to be referenced by ${this.JoinEntityColumnForeignKey}.`);\n }\n this._rowsEntityInfo = md.EntityByName(this.RowsEntityName) ?? null;\n if (!this._rowsEntityInfo)\n throw new Error('Invalid entity name provided for rows entity.');\n if (this._rowsEntityInfo.PrimaryKeys.length !== 1)\n throw new Error(`Rows entity '${this.RowsEntityName}' must have a single-column primary key to be referenced by ${this.JoinEntityRowForeignKey}.`);\n\n await this.PopulateRowsAndColsData();\n\n const rowQuotes = this._rowsEntityInfo.FirstPrimaryKey.NeedsQuotes ? \"'\" : \"\"; // first-pk-ok: FK target — JoinEntityRowForeignKey references the rows entity's single-column key (guarded above)\n let filter = `${this.JoinEntityRowForeignKey} IN (${this._rowsEntityData!.map(obj => `${rowQuotes}${obj.Get(this._rowsEntityInfo!.FirstPrimaryKey.Name)}${rowQuotes}`).join(',')})`; // first-pk-ok: FK target — JoinEntityRowForeignKey references the rows entity's single-column key (guarded above)\n if (this.ColumnsMode === 'Entity' && this._columnsEntityInfo) {\n const colQuotes = this._columnsEntityInfo.FirstPrimaryKey.NeedsQuotes ? \"'\" : \"\"; // first-pk-ok: FK target — JoinEntityColumnForeignKey references the columns entity's single-column key (guarded above)\n filter += ` AND ${this.JoinEntityColumnForeignKey} IN (${this._columnsEntityData!.map(obj => `${colQuotes}${obj.Get(this._columnsEntityInfo!.FirstPrimaryKey.Name)}${colQuotes}`).join(',')})`; // first-pk-ok: FK target — JoinEntityColumnForeignKey references the columns entity's single-column key (guarded above)\n }\n if (this.JoinEntityExtraFilter) {\n filter = `(${filter}) AND (${this.JoinEntityExtraFilter})`;\n }\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView(\n { \n EntityName: this.JoinEntityName, \n ExtraFilter: filter,\n ResultType: 'entity_object'\n });\n if (result && result.Success) {\n // we have the data, now we need to build the grid\n this._joinEntityData = result.Results;\n this.PopulateGridData();\n }\n\n this._IsLoading = false; // turn off the loading spinner\n this.cdr.detectChanges(); // let Angular know we have changes\n }\n\n protected async PopulateRowsAndColsData() {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n if (this.ColumnsMode==='Entity') {\n // only populate the columns if we are using the entity mode, otherwise the array from JoinGridDisplayColumns will be used\n if (this.ColumnsEntityDataSource === 'Array') {\n this._columnsEntityData = this.ColumnsEntityArray;\n }\n else {\n this._columnsEntityData = await this.RunColumnsOrRowsView(this.ColumnsEntityDataSource, this.ColumnsEntityName, this.ColumnsEntityViewName, this.ColumnsExtraFilter, this.ColumnsOrderBy);\n } \n }\n if (this.RowsEntityDataSource === 'Array') {\n this._rowsEntityData = this.RowsEntityArray;\n }\n else {\n this._rowsEntityData = await this.RunColumnsOrRowsView(this.RowsEntityDataSource, this.RowsEntityName, this.RowsEntityViewName, this.RowsExtraFilter, this.RowsOrderBy);\n }\n }\n\n protected async RunColumnsOrRowsView(dataSource: 'FullEntity' | 'ViewName', entityName: string, viewName?: string, extraFilter?: string, orderBy?: string): Promise<BaseEntity[]> {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const params: RunViewParams = dataSource === 'FullEntity' ? { EntityName: entityName } : { ViewName: viewName };\n if (extraFilter)\n params.ExtraFilter = extraFilter;\n if (orderBy) \n params.OrderBy = orderBy;\n\n params.ResultType = 'entity_object';\n const data = await rv.RunView(params);\n if (data && data.Success) {\n return data.Results; \n }\n else {\n return [];\n }\n }\n\n protected async PopulateGridData() {\n // we have the data, now we need to build the grid\n // we need to build the grid data\n if (!this._joinEntityData)\n throw new Error('_joinEntityData must be populated before calling PopulateGridData()')\n\n const gridData: any[] = [];\n this._rowsEntityData!.forEach((row, rowIndex) => {\n let rowData: JoinGridRow = new JoinGridRow({\n FirstColValue: row.Get(this.RowsEntityDisplayField),\n JoinExists: false,\n RowForeignKeyValue: row.Get(this._rowsEntityInfo!.FirstPrimaryKey.Name), // first-pk-ok: FK target — JoinEntityRowForeignKey references the rows entity's single-column key (guarded in Refresh)\n ColumnData: [] // start off with an empty array\n });\n\n // for the mode where we are using columns, do the following\n if (this.ColumnsMode === 'Entity') {\n for (let i = 0; i < this._columnsEntityData!.length; i++) {\n const column = this._columnsEntityData![i];\n const join = this._joinEntityData!.find(j => j.Get(this.JoinEntityRowForeignKey) === row.Get(this._rowsEntityInfo!.FirstPrimaryKey.Name) && // first-pk-ok: FK target — JoinEntityRowForeignKey references the rows entity's single-column key (guarded in Refresh)\n j.Get(this.JoinEntityColumnForeignKey) === column.Get(this._columnsEntityInfo!.FirstPrimaryKey.Name)); // first-pk-ok: FK target — JoinEntityColumnForeignKey references the columns entity's single-column key (guarded in Refresh)\n rowData.JoinExists = true;\n rowData.ColumnData.push({\n index: i,\n ColumnForeignKeyValue: column.Get(this._columnsEntityInfo!.FirstPrimaryKey.Name), // first-pk-ok: FK target — JoinEntityColumnForeignKey references the columns entity's single-column key (guarded in Refresh)\n RowForeignKeyValue: rowData.RowForeignKeyValue,\n data: join \n });\n }\n }\n else {\n if (!this.JoinEntityDisplayColumns)\n throw new Error('JoinEntityDisplayColumns is required when ColumnsMode is set to Fields');\n\n // we are display the values from the JoinEntity as columns from the JoinEntityDisplayColumns array\n this.JoinEntityDisplayColumns.forEach((col, i) => {\n const joinData = this._joinEntityData!.find(jed => jed.Get(this.JoinEntityRowForeignKey) === row.FirstPrimaryKey.Value) // first-pk-ok: FK target — JoinEntityRowForeignKey references the rows entity's single-column key (guarded in Refresh)\n // joinData being undefined/null is a valid condition just means no join data for the row specified\n if (joinData) {\n rowData.JoinExists = true;\n rowData.ColumnData.push({\n index: i,\n RowForeignKeyValue: rowData.RowForeignKeyValue,\n value: joinData.Get(col)\n });\n }\n });\n }\n\n gridData.push(rowData);\n });\n this._GridData = gridData;\n }\n \n\n protected _pendingDeletes: BaseEntity[] = [];\n protected _pendingInserts: BaseEntity[] = [];\n \n\n public async _FlipRecord(event: MouseEvent, row: JoinGridRow, cell: JoinGridCell, stopPropagation: boolean = false) {\n if (stopPropagation)\n event.stopPropagation();\n\n if (!cell)\n throw new Error('cell is a required parameter');\n\n if (cell.data) {\n if (cell.data.IsSaved) {\n // If this is a record that is saved, put into an array of pending deletes\n this._pendingDeletes.push(cell.data!);\n }\n else {\n // we need to find the record in the pending inserts and remove it from that array\n const index = this._pendingInserts.indexOf(cell.data);\n if (index >= 0)\n this._pendingInserts.splice(index, 1);\n }\n\n\n // Now take data off the item\n cell.data = undefined;\n } else {\n // We need to add the record, first see if the record is in the _pendingDeletes array\n let record = this._pendingDeletes.find(obj => obj.Get(this.JoinEntityColumnForeignKey) === cell.ColumnForeignKeyValue && obj.Get(this.JoinEntityRowForeignKey) === row.RowForeignKeyValue);\n if (!record) {\n const md = this.ProviderToUse;\n record = await md.GetEntityObject(this.JoinEntityName);\n record.Set(this.JoinEntityRowForeignKey, row.RowForeignKeyValue);\n record.Set(this.JoinEntityColumnForeignKey, cell.ColumnForeignKeyValue);\n for (const key in this.NewRecordDefaultValues) {\n record.Set(key, this.NewRecordDefaultValues[key]);\n }\n this._pendingInserts.push(record);\n }\n cell.data = record;\n }\n\n this.cdr.detectChanges();\n }\n\n public _IsColumnChecked(cell: JoinGridCell): boolean {\n return cell?.data !== undefined;\n }\n\n public OnDropdownValueChange(row: JoinGridRow, colIndex: number, newValue: unknown): void {\n this.UpdateCellValueDirect(row, colIndex, String(newValue));\n }\n\n public async UpdateCellValueDirect(row: JoinGridRow, colIndex: number, newValue: string) {\n // find the associated baseEntity object and update the value and then refresh the grid state from it\n if (this.ColumnsMode !== 'Fields')\n throw new Error(\"This method should only be called when ColumnsMode=Entity\")\n\n // we are good now, so now proceed to find the related object that ties to the rowForeignKey in\n // the join entity data array\n const joinData = this._joinEntityData!.find(jed => jed.Get(this.JoinEntityRowForeignKey) === row.RowForeignKeyValue)\n if (!joinData)\n LogError('Could not find join data for rowForeignKey ' + row.RowForeignKeyValue)\n else {\n const colName = this.JoinEntityDisplayColumns![colIndex];\n joinData.Set(colName, newValue);\n // also update the row's column array\n row.ColumnData[colIndex].value = joinData.Get(colName);\n }\n }\n public async UpdateCellValue(row: JoinGridRow, colIndex: number, event: Event) {\n this.UpdateCellValueDirect(row, colIndex, (event.target as HTMLInputElement).value);\n }\n\n /**\n * Only used when ColumnsMode = Fields\n * @param row \n */\n public async RemoveJoinEntityRecord(row: JoinGridRow) {\n // this method is called when the user wnats to remove a record that maps to the cell for the row specified and the colIndex\n // only used when Mode = Fields\n if (this.ColumnsMode !== 'Fields') \n throw new Error('This method should only be called when ColumnsMode=Entity') \n\n const joinData = this._joinEntityData!.find(jed => jed.Get(this.JoinEntityRowForeignKey) === row.RowForeignKeyValue)\n if (!joinData)\n LogError('Could not find join data for rowForeignKey ' + row.RowForeignKeyValue)\n else {\n this._pendingDeletes.push(joinData);\n this._joinEntityData?.splice(this._joinEntityData.indexOf(joinData), 1);\n this.PopulateGridData(); // refresh the grid's grid data array that is derived from all of the source data\n } \n }\n\n /**\n * Only used when ColumnsMode = Fields\n */\n public async AddJoinEntityRecord(row: JoinGridRow) {\n // this method is called when the user wnats to create a new record that maps to the cell for the row specified and the colIndex\n // only used when Mode = Fields\n if (this.ColumnsMode !== 'Fields') \n throw new Error('This method should only be called when ColumnsMode=Entity') \n\n const md = this.ProviderToUse;\n // first check to see if this is in the _pendingDeletes array, if so, we need to remove it from there\n let newObj = this._pendingDeletes!.find(pd => pd.Get(this.JoinEntityRowForeignKey) === row.RowForeignKeyValue)\n if (newObj) {\n this._pendingDeletes.splice(this._pendingDeletes.indexOf(newObj), 1);\n }\n else {\n newObj = await md.GetEntityObject(this.JoinEntityName); \n newObj.Set(this.JoinEntityRowForeignKey, row.RowForeignKeyValue); \n }\n\n const keys = this.NewRecordDefaultValues ? Object.keys(this.NewRecordDefaultValues) : []\n for (const k of keys) {\n newObj.Set(k, this.NewRecordDefaultValues![k]);\n }\n\n this._joinEntityData?.push(newObj); // add to join data array\n if (this.EditMode === 'Save') {\n if (await newObj.Save()) {\n // all good\n }\n else {\n MJNotificationService.Instance.CreateSimpleNotification('Error saving new ' + this.JoinEntityName + ' record','error', 2500)\n }\n }\n this.PopulateGridData(); // refresh the grid's grid data array that is derived from all of the source data\n }\n\n protected async EditingComplete() {\n // we've been told that editing is done. If we are in queue mode for editing, we do nothing because we've\n // already submitted our pending changes via events (below) but if we're in save mode we save stuff now\n if (this.EditMode === 'Save') {\n await this.Save();\n }\n }\n\n protected async RevertPendingChanges() {\n // this method means we should revert back to the last saved state\n // so just call Refresh\n await this.Refresh();\n }\n \n ngAfterViewInit(): void {\n this.Refresh();\n\n // setup event listener for MJGlobal because we might have a parent component that sends us messages\n MJGlobal.Instance.GetEventListener(false).subscribe((e: MJEvent) => {\n switch (e.event) {\n case MJEventType.ComponentEvent:\n const b = BaseFormComponentEventCodes; // having issues using the const vs the type if we refer to it below directly for comparison so assign the const to a local variable first\n if (e.eventCode === b.BASE_CODE) {\n // we have an event from a BaseFormComponent, now we need to determine if WE are a descendant of that component\n const event: BaseFormComponentEvent = e.args as BaseFormComponentEvent;\n if (IsDescendantElement(event.elementRef, this.elementRef)) {\n // we are a descendant of the component that sent the event, so we need to handle it\n switch (event.subEventCode) {\n case b.EDITING_COMPLETE:\n this.EditingComplete();\n break;\n case b.REVERT_PENDING_CHANGES:\n this.RevertPendingChanges();\n break;\n case b.POPULATE_PENDING_RECORDS:\n // provide all of our pending records back to the caller\n this._joinEntityData?.forEach((r: BaseEntity) => {\n // for anything that's changed, we need to add it to the pending records\n const editingEvent: FormEditingCompleteEvent = event as FormEditingCompleteEvent;\n if (r.Dirty) {\n editingEvent.pendingChanges.push({entityObject: r, action: 'save'});\n }\n });\n\n this._pendingDeletes.forEach((r: BaseEntity) => {\n const editingEvent: FormEditingCompleteEvent = event as FormEditingCompleteEvent;\n editingEvent.pendingChanges.push({entityObject: r, action: 'delete'});\n });\n break;\n }\n }\n }\n break;\n }\n });\n }\n\n /**\n * Returns the EntityFieldInfo that matches the specific column name within the JoinEntity\n * @param colName \n */\n public GetJoinEntityField(colName: string): EntityFieldInfo {\n const md = this.ProviderToUse;\n const entity = md.EntityByName(this.JoinEntityName);\n if (!entity)\n throw new Error('Invalid entity name provided for JoinEntity');\n const field = entity.Fields.find(f => f.Name === colName);\n if (!field)\n throw new Error('Invalid field name provided for JoinEntity');\n return field;\n }\n \n public GetJoinEntityFieldValues(colName: string): string[] {\n return this.GetJoinEntityField(colName).EntityFieldValues.map(efv => efv.Value)\n }\n\n public get EntityFieldTSType() {\n return EntityFieldTSType;\n }\n}\n ","<div class=\"wrapper\">\n @if (_IsLoading) {\n <div><mj-loading [showText]=\"false\" size=\"medium\"></mj-loading></div>\n }\n @if (ShowSaveButton) {\n <button [disabled]=\"NumDirtyRecords === 0\" mjButton (click)=\"Save()\">Save</button>\n }\n @if (ShowCancelButton) {\n <button [disabled]=\"NumDirtyRecords === 0\" mjButton (click)=\"CancelEdit()\">Cancel</button>\n }\n @if (!_IsLoading) {\n <table class=\"grid\">\n <thead>\n <tr>\n <!-- First column is the name of the Rows Entity -->\n <th>{{RowsEntityDisplayNameOrName}}</th>\n @if (ColumnsMode === 'Entity') {\n @for (colRecord of this._columnsEntityData; track colRecord) {\n <th class=\"checkbox-column\">{{colRecord.Get(this.ColumnsEntityDisplayField)}}</th>\n }\n }\n @else {\n <!-- we need one column for each of the fields in the JoinEntityDisplayColumns array -->\n @for (colName of JoinEntityDisplayColumns; track colName) {\n <th>{{colName}}</th>\n }\n }\n </tr>\n </thead>\n <tbody>\n @for (row of _GridData; track row) {\n <tr [ngClass]=\"IsRecordReallyDirty(row) ? 'dirty-row' : ''\">\n <td class=\"first-column\">\n <span>{{row.FirstColValue}}</span>\n @if (EditMode !== 'None'){\n @if (!row.JoinExists) {\n <button mjButton class=\"cellButton\" aria-label=\"Add join record\" title=\"Add join record\" (click)=\"AddJoinEntityRecord(row)\"><span class=\"fa-solid fa-plus\"></span></button>\n }\n @else {\n <button mjButton class=\"cellButton\" aria-label=\"Remove join record\" title=\"Remove join record\" (click)=\"RemoveJoinEntityRecord(row)\"><span class=\"fa-solid fa-minus\"></span></button>\n }\n }\n </td>\n @if (ColumnsMode === 'Fields') {\n @for (colName of JoinEntityDisplayColumns; track colName; let i = $index) {\n <td class=\"column-cell\">\n @if (EditMode !== 'None') {\n @if (row.JoinExists) {\n @if (GetJoinEntityField(colName).ValueListType === \"None\") {\n @if (GetJoinEntityField(colName).TSType === EntityFieldTSType.Boolean) {\n <input type=\"checkbox\" [checked]=\"row.GetColumnValue(i)\" (change)=\"UpdateCellValue(row, i, $event)\" />\n }\n @else {\n <input class=\"mj-input\" [value]=\"row.GetColumnValue(i)\" (change)=\"UpdateCellValue(row, i, $event)\" />\n }\n }\n @else {\n <mj-dropdown\n [Data]=\"GetJoinEntityFieldValues(colName)\"\n [ngModel]=\"row.GetColumnValue(i)\"\n (ValueChange)=\"OnDropdownValueChange(row, i, $event)\">\n </mj-dropdown>\n }\n }\n }\n @else {\n {{row.GetColumnValue(i)}}\n }\n </td>\n }\n }\n @else {\n @for (cell of row.ColumnData; track cell) {\n <!-- loop through all the columns and display a checkbox and check it if we have a match in the current row -->\n <td class=\"checkbox-column\" (click)=\"_FlipRecord($event, row, cell)\"\n [ngClass]=\"IsCellReallyDirty(cell) ? 'dirty-cell' : ''\">\n @if (EditMode !== 'None') {\n <input type=\"checkbox\"\n class=\"mj-checkbox\"\n [checked]=\"_IsColumnChecked(cell)\"\n (click)=\"_FlipRecord($event, row, cell, true)\">\n }\n @else {\n {{cell.value ? '✓' : ''}}\n }\n </td>\n}\n}\n</tr>\n}\n</tbody>\n</table>\n}\n</div>\n"]}
1
+ {"version":3,"file":"join-grid.component.js","sourceRoot":"","sources":["../../../src/lib/join-grid/join-grid.component.ts","../../../src/lib/join-grid/join-grid.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgD,MAAM,eAAe,CAAC;AAC/F,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE,OAAO,EAA+B,iBAAiB,EAAc,QAAQ,EAAE,OAAO,EAAsC,MAAM,sBAAsB,CAAC;AACzJ,OAAO,EAAW,WAAW,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,oBAAo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core';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { IsDescendantElement } from '@memberjunction/ng-shared-generic';\n\nimport { BaseEntity, EntityFieldInfo, EntityFieldTSType, EntityInfo, LogError, RunView, RunViewParams, ValidationErrorInfo } from '@memberjunction/core';\nimport { MJEvent, MJEventType, MJGlobal } from '@memberjunction/global';\nimport { BaseAngularComponent, BaseFormComponentEvent, BaseFormComponentEventCodes, FormEditingCompleteEvent } from '@memberjunction/ng-base-types';\n\nexport class JoinGridCell {\n index!: number; // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply\n RowForeignKeyValue: any;\n ColumnForeignKeyValue?: any;\n /**\n * Used when the ColumnsMode is set to Entity. This is the BaseEntity object that represents the data in the JoinEntity that links the Row and Column entities together.\n */\n data?: BaseEntity | undefined; // case-violation-ok-legacy-back-compat: an accessor cannot be optional, so a stub would turn this into a required member\n /**\n * Used when the ColumnsMode is set to Fields. This is an array of values from the JoinEntity that are displayed as columns in the grid.\n */\n value?: any // case-violation-ok-legacy-back-compat: an accessor cannot be optional, so a stub would turn this into a required member\n}\nexport class JoinGridRow {\n FirstColValue: any;\n JoinExists: boolean = false;\n RowForeignKeyValue: any;\n ColumnData: JoinGridCell[] = []\n GetColumnValue(colIndex: number): any {\n return this.ColumnData && this.ColumnData.length > colIndex ? this.ColumnData[colIndex].value : undefined\n }\n constructor (data: any) {\n this.FirstColValue = data.FirstColValue;\n this.JoinExists = data.JoinExists;\n this.RowForeignKeyValue = data.RowForeignKeyValue;\n this.ColumnData = data.ColumnData;\n }\n}\n\n@Component({\n standalone: false,\n selector: 'mj-join-grid',\n templateUrl: './join-grid.component.html',\n styleUrls: ['./join-grid.component.css']\n})\nexport class JoinGridComponent extends BaseAngularComponent implements AfterViewInit {\n /**\n * Required: the name of the entity that will be used for displaying data for rows. This means that each row in the RowsEntity will be shown as a row in the grid\n * where the RowsEntityDisplayField will be used in the first column of the grid.\n */\n @Input() RowsEntityName!: string\n /**\n * Optional: if provided, this value will be shown in the top-left corner of the grid instead of the RowsEntityName\n */\n @Input() RowsEntityDisplayName?: string\n\n public get RowsEntityDisplayNameOrName(): string {\n return this.RowsEntityDisplayName ? this.RowsEntityDisplayName : this.RowsEntityName;\n }\n\n /**\n * Required: the field name in the RowsEntityName that will be shown in the first column in the grid\n */\n @Input() RowsEntityDisplayField!: string\n /**\n * Determines how the row data will be fetched. \n * * When set to FullEntity, all rows in the specified RowEntityName will be used.\n * * When set to ViewName, the RowsEntityViewName will be used to fetch the rows from a defined User View\n * * When set to Array, the RowsEntityData array will be used to fetch the rows\n */\n @Input() RowsEntityDataSource: 'FullEntity' | 'ViewName' | 'Array' = 'FullEntity'\n\n /**\n * For RowsEntityDataSource = FullEntity or ViewName, this is the extra filter to apply to the rows entity when fetching data. This is optional.\n */\n @Input() RowsExtraFilter?: string\n\n /**\n * For RowsEntityDataSource = FullEntity or ViewName, this is the order by clause to apply to the rows entity when fetching data. This is optional.\n */\n @Input() RowsOrderBy?: string\n\n /**\n * Used when RowsEntityDataSource = ViewName, this will be the name of the User View for the specified RowsEntity to run to get data\n */\n @Input() RowsEntityViewName?: string\n\n /**\n * Required: provide an array of BaseEntity objects that will be used to display the rows in the grid.\n */\n @Input() RowsEntityArray?: BaseEntity[];\n\n /**\n * When set to Entity, the ColumnsEntity and related settings will be used to build the columns in the grid. When set to Fields, fields from the JoinEntity will be used to build the columns in the grid.\n */\n @Input() ColumnsMode: 'Entity' | 'Fields' = 'Entity'\n\n /**\n * Required when ColumnsMode is set to Entity: the name of the entity that will be used for displaying data for columns. This means that each row in the ColumnsEntity will be shown as a column in the grid\n */\n @Input() ColumnsEntityName!: string\n\n /**\n * Required when ColumnsMode is set to Entity: the field name in the ColumnsEntityName that will be shown as columns in the grid\n */\n @Input() ColumnsEntityDisplayField!: string\n\n /**\n * Determines how the column data will be fetched.\n * * When set to FullEntity, all columns in the specified ColumnsEntityName will be used.\n * * When set to ViewName, the ColumnsEntityViewName will be used to fetch the columns from a defined User View\n * * When set to Array, the ColumnsEntityArray array will be used to fetch the columns\n */\n @Input() ColumnsEntityDataSource: 'FullEntity' | 'ViewName' | 'Array' = 'FullEntity'\n\n /**\n * For ColumnsEntityDataSource = FullEntity or ViewName, this is the extra filter to apply to the columns entity when fetching data. This is optional.\n */\n @Input() ColumnsExtraFilter?: string\n\n /**\n * For ColumnsEntityDataSource = FullEntity or ViewName, this is the order by clause to apply to the columns entity when fetching data. This is optional.\n */\n @Input() ColumnsOrderBy?: string\n\n /**\n * Used when ColumnsEntityDataSource = ViewName, this will be the name of the User View for the specified ColumnsEntity to run to get data\n */\n @Input() ColumnsEntityViewName?: string\n\n /**\n * Required when ColumnsMode is set to Entity: provide an array of BaseEntity objects that will be used to display the columns in the grid.\n */ \n @Input() ColumnsEntityArray?: BaseEntity[] \n\n /**\n * The name of the entity that will be used for joining the RowsEntity and ColumnsEntity. Or, in the case of ColumnsMode = Fields, there is no true \"joining\" happening but we are joining the data from the RowsEntity and JoinEntity together.\n */\n @Input() JoinEntityName!: string\n\n /**\n * The name of the foreign key field in the JoinEntity that will be used to link to the Primary Key field in the RowsEntity\n */\n @Input() JoinEntityRowForeignKey!: string\n\n /**\n * The name of the foreign key field in the JoinEntity that will be used to link to the Primary Key field in the ColumnsEntity\n */\n @Input() JoinEntityColumnForeignKey!: string\n\n /**\n * The names of the columns from the JoinEntity to display as columns in the grid. This is only used when ColumnsMode is set to Fields.\n */\n @Input() JoinEntityDisplayColumns?: string[]\n\n /**\n * When specified, this filter is used to further constrain the data in the JoinEntity. This is optional but is generally\n * most useful when ColumnsMode is set to Fields and you want to filter the data in the JoinEntity based on some criteria.\n */\n @Input() JoinEntityExtraFilter?: string\n\n /**\n * ONLY USED WHEN ColumnsMode=Entity\n * When this property is set to JoinRecordExists the grid will operate as follows:\n * * When a user checks the checkbox in the grid, a record will be created in the JoinEntity with the Row and Column foreign keys.\n * * When a user unchecks the checkbox in the grid, the record in the JoinEntity will be deleted.\n * In comparison, when the CheckBoxValueMode is set to ColumnValue, the grid will operate as follows:\n * * When a user checks the checkbox in the grid, a value in the JoinEntity will be set to true in the CheckBoxValueField field.\n * * When a user unchecks the checkbox in the grid, the value in the JoinEntity will be set to false in the CheckBoxValueField field.\n */\n @Input() CheckBoxValueMode: 'RecordExists' | 'ColumnValue' = 'RecordExists'\n\n /**\n * Required when CheckBoxValueMode is set to ColumnValue: the name of the field in the JoinEntity that will be used to store the value of the checkbox.\n */\n @Input() CheckBoxValueField!: string\n\n /**\n * When the CheckBoxValueMode is set to RecordExists this means the grid will be adding and removing records from the JoinEntity. In some cases, entities require additional values\n * beyond the foreign keys that are automatically set, in those cases, use this property to provide additional default values for the new records that are created.\n */\n @Input() NewRecordDefaultValues?: { [key: string]: any }\n\n /**\n * When set to true, the Save button is shown\n */\n @Input() ShowSaveButton: boolean = true\n /**\n * When set to true, the Cancel button is shown\n */\n @Input() ShowCancelButton: boolean = true;\n\n /**\n * Change the value of this property to true or false when you want to enter or exit edit mode. Only use this when the grid\n * is embedded in another form and you are not showing the built-in save/cancel buttons\n */\n @Input() EditMode: 'None' | 'Save' | 'Queue' = 'None';\n\n constructor(private cdr: ChangeDetectorRef, private elementRef: ElementRef) {\n super();\n }\n\n\n /*The below members are public because the Angular template needs access to them, but by naming convention we prefix with an _ so that it is clear they are not to be used outside of the component */\n public GridData: JoinGridRow[] = [];\n\n /** @deprecated Use {@link GridData}. */\n public get _GridData(): JoinGridRow[] {\n return this.GridData;\n }\n /** @deprecated Use {@link GridData}. */\n public set _GridData(value: JoinGridRow[]) {\n this.GridData = value;\n }\n public IsLoading: boolean = false;\n\n /** @deprecated Use {@link IsLoading}. */\n public get _IsLoading(): boolean {\n return this.IsLoading;\n }\n /** @deprecated Use {@link IsLoading}. */\n public set _IsLoading(value: boolean) {\n this.IsLoading = value;\n }\n\n /* protected internal members */\n protected _rowsEntityInfo: EntityInfo | null = null;\n protected _columnsEntityInfo: EntityInfo | null = null;\n protected _columnsEntityData: BaseEntity[] | undefined = undefined;\n protected _rowsEntityData: BaseEntity[] | undefined = undefined;\n protected _joinEntityData: BaseEntity[] | undefined = undefined;\n\n /**\n * Saves all of the changes made in the grid. This includes adding new records, updating existing records, and deleting records.\n */\n public async Save(): Promise<boolean> {\n // for each pending delete, we need to delete the record\n // for each pending insert, we need to save the record\n // do it all in one transaction\n const p = this.ProviderToUse;\n const tg = await p.CreateTransactionGroup();\n\n if (this.ColumnsMode === 'Entity') {\n let validated = true;\n const valErrors: ValidationErrorInfo[][] = [];\n for (const obj of this._pendingDeletes) {\n obj.TransactionGroup = tg;\n await obj.Delete();\n }\n for (const obj of this._pendingInserts) {\n obj.TransactionGroup = tg;\n const valResult = obj.Validate()\n validated = validated && valResult.Success;\n valErrors.push(valResult.Errors);\n await obj.Save();\n }\n\n if (validated) {\n if (!await tg.Submit()) {\n alert ('Error saving changes');\n return false;\n }\n else {\n await this.Refresh(); // refresh afterwards\n return true; \n } \n }\n else {\n alert ('Error validating changes, details in console');\n console.log(valErrors);\n return false;\n } \n }\n else {\n // in fields mode we use the _joinEntityData array to save the changes\n let validated = true;\n const valErrors: ValidationErrorInfo[][] = [];\n if (this._joinEntityData) {\n for (const obj of this._joinEntityData) {\n if (obj.Dirty) {\n obj.TransactionGroup = tg;\n const valResult = obj.Validate()\n validated = validated && valResult.Success;\n valErrors.push(valResult.Errors);\n await obj.Save();\n }\n }\n }\n\n if (validated) {\n if (!await tg.Submit()) {\n alert ('Error saving changes');\n return false;\n }\n else {\n await this.Refresh(); // refresh afterwards\n return true; \n } \n }\n else {\n alert ('Error validating changes, details in console');\n console.log(valErrors);\n return false;\n }\n }\n }\n\n /**\n * Cancels any changes and reverts to the prior state of the grid that reflects the last saved state.\n */\n public async CancelEdit() {\n // go through all of the pending deletes and remove them from the array\n // and go through all of the pending inserts and remove them from the array\n // before removing stuff from arrays we need to go back through all of hte grid cells and restore to original data\n this.GridData.forEach(row => {\n row.ColumnData.forEach(cell => {\n // for each cell, if we have a data object, look for a match in the pending inserts array, that means it is a NEW record\n if (cell.data) {\n const match = this._pendingInserts.find(obj => obj.Get(this.JoinEntityColumnForeignKey) === cell.ColumnForeignKeyValue && obj.Get(this.JoinEntityRowForeignKey) === row.RowForeignKeyValue);\n if (match) {\n // means that the current cell is a new record, so we need to remove it\n cell.data = undefined;\n this._pendingInserts.splice(this._pendingInserts.indexOf(match), 1);\n }\n }\n else {\n // we need to check if a match exists in the pending deletes array, if so, we need to restore the data\n const match = this._pendingDeletes.find(obj => obj.Get(this.JoinEntityColumnForeignKey) === cell.ColumnForeignKeyValue && obj.Get(this.JoinEntityRowForeignKey) === row.RowForeignKeyValue);\n if (match) {\n cell.data = match;\n this._pendingDeletes.splice(this._pendingDeletes.indexOf(match), 1);\n }\n }\n });\n })\n }\n\n public get NumDirtyRecords(): number {\n return this._pendingDeletes.length + this._pendingInserts.length;\n }\n\n public IsRecordReallyDirty(row: JoinGridRow): boolean {\n return false;\n }\n\n public IsCellReallyDirty(cell: JoinGridCell): boolean {\n if (cell.data) {\n // we have a record here, check if it is dirty or not as step 1\n if (cell.data.Dirty)\n return true;\n }\n else {\n // we need to see if we previoulsy HAD a data element in the cell but we removed it and it is located in the pendingDeletes array\n const record = this._pendingDeletes.find(obj => obj.Get(this.JoinEntityColumnForeignKey) === cell.ColumnForeignKeyValue && \n obj.Get(this.JoinEntityRowForeignKey) === cell.RowForeignKeyValue);\n if (record)\n return true; // found a pending delete, we're dirty\n }\n return false;\n }\n\n /**\n * This method is called automatically when the component is first loaded. Call the method anytime if you want to refresh the grid.\n */\n public async Refresh() {\n this.IsLoading = true; // turn on the loading spinner\n this.cdr.detectChanges(); // let angular know we have changes\n\n this._pendingDeletes = [];\n this._pendingInserts = [];\n this._joinEntityData = undefined;\n\n // we are provided an array of Column and Row objects. We need to get the rows from the JoinEntity that link them up.\n const md = this.ProviderToUse;\n // The join entity's JoinEntityRowForeignKey / JoinEntityColumnForeignKey are single foreign-key columns,\n // so the rows and columns entities they reference must be single-column keyed — a composite key\n // cannot be the target of one FK column. Fail loudly rather than silently truncating the key.\n if (this.ColumnsMode === 'Entity') {\n this._columnsEntityInfo = md.EntityByName(this.ColumnsEntityName) ?? null;\n if (!this._columnsEntityInfo)\n throw new Error('Invalid entity name provided for columns entity.');\n if (this._columnsEntityInfo.PrimaryKeys.length !== 1)\n throw new Error(`Columns entity '${this.ColumnsEntityName}' must have a single-column primary key to be referenced by ${this.JoinEntityColumnForeignKey}.`);\n }\n this._rowsEntityInfo = md.EntityByName(this.RowsEntityName) ?? null;\n if (!this._rowsEntityInfo)\n throw new Error('Invalid entity name provided for rows entity.');\n if (this._rowsEntityInfo.PrimaryKeys.length !== 1)\n throw new Error(`Rows entity '${this.RowsEntityName}' must have a single-column primary key to be referenced by ${this.JoinEntityRowForeignKey}.`);\n\n await this.PopulateRowsAndColsData();\n\n const rowQuotes = this._rowsEntityInfo.FirstPrimaryKey.NeedsQuotes ? \"'\" : \"\"; // first-pk-ok: FK target — JoinEntityRowForeignKey references the rows entity's single-column key (guarded above)\n let filter = `${this.JoinEntityRowForeignKey} IN (${this._rowsEntityData!.map(obj => `${rowQuotes}${obj.Get(this._rowsEntityInfo!.FirstPrimaryKey.Name)}${rowQuotes}`).join(',')})`; // first-pk-ok: FK target — JoinEntityRowForeignKey references the rows entity's single-column key (guarded above)\n if (this.ColumnsMode === 'Entity' && this._columnsEntityInfo) {\n const colQuotes = this._columnsEntityInfo.FirstPrimaryKey.NeedsQuotes ? \"'\" : \"\"; // first-pk-ok: FK target — JoinEntityColumnForeignKey references the columns entity's single-column key (guarded above)\n filter += ` AND ${this.JoinEntityColumnForeignKey} IN (${this._columnsEntityData!.map(obj => `${colQuotes}${obj.Get(this._columnsEntityInfo!.FirstPrimaryKey.Name)}${colQuotes}`).join(',')})`; // first-pk-ok: FK target — JoinEntityColumnForeignKey references the columns entity's single-column key (guarded above)\n }\n if (this.JoinEntityExtraFilter) {\n filter = `(${filter}) AND (${this.JoinEntityExtraFilter})`;\n }\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView(\n { \n EntityName: this.JoinEntityName, \n ExtraFilter: filter,\n ResultType: 'entity_object'\n });\n if (result && result.Success) {\n // we have the data, now we need to build the grid\n this._joinEntityData = result.Results;\n this.PopulateGridData();\n }\n\n this.IsLoading = false; // turn off the loading spinner\n this.cdr.detectChanges(); // let Angular know we have changes\n }\n\n protected async PopulateRowsAndColsData() {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n if (this.ColumnsMode==='Entity') {\n // only populate the columns if we are using the entity mode, otherwise the array from JoinGridDisplayColumns will be used\n if (this.ColumnsEntityDataSource === 'Array') {\n this._columnsEntityData = this.ColumnsEntityArray;\n }\n else {\n this._columnsEntityData = await this.RunColumnsOrRowsView(this.ColumnsEntityDataSource, this.ColumnsEntityName, this.ColumnsEntityViewName, this.ColumnsExtraFilter, this.ColumnsOrderBy);\n } \n }\n if (this.RowsEntityDataSource === 'Array') {\n this._rowsEntityData = this.RowsEntityArray;\n }\n else {\n this._rowsEntityData = await this.RunColumnsOrRowsView(this.RowsEntityDataSource, this.RowsEntityName, this.RowsEntityViewName, this.RowsExtraFilter, this.RowsOrderBy);\n }\n }\n\n protected async RunColumnsOrRowsView(dataSource: 'FullEntity' | 'ViewName', entityName: string, viewName?: string, extraFilter?: string, orderBy?: string): Promise<BaseEntity[]> {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const params: RunViewParams = dataSource === 'FullEntity' ? { EntityName: entityName } : { ViewName: viewName };\n if (extraFilter)\n params.ExtraFilter = extraFilter;\n if (orderBy) \n params.OrderBy = orderBy;\n\n params.ResultType = 'entity_object';\n const data = await rv.RunView(params);\n if (data && data.Success) {\n return data.Results; \n }\n else {\n return [];\n }\n }\n\n protected async PopulateGridData() {\n // we have the data, now we need to build the grid\n // we need to build the grid data\n if (!this._joinEntityData)\n throw new Error('_joinEntityData must be populated before calling PopulateGridData()')\n\n const gridData: any[] = [];\n this._rowsEntityData!.forEach((row, rowIndex) => {\n let rowData: JoinGridRow = new JoinGridRow({\n FirstColValue: row.Get(this.RowsEntityDisplayField),\n JoinExists: false,\n RowForeignKeyValue: row.Get(this._rowsEntityInfo!.FirstPrimaryKey.Name), // first-pk-ok: FK target — JoinEntityRowForeignKey references the rows entity's single-column key (guarded in Refresh)\n ColumnData: [] // start off with an empty array\n });\n\n // for the mode where we are using columns, do the following\n if (this.ColumnsMode === 'Entity') {\n for (let i = 0; i < this._columnsEntityData!.length; i++) {\n const column = this._columnsEntityData![i];\n const join = this._joinEntityData!.find(j => j.Get(this.JoinEntityRowForeignKey) === row.Get(this._rowsEntityInfo!.FirstPrimaryKey.Name) && // first-pk-ok: FK target — JoinEntityRowForeignKey references the rows entity's single-column key (guarded in Refresh)\n j.Get(this.JoinEntityColumnForeignKey) === column.Get(this._columnsEntityInfo!.FirstPrimaryKey.Name)); // first-pk-ok: FK target — JoinEntityColumnForeignKey references the columns entity's single-column key (guarded in Refresh)\n rowData.JoinExists = true;\n rowData.ColumnData.push({\n index: i,\n ColumnForeignKeyValue: column.Get(this._columnsEntityInfo!.FirstPrimaryKey.Name), // first-pk-ok: FK target — JoinEntityColumnForeignKey references the columns entity's single-column key (guarded in Refresh)\n RowForeignKeyValue: rowData.RowForeignKeyValue,\n data: join \n });\n }\n }\n else {\n if (!this.JoinEntityDisplayColumns)\n throw new Error('JoinEntityDisplayColumns is required when ColumnsMode is set to Fields');\n\n // we are display the values from the JoinEntity as columns from the JoinEntityDisplayColumns array\n this.JoinEntityDisplayColumns.forEach((col, i) => {\n const joinData = this._joinEntityData!.find(jed => jed.Get(this.JoinEntityRowForeignKey) === row.FirstPrimaryKey.Value) // first-pk-ok: FK target — JoinEntityRowForeignKey references the rows entity's single-column key (guarded in Refresh)\n // joinData being undefined/null is a valid condition just means no join data for the row specified\n if (joinData) {\n rowData.JoinExists = true;\n rowData.ColumnData.push({\n index: i,\n RowForeignKeyValue: rowData.RowForeignKeyValue,\n value: joinData.Get(col)\n });\n }\n });\n }\n\n gridData.push(rowData);\n });\n this.GridData = gridData;\n }\n \n\n protected _pendingDeletes: BaseEntity[] = [];\n protected _pendingInserts: BaseEntity[] = [];\n \n\n public async FlipRecord(event: MouseEvent, row: JoinGridRow, cell: JoinGridCell, stopPropagation: boolean = false) {\n if (stopPropagation)\n event.stopPropagation();\n\n if (!cell)\n throw new Error('cell is a required parameter');\n\n if (cell.data) {\n if (cell.data.IsSaved) {\n // If this is a record that is saved, put into an array of pending deletes\n this._pendingDeletes.push(cell.data!);\n }\n else {\n // we need to find the record in the pending inserts and remove it from that array\n const index = this._pendingInserts.indexOf(cell.data);\n if (index >= 0)\n this._pendingInserts.splice(index, 1);\n }\n\n\n // Now take data off the item\n cell.data = undefined;\n } else {\n // We need to add the record, first see if the record is in the _pendingDeletes array\n let record = this._pendingDeletes.find(obj => obj.Get(this.JoinEntityColumnForeignKey) === cell.ColumnForeignKeyValue && obj.Get(this.JoinEntityRowForeignKey) === row.RowForeignKeyValue);\n if (!record) {\n const md = this.ProviderToUse;\n record = await md.GetEntityObject(this.JoinEntityName);\n record.Set(this.JoinEntityRowForeignKey, row.RowForeignKeyValue);\n record.Set(this.JoinEntityColumnForeignKey, cell.ColumnForeignKeyValue);\n for (const key in this.NewRecordDefaultValues) {\n record.Set(key, this.NewRecordDefaultValues[key]);\n }\n this._pendingInserts.push(record);\n }\n cell.data = record;\n }\n\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link FlipRecord}. */\n public async _FlipRecord(event: MouseEvent, row: JoinGridRow, cell: JoinGridCell, stopPropagation: boolean = false) {\n return this.FlipRecord(event, row, cell, stopPropagation);\n }\n\n public IsColumnChecked(cell: JoinGridCell): boolean {\n return cell?.data !== undefined;\n }\n\n /** @deprecated Use {@link IsColumnChecked}. */\n public _IsColumnChecked(cell: JoinGridCell): boolean {\n return this.IsColumnChecked(cell);\n }\n\n public OnDropdownValueChange(row: JoinGridRow, colIndex: number, newValue: unknown): void {\n this.UpdateCellValueDirect(row, colIndex, String(newValue));\n }\n\n public async UpdateCellValueDirect(row: JoinGridRow, colIndex: number, newValue: string) {\n // find the associated baseEntity object and update the value and then refresh the grid state from it\n if (this.ColumnsMode !== 'Fields')\n throw new Error(\"This method should only be called when ColumnsMode=Entity\")\n\n // we are good now, so now proceed to find the related object that ties to the rowForeignKey in\n // the join entity data array\n const joinData = this._joinEntityData!.find(jed => jed.Get(this.JoinEntityRowForeignKey) === row.RowForeignKeyValue)\n if (!joinData)\n LogError('Could not find join data for rowForeignKey ' + row.RowForeignKeyValue)\n else {\n const colName = this.JoinEntityDisplayColumns![colIndex];\n joinData.Set(colName, newValue);\n // also update the row's column array\n row.ColumnData[colIndex].value = joinData.Get(colName);\n }\n }\n public async UpdateCellValue(row: JoinGridRow, colIndex: number, event: Event) {\n this.UpdateCellValueDirect(row, colIndex, (event.target as HTMLInputElement).value);\n }\n\n /**\n * Only used when ColumnsMode = Fields\n * @param row \n */\n public async RemoveJoinEntityRecord(row: JoinGridRow) {\n // this method is called when the user wnats to remove a record that maps to the cell for the row specified and the colIndex\n // only used when Mode = Fields\n if (this.ColumnsMode !== 'Fields') \n throw new Error('This method should only be called when ColumnsMode=Entity') \n\n const joinData = this._joinEntityData!.find(jed => jed.Get(this.JoinEntityRowForeignKey) === row.RowForeignKeyValue)\n if (!joinData)\n LogError('Could not find join data for rowForeignKey ' + row.RowForeignKeyValue)\n else {\n this._pendingDeletes.push(joinData);\n this._joinEntityData?.splice(this._joinEntityData.indexOf(joinData), 1);\n this.PopulateGridData(); // refresh the grid's grid data array that is derived from all of the source data\n } \n }\n\n /**\n * Only used when ColumnsMode = Fields\n */\n public async AddJoinEntityRecord(row: JoinGridRow) {\n // this method is called when the user wnats to create a new record that maps to the cell for the row specified and the colIndex\n // only used when Mode = Fields\n if (this.ColumnsMode !== 'Fields') \n throw new Error('This method should only be called when ColumnsMode=Entity') \n\n const md = this.ProviderToUse;\n // first check to see if this is in the _pendingDeletes array, if so, we need to remove it from there\n let newObj = this._pendingDeletes!.find(pd => pd.Get(this.JoinEntityRowForeignKey) === row.RowForeignKeyValue)\n if (newObj) {\n this._pendingDeletes.splice(this._pendingDeletes.indexOf(newObj), 1);\n }\n else {\n newObj = await md.GetEntityObject(this.JoinEntityName); \n newObj.Set(this.JoinEntityRowForeignKey, row.RowForeignKeyValue); \n }\n\n const keys = this.NewRecordDefaultValues ? Object.keys(this.NewRecordDefaultValues) : []\n for (const k of keys) {\n newObj.Set(k, this.NewRecordDefaultValues![k]);\n }\n\n this._joinEntityData?.push(newObj); // add to join data array\n if (this.EditMode === 'Save') {\n if (await newObj.Save()) {\n // all good\n }\n else {\n MJNotificationService.Instance.CreateSimpleNotification('Error saving new ' + this.JoinEntityName + ' record','error', 2500)\n }\n }\n this.PopulateGridData(); // refresh the grid's grid data array that is derived from all of the source data\n }\n\n protected async EditingComplete() {\n // we've been told that editing is done. If we are in queue mode for editing, we do nothing because we've\n // already submitted our pending changes via events (below) but if we're in save mode we save stuff now\n if (this.EditMode === 'Save') {\n await this.Save();\n }\n }\n\n protected async RevertPendingChanges() {\n // this method means we should revert back to the last saved state\n // so just call Refresh\n await this.Refresh();\n }\n \n ngAfterViewInit(): void {\n this.Refresh();\n\n // setup event listener for MJGlobal because we might have a parent component that sends us messages\n MJGlobal.Instance.GetEventListener(false).subscribe((e: MJEvent) => {\n switch (e.event) {\n case MJEventType.ComponentEvent:\n const b = BaseFormComponentEventCodes; // having issues using the const vs the type if we refer to it below directly for comparison so assign the const to a local variable first\n if (e.eventCode === b.BASE_CODE) {\n // we have an event from a BaseFormComponent, now we need to determine if WE are a descendant of that component\n const event: BaseFormComponentEvent = e.args as BaseFormComponentEvent;\n if (IsDescendantElement(event.elementRef, this.elementRef)) {\n // we are a descendant of the component that sent the event, so we need to handle it\n switch (event.subEventCode) {\n case b.EDITING_COMPLETE:\n this.EditingComplete();\n break;\n case b.REVERT_PENDING_CHANGES:\n this.RevertPendingChanges();\n break;\n case b.POPULATE_PENDING_RECORDS:\n // provide all of our pending records back to the caller\n this._joinEntityData?.forEach((r: BaseEntity) => {\n // for anything that's changed, we need to add it to the pending records\n const editingEvent: FormEditingCompleteEvent = event as FormEditingCompleteEvent;\n if (r.Dirty) {\n editingEvent.pendingChanges.push({entityObject: r, action: 'save'});\n }\n });\n\n this._pendingDeletes.forEach((r: BaseEntity) => {\n const editingEvent: FormEditingCompleteEvent = event as FormEditingCompleteEvent;\n editingEvent.pendingChanges.push({entityObject: r, action: 'delete'});\n });\n break;\n }\n }\n }\n break;\n }\n });\n }\n\n /**\n * Returns the EntityFieldInfo that matches the specific column name within the JoinEntity\n * @param colName \n */\n public GetJoinEntityField(colName: string): EntityFieldInfo {\n const md = this.ProviderToUse;\n const entity = md.EntityByName(this.JoinEntityName);\n if (!entity)\n throw new Error('Invalid entity name provided for JoinEntity');\n const field = entity.Fields.find(f => f.Name === colName);\n if (!field)\n throw new Error('Invalid field name provided for JoinEntity');\n return field;\n }\n \n public GetJoinEntityFieldValues(colName: string): string[] {\n return this.GetJoinEntityField(colName).EntityFieldValues.map(efv => efv.Value)\n }\n\n public get EntityFieldTSType() {\n return EntityFieldTSType;\n }\n}\n ","<div class=\"wrapper\">\n @if (_IsLoading) {\n <div><mj-loading [showText]=\"false\" size=\"medium\"></mj-loading></div>\n }\n @if (ShowSaveButton) {\n <button [disabled]=\"NumDirtyRecords === 0\" mjButton (click)=\"Save()\">Save</button>\n }\n @if (ShowCancelButton) {\n <button [disabled]=\"NumDirtyRecords === 0\" mjButton (click)=\"CancelEdit()\">Cancel</button>\n }\n @if (!_IsLoading) {\n <table class=\"grid\">\n <thead>\n <tr>\n <!-- First column is the name of the Rows Entity -->\n <th>{{RowsEntityDisplayNameOrName}}</th>\n @if (ColumnsMode === 'Entity') {\n @for (colRecord of this._columnsEntityData; track colRecord) {\n <th class=\"checkbox-column\">{{colRecord.Get(this.ColumnsEntityDisplayField)}}</th>\n }\n }\n @else {\n <!-- we need one column for each of the fields in the JoinEntityDisplayColumns array -->\n @for (colName of JoinEntityDisplayColumns; track colName) {\n <th>{{colName}}</th>\n }\n }\n </tr>\n </thead>\n <tbody>\n @for (row of _GridData; track row) {\n <tr [ngClass]=\"IsRecordReallyDirty(row) ? 'dirty-row' : ''\">\n <td class=\"first-column\">\n <span>{{row.FirstColValue}}</span>\n @if (EditMode !== 'None'){\n @if (!row.JoinExists) {\n <button mjButton class=\"cellButton\" aria-label=\"Add join record\" title=\"Add join record\" (click)=\"AddJoinEntityRecord(row)\"><span class=\"fa-solid fa-plus\"></span></button>\n }\n @else {\n <button mjButton class=\"cellButton\" aria-label=\"Remove join record\" title=\"Remove join record\" (click)=\"RemoveJoinEntityRecord(row)\"><span class=\"fa-solid fa-minus\"></span></button>\n }\n }\n </td>\n @if (ColumnsMode === 'Fields') {\n @for (colName of JoinEntityDisplayColumns; track colName; let i = $index) {\n <td class=\"column-cell\">\n @if (EditMode !== 'None') {\n @if (row.JoinExists) {\n @if (GetJoinEntityField(colName).ValueListType === \"None\") {\n @if (GetJoinEntityField(colName).TSType === EntityFieldTSType.Boolean) {\n <input type=\"checkbox\" [checked]=\"row.GetColumnValue(i)\" (change)=\"UpdateCellValue(row, i, $event)\" />\n }\n @else {\n <input class=\"mj-input\" [value]=\"row.GetColumnValue(i)\" (change)=\"UpdateCellValue(row, i, $event)\" />\n }\n }\n @else {\n <mj-dropdown\n [Data]=\"GetJoinEntityFieldValues(colName)\"\n [ngModel]=\"row.GetColumnValue(i)\"\n (ValueChange)=\"OnDropdownValueChange(row, i, $event)\">\n </mj-dropdown>\n }\n }\n }\n @else {\n {{row.GetColumnValue(i)}}\n }\n </td>\n }\n }\n @else {\n @for (cell of row.ColumnData; track cell) {\n <!-- loop through all the columns and display a checkbox and check it if we have a match in the current row -->\n <td class=\"checkbox-column\" (click)=\"_FlipRecord($event, row, cell)\"\n [ngClass]=\"IsCellReallyDirty(cell) ? 'dirty-cell' : ''\">\n @if (EditMode !== 'None') {\n <input type=\"checkbox\"\n class=\"mj-checkbox\"\n [checked]=\"_IsColumnChecked(cell)\"\n (click)=\"_FlipRecord($event, row, cell, true)\">\n }\n @else {\n {{cell.value ? '✓' : ''}}\n }\n </td>\n}\n}\n</tr>\n}\n</tbody>\n</table>\n}\n</div>\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-join-grid",
3
- "version": "6.2.0-edge.0",
3
+ "version": "6.2.0-edge.2",
4
4
  "description": "MemberJunction: Grid component that is able to display/edit the relationship between two entities. For example being able to edit Users + Roles in a single grid.",
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.2.0-edge.0",
16
+ "@memberjunction/ng-test-utils": "6.2.0-edge.2",
17
17
  "vitest": "^4.0.18"
18
18
  },
19
19
  "peerDependencies": {
@@ -22,14 +22,14 @@
22
22
  "@angular/forms": "^21.2.22"
23
23
  },
24
24
  "dependencies": {
25
- "@memberjunction/core": "6.2.0-edge.0",
26
- "@memberjunction/core-entities": "6.2.0-edge.0",
27
- "@memberjunction/global": "6.2.0-edge.0",
28
- "@memberjunction/ng-base-types": "6.2.0-edge.0",
29
- "@memberjunction/ng-container-directives": "6.2.0-edge.0",
30
- "@memberjunction/ng-notifications": "6.2.0-edge.0",
31
- "@memberjunction/ng-shared-generic": "6.2.0-edge.0",
32
- "@memberjunction/ng-ui-components": "6.2.0-edge.0",
25
+ "@memberjunction/core": "6.2.0-edge.2",
26
+ "@memberjunction/core-entities": "6.2.0-edge.2",
27
+ "@memberjunction/global": "6.2.0-edge.2",
28
+ "@memberjunction/ng-base-types": "6.2.0-edge.2",
29
+ "@memberjunction/ng-container-directives": "6.2.0-edge.2",
30
+ "@memberjunction/ng-notifications": "6.2.0-edge.2",
31
+ "@memberjunction/ng-shared-generic": "6.2.0-edge.2",
32
+ "@memberjunction/ng-ui-components": "6.2.0-edge.2",
33
33
  "tslib": "^2.8.1"
34
34
  },
35
35
  "sideEffects": false,