@memberjunction/ng-simple-record-list 6.1.4 → 6.2.0-edge.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -77,29 +77,79 @@ export declare class SimpleRecordListComponent extends BaseAngularComponent impl
77
77
  constructor();
78
78
  ngOnInit(): void;
79
79
  Refresh(): Promise<void>;
80
+ SelectRecord(event: MouseEvent | undefined, r: BaseEntity): void;
81
+ /** @deprecated Use {@link SelectRecord}. */
80
82
  selectRecord(event: MouseEvent | undefined, r: BaseEntity): void;
81
- deleteRecordDialogVisible: boolean;
82
- customActionDialogVisible: boolean;
83
- deleteRecordItem: BaseEntity | null;
84
- customActionItem: BaseEntity | undefined;
83
+ DeleteRecordDialogVisible: boolean;
84
+ /** @deprecated Use {@link DeleteRecordDialogVisible}. */
85
+ get deleteRecordDialogVisible(): boolean;
86
+ /** @deprecated Use {@link DeleteRecordDialogVisible}. */
87
+ set deleteRecordDialogVisible(value: boolean);
88
+ CustomActionDialogVisible: boolean;
89
+ /** @deprecated Use {@link CustomActionDialogVisible}. */
90
+ get customActionDialogVisible(): boolean;
91
+ /** @deprecated Use {@link CustomActionDialogVisible}. */
92
+ set customActionDialogVisible(value: boolean);
93
+ DeleteRecordItem: BaseEntity | null;
94
+ /** @deprecated Use {@link DeleteRecordItem}. */
95
+ get deleteRecordItem(): BaseEntity | null;
96
+ /** @deprecated Use {@link DeleteRecordItem}. */
97
+ set deleteRecordItem(value: BaseEntity | null);
98
+ CustomActionItem: BaseEntity | undefined;
99
+ /** @deprecated Use {@link CustomActionItem}. */
100
+ get customActionItem(): BaseEntity | undefined;
101
+ /** @deprecated Use {@link CustomActionItem}. */
102
+ set customActionItem(value: BaseEntity | undefined);
103
+ DeleteRecord(event: MouseEvent, r: BaseEntity): Promise<void>;
104
+ /** @deprecated Use {@link DeleteRecord}. */
85
105
  deleteRecord(event: MouseEvent, r: BaseEntity): Promise<void>;
106
+ PerformCustomAction(event: MouseEvent, r: BaseEntity): Promise<void>;
107
+ /** @deprecated Use {@link PerformCustomAction}. */
86
108
  performCustomAction(event: MouseEvent, r: BaseEntity): Promise<void>;
87
109
  /**
88
110
  * Gets the custom action icon for a record, using the function if provided, otherwise the static icon
89
111
  */
112
+ GetCustomActionIcon(record: BaseEntity): string;
113
+ /** @deprecated Use {@link GetCustomActionIcon}. */
90
114
  getCustomActionIcon(record: BaseEntity): string;
91
115
  /**
92
116
  * Gets the custom action tooltip for a record, using the function if provided, otherwise the static tooltip
93
117
  */
118
+ GetCustomActionTooltip(record: BaseEntity): string;
119
+ /** @deprecated Use {@link GetCustomActionTooltip}. */
94
120
  getCustomActionTooltip(record: BaseEntity): string;
121
+ CloseCustomActionDialog(result: 'Yes' | 'No'): Promise<void>;
122
+ /** @deprecated Use {@link CloseCustomActionDialog}. */
95
123
  closeCustomActionDialog(result: 'Yes' | 'No'): Promise<void>;
124
+ CloseDeleteDialog(result: 'Yes' | 'No'): Promise<void>;
125
+ /** @deprecated Use {@link CloseDeleteDialog}. */
96
126
  closeDeleteDialog(result: 'Yes' | 'No'): Promise<void>;
97
- editOrNewRecord: BaseEntity;
98
- showEditOrNewRecordForm: boolean;
99
- recordMode: 'new' | 'edit';
127
+ EditOrNewRecord: BaseEntity;
128
+ /** @deprecated Use {@link EditOrNewRecord}. */
129
+ get editOrNewRecord(): BaseEntity;
130
+ /** @deprecated Use {@link EditOrNewRecord}. */
131
+ set editOrNewRecord(value: BaseEntity);
132
+ ShowEditOrNewRecordForm: boolean;
133
+ /** @deprecated Use {@link ShowEditOrNewRecordForm}. */
134
+ get showEditOrNewRecordForm(): boolean;
135
+ /** @deprecated Use {@link ShowEditOrNewRecordForm}. */
136
+ set showEditOrNewRecordForm(value: boolean);
137
+ RecordMode: 'new' | 'edit';
138
+ /** @deprecated Use {@link RecordMode}. */
139
+ get recordMode(): 'new' | 'edit';
140
+ /** @deprecated Use {@link RecordMode}. */
141
+ set recordMode(value: 'new' | 'edit');
142
+ CreateNewRecord(): Promise<void>;
143
+ /** @deprecated Use {@link CreateNewRecord}. */
100
144
  createNewRecord(): Promise<void>;
145
+ EditRecord(event: MouseEvent, r: BaseEntity): Promise<void>;
146
+ /** @deprecated Use {@link EditRecord}. */
101
147
  editRecord(event: MouseEvent, r: BaseEntity): Promise<void>;
148
+ OnEditOrNewRecordFormClosed(result: 'Save' | 'Cancel'): Promise<void>;
149
+ /** @deprecated Use {@link OnEditOrNewRecordFormClosed}. */
102
150
  onEditOrNewRecordFormClosed(result: 'Save' | 'Cancel'): Promise<void>;
151
+ GetRecordName(r: BaseEntity): string;
152
+ /** @deprecated Use {@link GetRecordName}. */
103
153
  getRecordName(r: BaseEntity): string;
104
154
  static ɵfac: i0.ɵɵFactoryDeclaration<SimpleRecordListComponent, never>;
105
155
  static ɵcmp: i0.ɵɵComponentDeclaration<SimpleRecordListComponent, "mj-simple-record-list", never, { "EntityName": { "alias": "EntityName"; "required": false; }; "Columns": { "alias": "Columns"; "required": false; }; "SortBy": { "alias": "SortBy"; "required": false; }; "AllowDelete": { "alias": "AllowDelete"; "required": false; }; "AllowNew": { "alias": "AllowNew"; "required": false; }; "AllowEdit": { "alias": "AllowEdit"; "required": false; }; "AllowCustomAction": { "alias": "AllowCustomAction"; "required": false; }; "CustomActionIcon": { "alias": "CustomActionIcon"; "required": false; }; "CustomActionIconFunction": { "alias": "CustomActionIconFunction"; "required": false; }; "CustomActionTooltip": { "alias": "CustomActionTooltip"; "required": false; }; "CustomActionTooltipFunction": { "alias": "CustomActionTooltipFunction"; "required": false; }; "CustomActionDialogTitle": { "alias": "CustomActionDialogTitle"; "required": false; }; "CustomActionDialogMessage": { "alias": "CustomActionDialogMessage"; "required": false; }; "CustomActionDialogInfo": { "alias": "CustomActionDialogInfo"; "required": false; }; "EditSectionName": { "alias": "EditSectionName"; "required": false; }; }, { "RecordSelected": "RecordSelected"; "RecordEdited": "RecordEdited"; "RecordCreated": "RecordCreated"; "CustomActionClicked": "CustomActionClicked"; "CustomActionConfirmed": "CustomActionConfirmed"; }, never, never, false, never>;
@@ -1 +1 @@
1
- {"version":3,"file":"simple-record-list.component.d.ts","sourceRoot":"","sources":["../../../src/lib/simple-record-list/simple-record-list.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAS,YAAY,EAAU,MAAM,eAAe,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAqB,MAAM,sBAAsB,CAAC;AAIrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;AACrE,qBAMa,yBAA0B,SAAQ,oBAAqB,YAAW,MAAM;IACnF;;OAEG;IACM,UAAU,EAAE,MAAM,CAAM;IACjC;;OAEG;IACM,OAAO,EAAE,MAAM,EAAE,CAAM;IAChC;;OAEG;IACM,MAAM,EAAE,MAAM,CAAM;IAC7B;;OAEG;IACM,WAAW,EAAE,OAAO,CAAQ;IACrC;;OAEG;IACM,QAAQ,EAAE,OAAO,CAAQ;IAClC;;OAEG;IACM,SAAS,EAAE,OAAO,CAAQ;IACnC;;OAEG;IACM,iBAAiB,EAAE,OAAO,CAAS;IAC5C;;OAEG;IACM,gBAAgB,EAAE,MAAM,CAAM;IACvC;;;;OAIG;IACM,wBAAwB,EAAE,CAAC,CAAC,MAAM,EAAE,UAAU,KAAK,MAAM,CAAC,GAAG,IAAI,CAAQ;IAClF;;OAEG;IACM,mBAAmB,EAAE,MAAM,CAAM;IAC1C;;;;OAIG;IACM,2BAA2B,EAAE,CAAC,CAAC,MAAM,EAAE,UAAU,KAAK,MAAM,CAAC,GAAG,IAAI,CAAQ;IACrF;;OAEG;IACM,uBAAuB,EAAE,MAAM,CAAoB;IAC5D;;OAEG;IACM,yBAAyB,EAAE,MAAM,CAAmD;IAC7F;;OAEG;IACM,sBAAsB,EAAE,MAAM,CAAM;IAC7C;;OAEG;IACM,eAAe,EAAE,MAAM,CAAa;IAEnC,cAAc,oCAAkC;IAChD,YAAY,oCAAkC;IAC9C,aAAa,oCAAkC;IAC/C,mBAAmB,oCAA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@@ -289,102 +289,194 @@ export class SimpleRecordListComponent extends BaseAngularComponent {
289
289
  }
290
290
  this.isLoading = false;
291
291
  }
292
- selectRecord(event, r) {
292
+ SelectRecord(event, r) {
293
293
  if (event)
294
294
  event.stopPropagation(); // prevent row from getting click
295
295
  this.RecordSelected.emit(r);
296
296
  }
297
- deleteRecordDialogVisible = false;
298
- customActionDialogVisible = false;
299
- deleteRecordItem;
300
- customActionItem;
301
- async deleteRecord(event, r) {
297
+ /** @deprecated Use {@link SelectRecord}. */
298
+ selectRecord(event, r) {
299
+ return this.SelectRecord(event, r);
300
+ }
301
+ DeleteRecordDialogVisible = false;
302
+ /** @deprecated Use {@link DeleteRecordDialogVisible}. */
303
+ get deleteRecordDialogVisible() {
304
+ return this.DeleteRecordDialogVisible;
305
+ }
306
+ /** @deprecated Use {@link DeleteRecordDialogVisible}. */
307
+ set deleteRecordDialogVisible(value) {
308
+ this.DeleteRecordDialogVisible = value;
309
+ }
310
+ CustomActionDialogVisible = false;
311
+ /** @deprecated Use {@link CustomActionDialogVisible}. */
312
+ get customActionDialogVisible() {
313
+ return this.CustomActionDialogVisible;
314
+ }
315
+ /** @deprecated Use {@link CustomActionDialogVisible}. */
316
+ set customActionDialogVisible(value) {
317
+ this.CustomActionDialogVisible = value;
318
+ }
319
+ DeleteRecordItem;
320
+ /** @deprecated Use {@link DeleteRecordItem}. */
321
+ get deleteRecordItem() {
322
+ return this.DeleteRecordItem;
323
+ }
324
+ /** @deprecated Use {@link DeleteRecordItem}. */
325
+ set deleteRecordItem(value) {
326
+ this.DeleteRecordItem = value;
327
+ }
328
+ CustomActionItem;
329
+ /** @deprecated Use {@link CustomActionItem}. */
330
+ get customActionItem() {
331
+ return this.CustomActionItem;
332
+ }
333
+ /** @deprecated Use {@link CustomActionItem}. */
334
+ set customActionItem(value) {
335
+ this.CustomActionItem = value;
336
+ }
337
+ async DeleteRecord(event, r) {
302
338
  // confirm with the user first
303
- this.deleteRecordItem = r;
304
- this.deleteRecordDialogVisible = true;
339
+ this.DeleteRecordItem = r;
340
+ this.DeleteRecordDialogVisible = true;
305
341
  if (event)
306
342
  event.stopPropagation(); // prevent row from getting click
307
343
  }
308
- async performCustomAction(event, r) {
344
+ /** @deprecated Use {@link DeleteRecord}. */
345
+ async deleteRecord(event, r) {
346
+ return this.DeleteRecord(event, r);
347
+ }
348
+ async PerformCustomAction(event, r) {
309
349
  // first emit the clicked event to allow the parent to react
310
350
  this.CustomActionClicked.emit(r);
311
351
  // confirm with the user
312
- this.customActionItem = r;
313
- this.customActionDialogVisible = true;
352
+ this.CustomActionItem = r;
353
+ this.CustomActionDialogVisible = true;
314
354
  if (event)
315
355
  event.stopPropagation(); // prevent row from getting click
316
356
  }
357
+ /** @deprecated Use {@link PerformCustomAction}. */
358
+ async performCustomAction(event, r) {
359
+ return this.PerformCustomAction(event, r);
360
+ }
317
361
  /**
318
362
  * Gets the custom action icon for a record, using the function if provided, otherwise the static icon
319
363
  */
320
- getCustomActionIcon(record) {
364
+ GetCustomActionIcon(record) {
321
365
  if (this.CustomActionIconFunction) {
322
366
  return this.CustomActionIconFunction(record);
323
367
  }
324
368
  return this.CustomActionIcon;
325
369
  }
370
+ /** @deprecated Use {@link GetCustomActionIcon}. */
371
+ getCustomActionIcon(record) {
372
+ return this.GetCustomActionIcon(record);
373
+ }
326
374
  /**
327
375
  * Gets the custom action tooltip for a record, using the function if provided, otherwise the static tooltip
328
376
  */
329
- getCustomActionTooltip(record) {
377
+ GetCustomActionTooltip(record) {
330
378
  if (this.CustomActionTooltipFunction) {
331
379
  return this.CustomActionTooltipFunction(record);
332
380
  }
333
381
  return this.CustomActionTooltip;
334
382
  }
335
- async closeCustomActionDialog(result) {
336
- this.customActionDialogVisible = false;
383
+ /** @deprecated Use {@link GetCustomActionTooltip}. */
384
+ getCustomActionTooltip(record) {
385
+ return this.GetCustomActionTooltip(record);
386
+ }
387
+ async CloseCustomActionDialog(result) {
388
+ this.CustomActionDialogVisible = false;
337
389
  if (result === 'Yes') {
338
390
  // emit the event so the parent can handle the action
339
- this.CustomActionConfirmed.emit(this.customActionItem);
391
+ this.CustomActionConfirmed.emit(this.CustomActionItem);
340
392
  }
341
- this.customActionItem = undefined;
393
+ this.CustomActionItem = undefined;
342
394
  }
343
- async closeDeleteDialog(result) {
395
+ /** @deprecated Use {@link CloseCustomActionDialog}. */
396
+ async closeCustomActionDialog(result) {
397
+ return this.CloseCustomActionDialog(result);
398
+ }
399
+ async CloseDeleteDialog(result) {
344
400
  // if the user confirms, delete the record
345
- this.deleteRecordDialogVisible = false;
401
+ this.DeleteRecordDialogVisible = false;
346
402
  if (result === 'Yes') {
347
- if (!await this.deleteRecordItem.Delete()) {
403
+ if (!await this.DeleteRecordItem.Delete()) {
348
404
  // show an error message
349
- const errorMessage = this.deleteRecordItem.LatestResult.CompleteMessage;
405
+ const errorMessage = this.DeleteRecordItem.LatestResult.CompleteMessage;
350
406
  MJNotificationService.Instance.CreateSimpleNotification('Error deleting record: ' + errorMessage, 'error', 3000);
351
407
  }
352
408
  else
353
409
  this.Refresh(); // refresh the list
354
410
  }
355
- this.deleteRecordItem = null;
411
+ this.DeleteRecordItem = null;
356
412
  }
357
- editOrNewRecord;
358
- showEditOrNewRecordForm = false;
359
- recordMode = 'new';
360
- async createNewRecord() {
413
+ /** @deprecated Use {@link CloseDeleteDialog}. */
414
+ async closeDeleteDialog(result) {
415
+ return this.CloseDeleteDialog(result);
416
+ }
417
+ EditOrNewRecord;
418
+ /** @deprecated Use {@link EditOrNewRecord}. */
419
+ get editOrNewRecord() {
420
+ return this.EditOrNewRecord;
421
+ }
422
+ /** @deprecated Use {@link EditOrNewRecord}. */
423
+ set editOrNewRecord(value) {
424
+ this.EditOrNewRecord = value;
425
+ }
426
+ ShowEditOrNewRecordForm = false;
427
+ /** @deprecated Use {@link ShowEditOrNewRecordForm}. */
428
+ get showEditOrNewRecordForm() {
429
+ return this.ShowEditOrNewRecordForm;
430
+ }
431
+ /** @deprecated Use {@link ShowEditOrNewRecordForm}. */
432
+ set showEditOrNewRecordForm(value) {
433
+ this.ShowEditOrNewRecordForm = value;
434
+ }
435
+ RecordMode = 'new';
436
+ /** @deprecated Use {@link RecordMode}. */
437
+ get recordMode() {
438
+ return this.RecordMode;
439
+ }
440
+ /** @deprecated Use {@link RecordMode}. */
441
+ set recordMode(value) {
442
+ this.RecordMode = value;
443
+ }
444
+ async CreateNewRecord() {
361
445
  // attempt to create a new record and if success, navigate to the new record
362
446
  const md = this.ProviderToUse;
363
- this.editOrNewRecord = await md.GetEntityObject(this.EntityName);
364
- if (this.editOrNewRecord) {
365
- this.editOrNewRecord.NewRecord();
366
- this.recordMode = 'new';
367
- this.showEditOrNewRecordForm = true;
447
+ this.EditOrNewRecord = await md.GetEntityObject(this.EntityName);
448
+ if (this.EditOrNewRecord) {
449
+ this.EditOrNewRecord.NewRecord();
450
+ this.RecordMode = 'new';
451
+ this.ShowEditOrNewRecordForm = true;
368
452
  }
369
453
  }
370
- async editRecord(event, r) {
371
- this.editOrNewRecord = r;
372
- this.recordMode = 'edit';
373
- this.showEditOrNewRecordForm = true;
454
+ /** @deprecated Use {@link CreateNewRecord}. */
455
+ async createNewRecord() {
456
+ return this.CreateNewRecord();
457
+ }
458
+ async EditRecord(event, r) {
459
+ this.EditOrNewRecord = r;
460
+ this.RecordMode = 'edit';
461
+ this.ShowEditOrNewRecordForm = true;
374
462
  if (event)
375
463
  event.stopPropagation(); // prevent row from getting click
376
464
  }
377
- async onEditOrNewRecordFormClosed(result) {
378
- if (!this.editOrNewRecord)
465
+ /** @deprecated Use {@link EditRecord}. */
466
+ async editRecord(event, r) {
467
+ return this.EditRecord(event, r);
468
+ }
469
+ async OnEditOrNewRecordFormClosed(result) {
470
+ if (!this.EditOrNewRecord)
379
471
  return; // this can happen if the user closes the form before the record is loaded
380
- this.showEditOrNewRecordForm = false;
472
+ this.ShowEditOrNewRecordForm = false;
381
473
  if (result === 'Save') {
382
474
  // the dialog already saved the record, just check to make sure it was saved and if so, navigate
383
- if (this.editOrNewRecord.IsSaved) {
384
- if (this.recordMode === 'edit')
385
- this.RecordEdited.emit(this.editOrNewRecord);
475
+ if (this.EditOrNewRecord.IsSaved) {
476
+ if (this.RecordMode === 'edit')
477
+ this.RecordEdited.emit(this.EditOrNewRecord);
386
478
  else
387
- this.RecordCreated.emit(this.editOrNewRecord);
479
+ this.RecordCreated.emit(this.EditOrNewRecord);
388
480
  // refresh our grid now
389
481
  await this.Refresh();
390
482
  }
@@ -392,7 +484,11 @@ export class SimpleRecordListComponent extends BaseAngularComponent {
392
484
  throw new Error('Record was not saved');
393
485
  }
394
486
  }
395
- getRecordName(r) {
487
+ /** @deprecated Use {@link OnEditOrNewRecordFormClosed}. */
488
+ async onEditOrNewRecordFormClosed(result) {
489
+ return this.OnEditOrNewRecordFormClosed(result);
490
+ }
491
+ GetRecordName(r) {
396
492
  // check to see if we have any columns in the entity that have IsNameField = 1, the fall back from there is to look for a column named "Name", and if that doesn't work we return the primary key(s)
397
493
  const md = this.ProviderToUse;
398
494
  const e = md.Entities.find(e => e.Name === this.EntityName);
@@ -412,6 +508,10 @@ export class SimpleRecordListComponent extends BaseAngularComponent {
412
508
  }
413
509
  }
414
510
  }
511
+ /** @deprecated Use {@link GetRecordName}. */
512
+ getRecordName(r) {
513
+ return this.GetRecordName(r);
514
+ }
415
515
  static ɵfac = function SimpleRecordListComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SimpleRecordListComponent)(); };
416
516
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SimpleRecordListComponent, selectors: [["mj-simple-record-list"]], inputs: { EntityName: "EntityName", Columns: "Columns", SortBy: "SortBy", AllowDelete: "AllowDelete", AllowNew: "AllowNew", AllowEdit: "AllowEdit", AllowCustomAction: "AllowCustomAction", CustomActionIcon: "CustomActionIcon", CustomActionIconFunction: "CustomActionIconFunction", CustomActionTooltip: "CustomActionTooltip", CustomActionTooltipFunction: "CustomActionTooltipFunction", CustomActionDialogTitle: "CustomActionDialogTitle", CustomActionDialogMessage: "CustomActionDialogMessage", CustomActionDialogInfo: "CustomActionDialogInfo", EditSectionName: "EditSectionName" }, outputs: { RecordSelected: "RecordSelected", RecordEdited: "RecordEdited", RecordCreated: "RecordCreated", CustomActionClicked: "CustomActionClicked", CustomActionConfirmed: "CustomActionConfirmed" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 6, vars: 4, consts: [["entityForm", ""], [1, "wrapper", "scrollable"], [1, "vertical-full-width"], ["Mode", "section", 3, "Record", "SectionName", "Visible", "AutoRevertOnCancel", "HandleSave", "Width", "Height"], [3, "Visible", "Title", "Width", "Height"], ["size", "medium", 3, "showText"], ["mjButton", ""], [1, "grid"], [1, "sticky-header"], ["mjButton", "", 3, "click"], [1, "fa-solid", "fa-plus"], [3, "click"], ["title", "Edit", 1, "fa-solid", "fa-pen-to-square", "icon"], [3, "class", "title"], ["title", "Delete", 1, "fa-solid", "fa-trash-can", "icon"], ["title", "Edit", 1, "fa-solid", "fa-pen-to-square", "icon", 3, "click"], [3, "click", "title"], ["title", "Delete", 1, "fa-solid", "fa-trash-can", "icon", 3, "click"], ["Mode", "section", 3, "DialogClosed", "Record", "SectionName", "Visible", "AutoRevertOnCancel", "HandleSave", "Width", "Height"], [3, "Close", "Visible", "Title", "Width", "Height"], ["mjButton", "", "variant", "primary", 3, "click"]], template: function SimpleRecordListComponent_Template(rf, ctx) { if (rf & 1) {
417
517
  i0.ɵɵelementStart(0, "div", 1);
@@ -1 +1 @@
1
- {"version":3,"file":"simple-record-list.component.js","sourceRoot":"","sources":["../../../src/lib/simple-record-list/simple-record-list.component.ts","../../../src/lib/simple-record-list/simple-record-list.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAU,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE/E,OAAO,EAAwB,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC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BAIL,KAAK;;kBAIL,KAAK;;kBAIL,KAAK;;kBAIL,KAAK;;kBAML,KAAK;;kBAIL,KAAK;;kBAML,KAAK;;kBAIL,KAAK;;kBAIL,KAAK;;kBAIL,KAAK;;kBAIL,KAAK;;kBAEL,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kFAtEI,yBAAyB","sourcesContent":["import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core';\n\nimport { BaseEntity, Metadata, RunView } from '@memberjunction/core';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\n \n \nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\n@Component({\n standalone: false,\n selector: 'mj-simple-record-list',\n templateUrl: './simple-record-list.component.html',\n styleUrls: ['./simple-record-list.component.css']\n})\nexport class SimpleRecordListComponent extends BaseAngularComponent implements OnInit {\n /**\n * Name of the entity to display records for.\n */\n @Input() EntityName: string = '';\n /**\n * List of columns to display in the grid. If empty and the entity has > 10 columns, those columns marked as DefaultInView=1 will be used, otherwise the first 10 columns will be used.\n */\n @Input() Columns: string[] = [];\n /**\n * Name of the column to sort by. If empty, no sorting is done.\n */\n @Input() SortBy: string = '';\n /**\n * If true, the delete button will be shown for each record.\n */\n @Input() AllowDelete: boolean = true;\n /**\n * If true, the new button will be shown.\n */\n @Input() AllowNew: boolean = true;\n /**\n * If true, the edit button will be shown for each record.\n */\n @Input() AllowEdit: boolean = true;\n /**\n * If true, a custom action button will be shown for each record.\n */\n @Input() AllowCustomAction: boolean = false;\n /**\n * The CSS class for the custom action button icon (e.g. 'fa-user-lock')\n */\n @Input() CustomActionIcon: string = '';\n /**\n * A function that returns the appropriate icon based on the record\n * Signature: (record: BaseEntity) => string\n * If provided, overrides CustomActionIcon\n */\n @Input() CustomActionIconFunction: ((record: BaseEntity) => string) | null = null;\n /**\n * Tooltip text for the custom action button\n */\n @Input() CustomActionTooltip: string = '';\n /**\n * A function that returns the appropriate tooltip text based on the record\n * Signature: (record: BaseEntity) => string\n * If provided, overrides CustomActionTooltip\n */\n @Input() CustomActionTooltipFunction: ((record: BaseEntity) => string) | null = null;\n /**\n * Title for the custom action confirmation dialog\n */\n @Input() CustomActionDialogTitle: string = 'Confirm Action';\n /**\n * Message for the custom action confirmation dialog\n */\n @Input() CustomActionDialogMessage: string = 'Are you sure you want to perform this action?';\n /**\n * Optional additional information for the custom action confirmation dialog\n */\n @Input() CustomActionDialogInfo: string = '';\n /**\n * If AllowEdit or AllowNew is true, this is the section name to display for editing a new or existing record.\n */\n @Input() EditSectionName: string = 'details';\n\n @Output() RecordSelected = new EventEmitter<BaseEntity>();\n @Output() RecordEdited = new EventEmitter<BaseEntity>();\n @Output() RecordCreated = new EventEmitter<BaseEntity>();\n @Output() CustomActionClicked = new EventEmitter<BaseEntity>();\n @Output() CustomActionConfirmed = new EventEmitter<BaseEntity>();\n\n public isLoading: boolean = false;\n public records: BaseEntity[] = [];\n\n constructor() {\n super();\n }\n \n ngOnInit(): void {\n this.Refresh()\n }\n\n async Refresh() { \n this.isLoading = true\n\n const md = this.ProviderToUse;\n if (this.Columns.length === 0) {\n // populate this by default by taking all columns if entity has < 10 columns, otherwise include columns that have DefaultInView=1, and if we have no columns with DefaultInView=1, then include the first 10 columns\n const e = md.EntityByName(this.EntityName);\n if (e) {\n if (e.Fields.length < 10)\n this.Columns = e.Fields.map(f => f.Name);\n else {\n const defaultInViewColumns = e.Fields.filter(c => c.DefaultInView);\n if (defaultInViewColumns.length > 0)\n this.Columns = defaultInViewColumns.map(f => f.Name);\n else\n this.Columns = e.Fields.slice(0, 10).map(f => f.Name);\n }\n }\n }\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView({\n EntityName: this.EntityName,\n ResultType: 'entity_object'\n })\n if (result.Success) {\n this.records = result.Results;\n if (this.SortBy && this.SortBy.trim().length > 0) {\n this.records.sort((a, b) => a.Get(this.SortBy).localeCompare(b.Get(this.SortBy)));\n }\n }\n else {\n throw new Error(\"Error loading records: \" + result.ErrorMessage)\n }\n this.isLoading = false\n }\n\n public selectRecord(event: MouseEvent | undefined, r: BaseEntity) {\n if (event)\n event.stopPropagation(); // prevent row from getting click\n\n this.RecordSelected.emit(r);\n }\n\n public deleteRecordDialogVisible: boolean = false;\n public customActionDialogVisible: boolean = false;\n public deleteRecordItem!: BaseEntity | null;\n public customActionItem!: BaseEntity | undefined;\n \n public async deleteRecord(event: MouseEvent, r: BaseEntity) {\n // confirm with the user first\n this.deleteRecordItem = r;\n this.deleteRecordDialogVisible = true;\n if (event)\n event.stopPropagation(); // prevent row from getting click\n }\n\n public async performCustomAction(event: MouseEvent, r: BaseEntity) {\n // first emit the clicked event to allow the parent to react\n this.CustomActionClicked.emit(r);\n \n // confirm with the user\n this.customActionItem = r;\n this.customActionDialogVisible = true;\n if (event)\n event.stopPropagation(); // prevent row from getting click\n }\n \n /**\n * Gets the custom action icon for a record, using the function if provided, otherwise the static icon\n */\n public getCustomActionIcon(record: BaseEntity): string {\n if (this.CustomActionIconFunction) {\n return this.CustomActionIconFunction(record);\n }\n return this.CustomActionIcon;\n }\n \n /**\n * Gets the custom action tooltip for a record, using the function if provided, otherwise the static tooltip\n */\n public getCustomActionTooltip(record: BaseEntity): string {\n if (this.CustomActionTooltipFunction) {\n return this.CustomActionTooltipFunction(record);\n }\n return this.CustomActionTooltip;\n }\n\n public async closeCustomActionDialog(result: 'Yes' | 'No') {\n this.customActionDialogVisible = false;\n if (result === 'Yes') {\n // emit the event so the parent can handle the action\n this.CustomActionConfirmed.emit(this.customActionItem);\n }\n this.customActionItem = undefined;\n }\n\n public async closeDeleteDialog(result: 'Yes' | 'No') {\n // if the user confirms, delete the record\n this.deleteRecordDialogVisible = false;\n if (result === 'Yes') {\n if (!await this.deleteRecordItem!.Delete()) {\n // show an error message\n const errorMessage = this.deleteRecordItem!.LatestResult.CompleteMessage;\n MJNotificationService.Instance.CreateSimpleNotification('Error deleting record: ' + errorMessage, 'error', 3000);\n }\n else \n this.Refresh(); // refresh the list\n }\n this.deleteRecordItem = null;\n }\n\n public editOrNewRecord!: BaseEntity;\n public showEditOrNewRecordForm: boolean = false;\n public recordMode: 'new' | 'edit' = 'new';\n public async createNewRecord() {\n // attempt to create a new record and if success, navigate to the new record\n const md = this.ProviderToUse;\n this.editOrNewRecord = await md.GetEntityObject(this.EntityName);\n if (this.editOrNewRecord) {\n this.editOrNewRecord.NewRecord();\n this.recordMode = 'new';\n this.showEditOrNewRecordForm = true;\n }\n }\n\n public async editRecord(event: MouseEvent, r: BaseEntity) {\n this.editOrNewRecord = r;\n this.recordMode = 'edit';\n this.showEditOrNewRecordForm = true;\n if (event)\n event.stopPropagation(); // prevent row from getting click\n }\n\n public async onEditOrNewRecordFormClosed(result: 'Save' | 'Cancel') {\n if (!this.editOrNewRecord)\n return; // this can happen if the user closes the form before the record is loaded\n\n this.showEditOrNewRecordForm = false;\n \n if (result === 'Save') {\n // the dialog already saved the record, just check to make sure it was saved and if so, navigate\n if (this.editOrNewRecord.IsSaved) {\n if (this.recordMode === 'edit')\n this.RecordEdited.emit(this.editOrNewRecord);\n else\n this.RecordCreated.emit(this.editOrNewRecord);\n\n // refresh our grid now\n await this.Refresh();\n }\n else\n throw new Error('Record was not saved');\n }\n }\n\n public getRecordName(r: BaseEntity): string {\n // check to see if we have any columns in the entity that have IsNameField = 1, the fall back from there is to look for a column named \"Name\", and if that doesn't work we return the primary key(s)\n const md = this.ProviderToUse;\n const e = md.Entities.find(e => e.Name === this.EntityName);\n if (!e)\n throw new Error('Entity not found: ' + this.EntityName);\n\n const nameField = e.Fields.find(c => c.IsNameField);\n if (nameField)\n return r.Get(nameField.Name);\n else {\n const nameField = e.Fields.find(c => c.Name === 'Name');\n if (nameField)\n return r.Get(\"Name\");\n else {\n // iterate through all primary keys and form a comma separated list\n const pkString = r.PrimaryKeys.map(pk => r.Get(pk.Name)).join(', ');\n return \"Record: \" + pkString;\n }\n }\n }\n}\n","<div class=\"wrapper scrollable\">\n @if(isLoading) {\n <div>\n <mj-loading [showText]=\"false\" size=\"medium\"></mj-loading>\n </div>\n }\n @else {\n <div class=\"vertical-full-width\">\n @if(AllowNew) {\n <button mjButton (click)=\"createNewRecord()\"><span class=\"fa-solid fa-plus\"></span> New</button>\n }\n <table class=\"grid\">\n <thead class=\"sticky-header\">\n <tr>\n @for (c of Columns; track c) {\n <th>\n {{ c }}\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (r of records; track r) {\n <tr (click)=\"selectRecord(undefined, r)\">\n @for (c of Columns; track c; let i = $index) {\n <td>\n <span>{{ r.Get(c) }}</span>\n @if(i === 0 && (AllowDelete || AllowEdit)) {\n <span>\n @if (AllowEdit) {\n <span class=\"fa-solid fa-pen-to-square icon\" (click)=\"editRecord($event, r)\" title=\"Edit\"></span>\n }\n @if (AllowCustomAction) {\n <span\n class=\"fa-solid {{getCustomActionIcon(r)}} icon\"\n (click)=\"performCustomAction($event, r)\"\n title=\"{{getCustomActionTooltip(r)}}\"\n ></span>\n }\n @if (AllowDelete) {\n <span class=\"fa-solid fa-trash-can icon\" (click)=\"deleteRecord($event, r)\" title=\"Delete\"></span>\n }\n </span>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n}\n</div>\n\n@if(AllowNew || AllowEdit) {\n <mj-entity-form-dialog #entityForm\n [Record]=\"editOrNewRecord\"\n [SectionName]=\"EditSectionName\"\n Mode=\"section\"\n [Visible]=\"showEditOrNewRecordForm\"\n [AutoRevertOnCancel]=\"true\"\n [HandleSave]=\"true\"\n [Width]=\"550\"\n [Height]=\"450\"\n (DialogClosed)=\"onEditOrNewRecordFormClosed($event)\">\n </mj-entity-form-dialog>\n}\n\n@if(deleteRecordDialogVisible && AllowDelete) {\n <mj-dialog\n [Visible]=\"true\"\n [Title]=\"'Delete ' + EntityName + '?'\"\n [Width]=\"450\"\n [Height]=\"200\"\n (Close)=\"closeDeleteDialog('No')\" >\n <div>\n Are you sure you want to delete '{{getRecordName(deleteRecordItem!)}}'?\n </div>\n <mj-dialog-actions>\n <button mjButton variant=\"primary\" (click)=\"closeDeleteDialog('Yes')\">Yes</button>\n <button mjButton (click)=\"closeDeleteDialog('No')\">No</button>\n </mj-dialog-actions>\n </mj-dialog>\n}\n\n@if(customActionDialogVisible && AllowCustomAction) {\n <mj-dialog\n [Visible]=\"true\"\n [Title]=\"CustomActionDialogTitle\"\n [Width]=\"450\"\n [Height]=\"200\"\n (Close)=\"closeCustomActionDialog('No')\" >\n <div>\n {{ CustomActionDialogMessage.replace('{{recordName}}', getRecordName(customActionItem!)) }}\n @if(CustomActionDialogInfo) {\n <p>{{ CustomActionDialogInfo }}</p>\n }\n </div>\n <mj-dialog-actions>\n <button mjButton variant=\"primary\" (click)=\"closeCustomActionDialog('Yes')\">Yes</button>\n <button mjButton (click)=\"closeCustomActionDialog('No')\">No</button>\n </mj-dialog-actions>\n </mj-dialog>\n}\n"]}
1
+ {"version":3,"file":"simple-record-list.component.js","sourceRoot":"","sources":["../../../src/lib/simple-record-list/simple-record-list.component.ts","../../../src/lib/simple-record-list/simple-record-list.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAU,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE/E,OAAO,EAAwB,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAGzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;;;;;ICJjE,2BAAK;IACH,gCAA0D;IAC5D,iBAAM;;IADQ,cAAkB;IAAlB,gCAAkB;;;;IAM9B,iCAA6C;IAA5B,4MAAS,wBAAiB,KAAC;IAAC,2BAAsC;IAAC,oBAAG;IAAA,iBAAS;;;IAM1F,0BAAI;IACF,YACF;IAAA,iBAAK;;;IADH,cACF;IADE,qCACF;;;;IAaU,gCAA0F;IAA7C,sRAAS,+BAAqB,KAAC;IAAc,iBAAO;;;;IAGjG,gCAIC;IAFC,sR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BACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kFAtEI,yBAAyB","sourcesContent":["import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core';\n\nimport { BaseEntity, Metadata, RunView } from '@memberjunction/core';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\n \n \nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\n@Component({\n standalone: false,\n selector: 'mj-simple-record-list',\n templateUrl: './simple-record-list.component.html',\n styleUrls: ['./simple-record-list.component.css']\n})\nexport class SimpleRecordListComponent extends BaseAngularComponent implements OnInit {\n /**\n * Name of the entity to display records for.\n */\n @Input() EntityName: string = '';\n /**\n * List of columns to display in the grid. If empty and the entity has > 10 columns, those columns marked as DefaultInView=1 will be used, otherwise the first 10 columns will be used.\n */\n @Input() Columns: string[] = [];\n /**\n * Name of the column to sort by. If empty, no sorting is done.\n */\n @Input() SortBy: string = '';\n /**\n * If true, the delete button will be shown for each record.\n */\n @Input() AllowDelete: boolean = true;\n /**\n * If true, the new button will be shown.\n */\n @Input() AllowNew: boolean = true;\n /**\n * If true, the edit button will be shown for each record.\n */\n @Input() AllowEdit: boolean = true;\n /**\n * If true, a custom action button will be shown for each record.\n */\n @Input() AllowCustomAction: boolean = false;\n /**\n * The CSS class for the custom action button icon (e.g. 'fa-user-lock')\n */\n @Input() CustomActionIcon: string = '';\n /**\n * A function that returns the appropriate icon based on the record\n * Signature: (record: BaseEntity) => string\n * If provided, overrides CustomActionIcon\n */\n @Input() CustomActionIconFunction: ((record: BaseEntity) => string) | null = null;\n /**\n * Tooltip text for the custom action button\n */\n @Input() CustomActionTooltip: string = '';\n /**\n * A function that returns the appropriate tooltip text based on the record\n * Signature: (record: BaseEntity) => string\n * If provided, overrides CustomActionTooltip\n */\n @Input() CustomActionTooltipFunction: ((record: BaseEntity) => string) | null = null;\n /**\n * Title for the custom action confirmation dialog\n */\n @Input() CustomActionDialogTitle: string = 'Confirm Action';\n /**\n * Message for the custom action confirmation dialog\n */\n @Input() CustomActionDialogMessage: string = 'Are you sure you want to perform this action?';\n /**\n * Optional additional information for the custom action confirmation dialog\n */\n @Input() CustomActionDialogInfo: string = '';\n /**\n * If AllowEdit or AllowNew is true, this is the section name to display for editing a new or existing record.\n */\n @Input() EditSectionName: string = 'details';\n\n @Output() RecordSelected = new EventEmitter<BaseEntity>();\n @Output() RecordEdited = new EventEmitter<BaseEntity>();\n @Output() RecordCreated = new EventEmitter<BaseEntity>();\n @Output() CustomActionClicked = new EventEmitter<BaseEntity>();\n @Output() CustomActionConfirmed = new EventEmitter<BaseEntity>();\n\n public isLoading: boolean = false;\n public records: BaseEntity[] = [];\n\n constructor() {\n super();\n }\n \n ngOnInit(): void {\n this.Refresh()\n }\n\n async Refresh() { \n this.isLoading = true\n\n const md = this.ProviderToUse;\n if (this.Columns.length === 0) {\n // populate this by default by taking all columns if entity has < 10 columns, otherwise include columns that have DefaultInView=1, and if we have no columns with DefaultInView=1, then include the first 10 columns\n const e = md.EntityByName(this.EntityName);\n if (e) {\n if (e.Fields.length < 10)\n this.Columns = e.Fields.map(f => f.Name);\n else {\n const defaultInViewColumns = e.Fields.filter(c => c.DefaultInView);\n if (defaultInViewColumns.length > 0)\n this.Columns = defaultInViewColumns.map(f => f.Name);\n else\n this.Columns = e.Fields.slice(0, 10).map(f => f.Name);\n }\n }\n }\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView({\n EntityName: this.EntityName,\n ResultType: 'entity_object'\n })\n if (result.Success) {\n this.records = result.Results;\n if (this.SortBy && this.SortBy.trim().length > 0) {\n this.records.sort((a, b) => a.Get(this.SortBy).localeCompare(b.Get(this.SortBy)));\n }\n }\n else {\n throw new Error(\"Error loading records: \" + result.ErrorMessage)\n }\n this.isLoading = false\n }\n\n public SelectRecord(event: MouseEvent | undefined, r: BaseEntity) {\n if (event)\n event.stopPropagation(); // prevent row from getting click\n\n this.RecordSelected.emit(r);\n }\n\n /** @deprecated Use {@link SelectRecord}. */\n public selectRecord(event: MouseEvent | undefined, r: BaseEntity) {\n return this.SelectRecord(event, r);\n }\n\n public DeleteRecordDialogVisible: boolean = false;\n\n /** @deprecated Use {@link DeleteRecordDialogVisible}. */\n public get deleteRecordDialogVisible(): boolean {\n return this.DeleteRecordDialogVisible;\n }\n /** @deprecated Use {@link DeleteRecordDialogVisible}. */\n public set deleteRecordDialogVisible(value: boolean) {\n this.DeleteRecordDialogVisible = value;\n }\n public CustomActionDialogVisible: boolean = false;\n\n /** @deprecated Use {@link CustomActionDialogVisible}. */\n public get customActionDialogVisible(): boolean {\n return this.CustomActionDialogVisible;\n }\n /** @deprecated Use {@link CustomActionDialogVisible}. */\n public set customActionDialogVisible(value: boolean) {\n this.CustomActionDialogVisible = value;\n }\n public DeleteRecordItem!: BaseEntity | null;\n\n /** @deprecated Use {@link DeleteRecordItem}. */\n public get deleteRecordItem(): BaseEntity | null {\n return this.DeleteRecordItem;\n }\n /** @deprecated Use {@link DeleteRecordItem}. */\n public set deleteRecordItem(value: BaseEntity | null) {\n this.DeleteRecordItem = value;\n }\n public CustomActionItem!: BaseEntity | undefined;\n\n /** @deprecated Use {@link CustomActionItem}. */\n public get customActionItem(): BaseEntity | undefined {\n return this.CustomActionItem;\n }\n /** @deprecated Use {@link CustomActionItem}. */\n public set customActionItem(value: BaseEntity | undefined) {\n this.CustomActionItem = value;\n }\n \n public async DeleteRecord(event: MouseEvent, r: BaseEntity) {\n // confirm with the user first\n this.DeleteRecordItem = r;\n this.DeleteRecordDialogVisible = true;\n if (event)\n event.stopPropagation(); // prevent row from getting click\n }\n\n /** @deprecated Use {@link DeleteRecord}. */\n public async deleteRecord(event: MouseEvent, r: BaseEntity) {\n return this.DeleteRecord(event, r);\n }\n\n public async PerformCustomAction(event: MouseEvent, r: BaseEntity) {\n // first emit the clicked event to allow the parent to react\n this.CustomActionClicked.emit(r);\n \n // confirm with the user\n this.CustomActionItem = r;\n this.CustomActionDialogVisible = true;\n if (event)\n event.stopPropagation(); // prevent row from getting click\n }\n\n /** @deprecated Use {@link PerformCustomAction}. */\n public async performCustomAction(event: MouseEvent, r: BaseEntity) {\n return this.PerformCustomAction(event, r);\n }\n \n /**\n * Gets the custom action icon for a record, using the function if provided, otherwise the static icon\n */\n public GetCustomActionIcon(record: BaseEntity): string {\n if (this.CustomActionIconFunction) {\n return this.CustomActionIconFunction(record);\n }\n return this.CustomActionIcon;\n }\n\n /** @deprecated Use {@link GetCustomActionIcon}. */\n public getCustomActionIcon(record: BaseEntity): string {\n return this.GetCustomActionIcon(record);\n }\n \n /**\n * Gets the custom action tooltip for a record, using the function if provided, otherwise the static tooltip\n */\n public GetCustomActionTooltip(record: BaseEntity): string {\n if (this.CustomActionTooltipFunction) {\n return this.CustomActionTooltipFunction(record);\n }\n return this.CustomActionTooltip;\n }\n\n /** @deprecated Use {@link GetCustomActionTooltip}. */\n public getCustomActionTooltip(record: BaseEntity): string {\n return this.GetCustomActionTooltip(record);\n }\n\n public async CloseCustomActionDialog(result: 'Yes' | 'No') {\n this.CustomActionDialogVisible = false;\n if (result === 'Yes') {\n // emit the event so the parent can handle the action\n this.CustomActionConfirmed.emit(this.CustomActionItem);\n }\n this.CustomActionItem = undefined;\n }\n\n /** @deprecated Use {@link CloseCustomActionDialog}. */\n public async closeCustomActionDialog(result: 'Yes' | 'No') {\n return this.CloseCustomActionDialog(result);\n }\n\n public async CloseDeleteDialog(result: 'Yes' | 'No') {\n // if the user confirms, delete the record\n this.DeleteRecordDialogVisible = false;\n if (result === 'Yes') {\n if (!await this.DeleteRecordItem!.Delete()) {\n // show an error message\n const errorMessage = this.DeleteRecordItem!.LatestResult.CompleteMessage;\n MJNotificationService.Instance.CreateSimpleNotification('Error deleting record: ' + errorMessage, 'error', 3000);\n }\n else \n this.Refresh(); // refresh the list\n }\n this.DeleteRecordItem = null;\n }\n\n /** @deprecated Use {@link CloseDeleteDialog}. */\n public async closeDeleteDialog(result: 'Yes' | 'No') {\n return this.CloseDeleteDialog(result);\n }\n\n public EditOrNewRecord!: BaseEntity;\n\n /** @deprecated Use {@link EditOrNewRecord}. */\n public get editOrNewRecord(): BaseEntity {\n return this.EditOrNewRecord;\n }\n /** @deprecated Use {@link EditOrNewRecord}. */\n public set editOrNewRecord(value: BaseEntity) {\n this.EditOrNewRecord = value;\n }\n public ShowEditOrNewRecordForm: boolean = false;\n\n /** @deprecated Use {@link ShowEditOrNewRecordForm}. */\n public get showEditOrNewRecordForm(): boolean {\n return this.ShowEditOrNewRecordForm;\n }\n /** @deprecated Use {@link ShowEditOrNewRecordForm}. */\n public set showEditOrNewRecordForm(value: boolean) {\n this.ShowEditOrNewRecordForm = value;\n }\n public RecordMode: 'new' | 'edit' = 'new';\n\n /** @deprecated Use {@link RecordMode}. */\n public get recordMode(): 'new' | 'edit' {\n return this.RecordMode;\n }\n /** @deprecated Use {@link RecordMode}. */\n public set recordMode(value: 'new' | 'edit') {\n this.RecordMode = value;\n }\n public async CreateNewRecord() {\n // attempt to create a new record and if success, navigate to the new record\n const md = this.ProviderToUse;\n this.EditOrNewRecord = await md.GetEntityObject(this.EntityName);\n if (this.EditOrNewRecord) {\n this.EditOrNewRecord.NewRecord();\n this.RecordMode = 'new';\n this.ShowEditOrNewRecordForm = true;\n }\n }\n\n /** @deprecated Use {@link CreateNewRecord}. */\n public async createNewRecord() {\n return this.CreateNewRecord();\n }\n\n public async EditRecord(event: MouseEvent, r: BaseEntity) {\n this.EditOrNewRecord = r;\n this.RecordMode = 'edit';\n this.ShowEditOrNewRecordForm = true;\n if (event)\n event.stopPropagation(); // prevent row from getting click\n }\n\n /** @deprecated Use {@link EditRecord}. */\n public async editRecord(event: MouseEvent, r: BaseEntity) {\n return this.EditRecord(event, r);\n }\n\n public async OnEditOrNewRecordFormClosed(result: 'Save' | 'Cancel') {\n if (!this.EditOrNewRecord)\n return; // this can happen if the user closes the form before the record is loaded\n\n this.ShowEditOrNewRecordForm = false;\n \n if (result === 'Save') {\n // the dialog already saved the record, just check to make sure it was saved and if so, navigate\n if (this.EditOrNewRecord.IsSaved) {\n if (this.RecordMode === 'edit')\n this.RecordEdited.emit(this.EditOrNewRecord);\n else\n this.RecordCreated.emit(this.EditOrNewRecord);\n\n // refresh our grid now\n await this.Refresh();\n }\n else\n throw new Error('Record was not saved');\n }\n }\n\n /** @deprecated Use {@link OnEditOrNewRecordFormClosed}. */\n public async onEditOrNewRecordFormClosed(result: 'Save' | 'Cancel') {\n return this.OnEditOrNewRecordFormClosed(result);\n }\n\n public GetRecordName(r: BaseEntity): string {\n // check to see if we have any columns in the entity that have IsNameField = 1, the fall back from there is to look for a column named \"Name\", and if that doesn't work we return the primary key(s)\n const md = this.ProviderToUse;\n const e = md.Entities.find(e => e.Name === this.EntityName);\n if (!e)\n throw new Error('Entity not found: ' + this.EntityName);\n\n const nameField = e.Fields.find(c => c.IsNameField);\n if (nameField)\n return r.Get(nameField.Name);\n else {\n const nameField = e.Fields.find(c => c.Name === 'Name');\n if (nameField)\n return r.Get(\"Name\");\n else {\n // iterate through all primary keys and form a comma separated list\n const pkString = r.PrimaryKeys.map(pk => r.Get(pk.Name)).join(', ');\n return \"Record: \" + pkString;\n }\n }\n }\n\n /** @deprecated Use {@link GetRecordName}. */\n public getRecordName(r: BaseEntity): string {\n return this.GetRecordName(r);\n }\n}\n","<div class=\"wrapper scrollable\">\n @if(isLoading) {\n <div>\n <mj-loading [showText]=\"false\" size=\"medium\"></mj-loading>\n </div>\n }\n @else {\n <div class=\"vertical-full-width\">\n @if(AllowNew) {\n <button mjButton (click)=\"createNewRecord()\"><span class=\"fa-solid fa-plus\"></span> New</button>\n }\n <table class=\"grid\">\n <thead class=\"sticky-header\">\n <tr>\n @for (c of Columns; track c) {\n <th>\n {{ c }}\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (r of records; track r) {\n <tr (click)=\"selectRecord(undefined, r)\">\n @for (c of Columns; track c; let i = $index) {\n <td>\n <span>{{ r.Get(c) }}</span>\n @if(i === 0 && (AllowDelete || AllowEdit)) {\n <span>\n @if (AllowEdit) {\n <span class=\"fa-solid fa-pen-to-square icon\" (click)=\"editRecord($event, r)\" title=\"Edit\"></span>\n }\n @if (AllowCustomAction) {\n <span\n class=\"fa-solid {{getCustomActionIcon(r)}} icon\"\n (click)=\"performCustomAction($event, r)\"\n title=\"{{getCustomActionTooltip(r)}}\"\n ></span>\n }\n @if (AllowDelete) {\n <span class=\"fa-solid fa-trash-can icon\" (click)=\"deleteRecord($event, r)\" title=\"Delete\"></span>\n }\n </span>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n}\n</div>\n\n@if(AllowNew || AllowEdit) {\n <mj-entity-form-dialog #entityForm\n [Record]=\"editOrNewRecord\"\n [SectionName]=\"EditSectionName\"\n Mode=\"section\"\n [Visible]=\"showEditOrNewRecordForm\"\n [AutoRevertOnCancel]=\"true\"\n [HandleSave]=\"true\"\n [Width]=\"550\"\n [Height]=\"450\"\n (DialogClosed)=\"onEditOrNewRecordFormClosed($event)\">\n </mj-entity-form-dialog>\n}\n\n@if(deleteRecordDialogVisible && AllowDelete) {\n <mj-dialog\n [Visible]=\"true\"\n [Title]=\"'Delete ' + EntityName + '?'\"\n [Width]=\"450\"\n [Height]=\"200\"\n (Close)=\"closeDeleteDialog('No')\" >\n <div>\n Are you sure you want to delete '{{getRecordName(deleteRecordItem!)}}'?\n </div>\n <mj-dialog-actions>\n <button mjButton variant=\"primary\" (click)=\"closeDeleteDialog('Yes')\">Yes</button>\n <button mjButton (click)=\"closeDeleteDialog('No')\">No</button>\n </mj-dialog-actions>\n </mj-dialog>\n}\n\n@if(customActionDialogVisible && AllowCustomAction) {\n <mj-dialog\n [Visible]=\"true\"\n [Title]=\"CustomActionDialogTitle\"\n [Width]=\"450\"\n [Height]=\"200\"\n (Close)=\"closeCustomActionDialog('No')\" >\n <div>\n {{ CustomActionDialogMessage.replace('{{recordName}}', getRecordName(customActionItem!)) }}\n @if(CustomActionDialogInfo) {\n <p>{{ CustomActionDialogInfo }}</p>\n }\n </div>\n <mj-dialog-actions>\n <button mjButton variant=\"primary\" (click)=\"closeCustomActionDialog('Yes')\">Yes</button>\n <button mjButton (click)=\"closeCustomActionDialog('No')\">No</button>\n </mj-dialog-actions>\n </mj-dialog>\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-simple-record-list",
3
- "version": "6.1.4",
3
+ "version": "6.2.0-edge.1",
4
4
  "description": "MemberJunction: Very simple and reusable Angular component for displaying, editing, creating and deleting records in any entity",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
@@ -13,7 +13,7 @@
13
13
  "devDependencies": {
14
14
  "@angular/compiler": "21.2.22",
15
15
  "@angular/compiler-cli": "21.2.22",
16
- "@memberjunction/ng-test-utils": "6.1.4"
16
+ "@memberjunction/ng-test-utils": "6.2.0-edge.1"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "@angular/common": "^21.2.22",
@@ -21,15 +21,15 @@
21
21
  "@angular/forms": "^21.2.22"
22
22
  },
23
23
  "dependencies": {
24
- "@memberjunction/core": "6.1.4",
25
- "@memberjunction/core-entities": "6.1.4",
26
- "@memberjunction/global": "6.1.4",
27
- "@memberjunction/ng-base-types": "6.1.4",
28
- "@memberjunction/ng-container-directives": "6.1.4",
29
- "@memberjunction/ng-entity-form-dialog": "6.1.4",
30
- "@memberjunction/ng-notifications": "6.1.4",
31
- "@memberjunction/ng-shared-generic": "6.1.4",
32
- "@memberjunction/ng-ui-components": "6.1.4",
24
+ "@memberjunction/core": "6.2.0-edge.1",
25
+ "@memberjunction/core-entities": "6.2.0-edge.1",
26
+ "@memberjunction/global": "6.2.0-edge.1",
27
+ "@memberjunction/ng-base-types": "6.2.0-edge.1",
28
+ "@memberjunction/ng-container-directives": "6.2.0-edge.1",
29
+ "@memberjunction/ng-entity-form-dialog": "6.2.0-edge.1",
30
+ "@memberjunction/ng-notifications": "6.2.0-edge.1",
31
+ "@memberjunction/ng-shared-generic": "6.2.0-edge.1",
32
+ "@memberjunction/ng-ui-components": "6.2.0-edge.1",
33
33
  "tslib": "^2.8.1"
34
34
  },
35
35
  "sideEffects": false,