@memberjunction/ng-entity-viewer 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.
Files changed (81) hide show
  1. package/dist/lib/aggregate-panel/aggregate-panel.component.d.ts +18 -2
  2. package/dist/lib/aggregate-panel/aggregate-panel.component.d.ts.map +1 -1
  3. package/dist/lib/aggregate-panel/aggregate-panel.component.js +47 -18
  4. package/dist/lib/aggregate-panel/aggregate-panel.component.js.map +1 -1
  5. package/dist/lib/aggregate-setup-dialog/aggregate-setup-dialog.component.d.ts +22 -0
  6. package/dist/lib/aggregate-setup-dialog/aggregate-setup-dialog.component.d.ts.map +1 -1
  7. package/dist/lib/aggregate-setup-dialog/aggregate-setup-dialog.component.js +57 -13
  8. package/dist/lib/aggregate-setup-dialog/aggregate-setup-dialog.component.js.map +1 -1
  9. package/dist/lib/entity-cards/entity-cards.component.d.ts +68 -5
  10. package/dist/lib/entity-cards/entity-cards.component.d.ts.map +1 -1
  11. package/dist/lib/entity-cards/entity-cards.component.js +213 -73
  12. package/dist/lib/entity-cards/entity-cards.component.js.map +1 -1
  13. package/dist/lib/entity-data-grid/entity-data-grid.component.d.ts +156 -14
  14. package/dist/lib/entity-data-grid/entity-data-grid.component.d.ts.map +1 -1
  15. package/dist/lib/entity-data-grid/entity-data-grid.component.js +432 -138
  16. package/dist/lib/entity-data-grid/entity-data-grid.component.js.map +1 -1
  17. package/dist/lib/entity-data-grid/events/grid-events.js +67 -67
  18. package/dist/lib/entity-data-grid/events/grid-events.js.map +1 -1
  19. package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.d.ts +112 -8
  20. package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.d.ts.map +1 -1
  21. package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.js +255 -69
  22. package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.js.map +1 -1
  23. package/dist/lib/entity-viewer/entity-viewer.component.d.ts +11 -0
  24. package/dist/lib/entity-viewer/entity-viewer.component.d.ts.map +1 -1
  25. package/dist/lib/entity-viewer/entity-viewer.component.js +45 -8
  26. package/dist/lib/entity-viewer/entity-viewer.component.js.map +1 -1
  27. package/dist/lib/pill/pill.component.d.ts +13 -3
  28. package/dist/lib/pill/pill.component.d.ts.map +1 -1
  29. package/dist/lib/pill/pill.component.js +34 -10
  30. package/dist/lib/pill/pill.component.js.map +1 -1
  31. package/dist/lib/quick-save-dialog/quick-save-dialog.component.d.ts +29 -3
  32. package/dist/lib/quick-save-dialog/quick-save-dialog.component.d.ts.map +1 -1
  33. package/dist/lib/quick-save-dialog/quick-save-dialog.component.js +173 -114
  34. package/dist/lib/quick-save-dialog/quick-save-dialog.component.js.map +1 -1
  35. package/dist/lib/recycle-bin/recycle-bin.component.d.ts +4 -0
  36. package/dist/lib/recycle-bin/recycle-bin.component.d.ts.map +1 -1
  37. package/dist/lib/recycle-bin/recycle-bin.component.js +10 -2
  38. package/dist/lib/recycle-bin/recycle-bin.component.js.map +1 -1
  39. package/dist/lib/utils/aggregate-field.util.d.ts +21 -0
  40. package/dist/lib/utils/aggregate-field.util.d.ts.map +1 -0
  41. package/dist/lib/utils/aggregate-field.util.js +40 -0
  42. package/dist/lib/utils/aggregate-field.util.js.map +1 -0
  43. package/dist/lib/utils/highlight.util.d.ts +6 -0
  44. package/dist/lib/utils/highlight.util.d.ts.map +1 -1
  45. package/dist/lib/utils/highlight.util.js +23 -11
  46. package/dist/lib/utils/highlight.util.js.map +1 -1
  47. package/dist/lib/utils/record.util.d.ts +10 -0
  48. package/dist/lib/utils/record.util.d.ts.map +1 -1
  49. package/dist/lib/utils/record.util.js +20 -4
  50. package/dist/lib/utils/record.util.js.map +1 -1
  51. package/dist/lib/view-config-panel/view-config-panel.component.d.ts +22 -2
  52. package/dist/lib/view-config-panel/view-config-panel.component.d.ts.map +1 -1
  53. package/dist/lib/view-config-panel/view-config-panel.component.js +54 -14
  54. package/dist/lib/view-config-panel/view-config-panel.component.js.map +1 -1
  55. package/dist/lib/view-selector/view-selector.component.js +2 -2
  56. package/dist/lib/view-types/renderers/cards-view-renderer.component.d.ts +15 -3
  57. package/dist/lib/view-types/renderers/cards-view-renderer.component.d.ts.map +1 -1
  58. package/dist/lib/view-types/renderers/cards-view-renderer.component.js +33 -5
  59. package/dist/lib/view-types/renderers/cards-view-renderer.component.js.map +1 -1
  60. package/dist/lib/view-types/renderers/grid-view-renderer.component.d.ts +160 -5
  61. package/dist/lib/view-types/renderers/grid-view-renderer.component.d.ts.map +1 -1
  62. package/dist/lib/view-types/renderers/grid-view-renderer.component.js +576 -36
  63. package/dist/lib/view-types/renderers/grid-view-renderer.component.js.map +1 -1
  64. package/dist/lib/view-types/renderers/map-view-renderer.component.d.ts +16 -2
  65. package/dist/lib/view-types/renderers/map-view-renderer.component.d.ts.map +1 -1
  66. package/dist/lib/view-types/renderers/map-view-renderer.component.js +37 -9
  67. package/dist/lib/view-types/renderers/map-view-renderer.component.js.map +1 -1
  68. package/dist/lib/view-types/view-type.contracts.js.map +1 -1
  69. package/dist/lib/view-workspace/view-workspace.component.d.ts +235 -24
  70. package/dist/lib/view-workspace/view-workspace.component.d.ts.map +1 -1
  71. package/dist/lib/view-workspace/view-workspace.component.js +600 -174
  72. package/dist/lib/view-workspace/view-workspace.component.js.map +1 -1
  73. package/dist/module.d.ts +5 -4
  74. package/dist/module.d.ts.map +1 -1
  75. package/dist/module.js +8 -1
  76. package/dist/module.js.map +1 -1
  77. package/dist/public-api.d.ts +1 -0
  78. package/dist/public-api.d.ts.map +1 -1
  79. package/dist/public-api.js +1 -0
  80. package/dist/public-api.js.map +1 -1
  81. package/package.json +21 -20
@@ -1 +1 @@
1
- {"version":3,"file":"quick-save-dialog.component.js","sourceRoot":"","sources":["../../../src/lib/quick-save-dialog/quick-save-dialog.component.ts","../../../src/lib/quick-save-dialog/quick-save-dialog.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE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AOJ,eAAsB;YAAtB,4CAAsB;YAQ/C,eAqCC;YArCD,uCAqCC;YAYC,eAiCC;YAjCD,0CAiCC;;;iFD9GM,wBAAwB;cANpC,SAAS;6BACI,KAAK,YACP,sBAAsB;;kBAQ/B,KAAK;;kBAKL,KAAK;;kBAKL,KAAK;;kBAKL,KAAK;;kBAKL,KAAK;;kBAKL,KAAK;;kBAKL,MAAM;;kBAKN,MAAM;;kBAMN,MAAM;;kFA7CI,wBAAwB","sourcesContent":["import { Component, Input, Output, EventEmitter, OnChanges, SimpleChanges, ChangeDetectorRef } from '@angular/core';\nimport { MJUserViewEntityExtended } from '@memberjunction/core-entities';\nimport { ViewConfigSummary, QuickSaveEvent, QuickSaveAdvancedEvent } from '../types';\n\n/**\n * QuickSaveDialogComponent - Focused modal for saving views quickly\n *\n * Replaces the 7+ click \"create new view\" flow with a focused 2-3 click dialog.\n * Shows essential fields (name, description, share) plus a summary preview\n * of what the view configuration includes.\n *\n * Footer buttons determine the action:\n * - No existing view: \"Create View\" button\n * - Existing view: \"Update\" (primary) + \"Save As New\" (secondary) buttons\n *\n * @example\n * ```html\n * <mj-quick-save-dialog\n * [IsOpen]=\"showQuickSave\"\n * [ViewEntity]=\"currentView\"\n * [EntityName]=\"entity.Name\"\n * [Summary]=\"configSummary\"\n * [IsSaving]=\"isSaving\"\n * (Save)=\"onQuickSave($event)\"\n * (Close)=\"showQuickSave = false\"\n * (OpenAdvanced)=\"openConfigPanel()\">\n * </mj-quick-save-dialog>\n * ```\n */\n@Component({\n standalone: false,\n selector: 'mj-quick-save-dialog',\n templateUrl: './quick-save-dialog.component.html',\n styleUrls: ['./quick-save-dialog.component.css']\n})\nexport class QuickSaveDialogComponent implements OnChanges {\n /**\n * Whether the dialog is open\n */\n @Input() IsOpen: boolean = false;\n\n /**\n * The existing view entity (null = creating new)\n */\n @Input() ViewEntity: MJUserViewEntityExtended | null = null;\n\n /**\n * Display name of the entity being viewed\n */\n @Input() EntityName: string = '';\n\n /**\n * Summary of what the current view configuration includes\n */\n @Input() Summary: ViewConfigSummary | null = null;\n\n /**\n * Whether a save is in progress\n */\n @Input() IsSaving: boolean = false;\n\n /**\n * Whether to default to Save As New mode (no longer used for toggle, kept for API compat)\n */\n @Input() DefaultSaveAsNew: boolean = false;\n\n /**\n * Emitted when the user saves\n */\n @Output() Save = new EventEmitter<QuickSaveEvent>();\n\n /**\n * Emitted when the dialog should close\n */\n @Output() Close = new EventEmitter<void>();\n\n /**\n * Emitted when user wants to open the full config panel.\n * Carries the partially-filled form data so the config panel can continue the flow.\n */\n @Output() OpenAdvanced = new EventEmitter<QuickSaveAdvancedEvent>();\n\n // Form state\n public Name: string = '';\n public Description: string = '';\n public IsShared: boolean = false;\n public NameTouched: boolean = false;\n\n constructor(private cdr: ChangeDetectorRef) {}\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['IsOpen'] && this.IsOpen) {\n this.initializeForm();\n }\n }\n\n /**\n * Initialize form from view entity or defaults\n */\n private initializeForm(): void {\n this.NameTouched = false;\n if (this.ViewEntity) {\n this.Name = this.ViewEntity.Name;\n this.Description = this.ViewEntity.Description || '';\n this.IsShared = this.ViewEntity.IsShared;\n } else {\n this.Name = '';\n this.Description = '';\n this.IsShared = false;\n }\n this.cdr.detectChanges();\n }\n\n /**\n * Handle save button click\n * @param saveAsNew - true to create a new view, false to update existing\n */\n OnSave(saveAsNew: boolean): void {\n if (!this.Name.trim() || this.IsSaving) return;\n\n this.Save.emit({\n Name: this.Name.trim(),\n Description: this.Description,\n IsShared: this.IsShared,\n SaveAsNew: saveAsNew\n });\n }\n\n /**\n * Handle close/cancel\n */\n OnClose(): void {\n this.Close.emit();\n }\n\n /**\n * Open advanced configuration panel, carrying partially-filled form data\n */\n OnOpenAdvanced(): void {\n this.OpenAdvanced.emit({\n Name: this.Name.trim(),\n Description: this.Description,\n IsShared: this.IsShared\n });\n }\n}\n","<!-- Dialog Backdrop -->\n@if (IsOpen) {\n <div class=\"dialog-backdrop\" (click)=\"OnClose()\"></div>\n}\n\n<!-- Dialog Panel -->\n<div class=\"dialog-panel\" [class.open]=\"IsOpen\">\n <!-- Header -->\n <div class=\"dialog-header\">\n <div class=\"header-title\">\n <i class=\"fa-solid fa-bookmark\"></i>\n <span>Save View</span>\n </div>\n @if (EntityName) {\n <span class=\"entity-badge\">{{ EntityName }}</span>\n }\n <button class=\"close-btn\" (click)=\"OnClose()\" title=\"Close\" aria-label=\"Close dialog\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n\n <!-- Content -->\n <div class=\"dialog-content\">\n <!-- Name Field -->\n <div class=\"form-group\">\n <label for=\"quickSaveName\">View Name</label>\n <input\n id=\"quickSaveName\"\n type=\"text\"\n class=\"form-input\"\n [class.invalid]=\"NameTouched && !Name.trim()\"\n placeholder=\"e.g., Active West Coast Contacts\"\n [(ngModel)]=\"Name\"\n (blur)=\"NameTouched = true\"\n (keydown.enter)=\"OnSave(false)\"\n />\n @if (NameTouched && !Name.trim()) {\n <span class=\"validation-error\">Name is required</span>\n }\n </div>\n\n <!-- Description Field -->\n <div class=\"form-group\">\n <label for=\"quickSaveDescription\">Description <span class=\"optional\">(optional)</span></label>\n <textarea\n id=\"quickSaveDescription\"\n class=\"form-input form-textarea\"\n placeholder=\"What does this view show?\"\n [(ngModel)]=\"Description\"\n rows=\"2\"\n ></textarea>\n </div>\n\n <!-- Share Toggle -->\n <label class=\"checkbox-label\">\n <input type=\"checkbox\" [(ngModel)]=\"IsShared\" />\n <span class=\"checkbox-text\">\n <strong>Share with others</strong>\n <small>Allow other users to use this view</small>\n </span>\n </label>\n\n <!-- View Summary Preview -->\n @if (Summary) {\n <div class=\"summary-section\">\n <div class=\"summary-header\">\n <i class=\"fa-solid fa-list-check\"></i>\n <span>View includes:</span>\n </div>\n <div class=\"summary-items\">\n <div class=\"summary-item\">\n <i class=\"fa-solid fa-columns\"></i>\n <span>{{ Summary.ColumnCount }} column{{ Summary.ColumnCount !== 1 ? 's' : '' }}</span>\n </div>\n @if (Summary.SortCount > 0) {\n <div class=\"summary-item\">\n <i class=\"fa-solid fa-arrow-up-wide-short\"></i>\n <span>{{ Summary.SortCount }} sort level{{ Summary.SortCount !== 1 ? 's' : '' }}</span>\n </div>\n }\n @if (Summary.SmartFilterActive) {\n <div class=\"summary-item smart-filter\">\n <i class=\"fa-solid fa-wand-magic-sparkles\"></i>\n <span>Smart filter: \"{{ Summary.SmartFilterPrompt }}\"</span>\n </div>\n }\n @if (Summary.FilterCount > 0) {\n <div class=\"summary-item\">\n <i class=\"fa-solid fa-filter\"></i>\n <span>{{ Summary.FilterCount }} filter{{ Summary.FilterCount !== 1 ? 's' : '' }}</span>\n </div>\n }\n @if (Summary.AggregateCount > 0) {\n <div class=\"summary-item\">\n <i class=\"fa-solid fa-chart-simple\"></i>\n <span>{{ Summary.AggregateCount }} aggregate{{ Summary.AggregateCount !== 1 ? 's' : '' }}</span>\n </div>\n }\n </div>\n </div>\n }\n\n <!-- Advanced Link -->\n <button class=\"advanced-link\" (click)=\"OnOpenAdvanced()\">\n <i class=\"fa-solid fa-sliders\"></i>\n <span>Customize columns, filters & sorting...</span>\n </button>\n </div>\n\n <!-- Footer -->\n <div class=\"dialog-footer\">\n <div class=\"footer-actions\">\n @if (ViewEntity) {\n <!-- Existing view: Update + Save As New -->\n <button\n class=\"btn btn-primary\"\n (click)=\"OnSave(false)\"\n [disabled]=\"!Name.trim() || IsSaving\">\n @if (IsSaving) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n } @else {\n <i class=\"fa-solid fa-save\"></i>\n }\n {{ IsSaving ? 'Saving...' : 'Update' }}\n </button>\n <button\n class=\"btn btn-secondary\"\n (click)=\"OnSave(true)\"\n [disabled]=\"!Name.trim() || IsSaving\">\n <i class=\"fa-solid fa-plus\"></i>\n Save As New\n </button>\n } @else {\n <!-- New view: Create -->\n <button\n class=\"btn btn-primary\"\n (click)=\"OnSave(true)\"\n [disabled]=\"!Name.trim() || IsSaving\">\n @if (IsSaving) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n } @else {\n <i class=\"fa-solid fa-plus\"></i>\n }\n {{ IsSaving ? 'Saving...' : 'Create View' }}\n </button>\n }\n </div>\n <button class=\"btn btn-cancel\" (click)=\"OnClose()\">\n Cancel\n </button>\n </div>\n</div>\n"]}
1
+ {"version":3,"file":"quick-save-dialog.component.js","sourceRoot":"","sources":["../../../src/lib/quick-save-dialog/quick-save-dialog.component.ts","../../../src/lib/quick-save-dialog/quick-save-dialog.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAA8D,SAAS,EAAc,MAAM,eAAe,CAAC;;;;;;ICExJ,+BAAiD;IAApB,yLAAS,gBAAS,KAAC;IAAC,iBAAM;;;IAYnD,+BAA2B;IAAA,YAAgB;IAAA,iBAAO;;;IAAvB,cAAgB;IAAhB,uCAAgB;;;IAwBzC,gCAA+B;IAAA,gCAAgB;IAAA,iBAAO;;;IAsClD,+BAA0B;IACxB,wBAA+C;IAC/C,4BAAM;IAAA,YAA0E;IAClF,AADkF,iBAAO,EACnF;;;IADE,eAA0E;IAA1E,6GAA0E;;;IAIlF,+BAAuC;IACrC,wBAA+C;IAC/C,4BAAM;IAAA,YAA+C;IACvD,AADuD,iBAAO,EACxD;;;IADE,eAA+C;IAA/C,iFAA+C;;;IAIvD,+BAA0B;IACxB,wBAAkC;IAClC,4BAAM;IAAA,YAA0E;IAClF,AADkF,iBAAO,EACnF;;;IADE,eAA0E;IAA1E,6GAA0E;;;IAIlF,+BAA0B;IACxB,wBAAwC;IACxC,4BAAM;IAAA,YAAmF;IAC3F,AAD2F,iBAAO,EAC5F;;;IADE,eAAmF;IAAnF,sHAAmF;;;IA9B/F,AADF,+BAA6B,cACC;IAC1B,wBAAsC;IACtC,4BAAM;IAAA,8BAAc;IACtB,AADsB,iBAAO,EACvB;IAEJ,AADF,+BAA2B,cACC;IACxB,wBAAmC;IACnC,4BAAM;IAAA,YAA0E;IAClF,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CAAyB;YAOJ,eAAsB;YAAtB,4CAAsB;YAQ/C,eAqCC;YArCD,uCAqCC;YAYC,eAiCC;YAjCD,0CAiCC;;;iFD/GM,wBAAwB;cANpC,SAAS;6BACI,KAAK,YACP,sBAAsB;;kBAQ/B,KAAK;;kBAKL,KAAK;;kBAKL,KAAK;;kBAKL,KAAK;;kBAKL,KAAK;;kBAKL,KAAK;;kBAQL,KAAK;;kBAKL,MAAM;;kBAKN,MAAM;;kBAMN,MAAM;;kBAGN,SAAS;mBAAC,WAAW;;kFAxDX,wBAAwB","sourcesContent":["import { Component, Input, Output, EventEmitter, OnChanges, AfterViewInit, SimpleChanges, ChangeDetectorRef, ViewChild, ElementRef } from '@angular/core';\nimport { MJUserViewEntityExtended } from '@memberjunction/core-entities';\nimport { ViewConfigSummary, QuickSaveEvent, QuickSaveAdvancedEvent } from '../types';\n\n/**\n * QuickSaveDialogComponent - Focused modal for saving views quickly\n *\n * Replaces the 7+ click \"create new view\" flow with a focused 2-3 click dialog.\n * Shows essential fields (name, description, share) plus a summary preview\n * of what the view configuration includes.\n *\n * Footer buttons determine the action:\n * - No existing view: \"Create View\" button\n * - Existing view: \"Update\" (primary) + \"Save As New\" (secondary) buttons\n *\n * @example\n * ```html\n * <mj-quick-save-dialog\n * [IsOpen]=\"showQuickSave\"\n * [ViewEntity]=\"currentView\"\n * [EntityName]=\"entity.Name\"\n * [Summary]=\"configSummary\"\n * [IsSaving]=\"isSaving\"\n * (Save)=\"onQuickSave($event)\"\n * (Close)=\"showQuickSave = false\"\n * (OpenAdvanced)=\"openConfigPanel()\">\n * </mj-quick-save-dialog>\n * ```\n */\n@Component({\n standalone: false,\n selector: 'mj-quick-save-dialog',\n templateUrl: './quick-save-dialog.component.html',\n styleUrls: ['./quick-save-dialog.component.css']\n})\nexport class QuickSaveDialogComponent implements OnChanges, AfterViewInit {\n /**\n * Whether the dialog is open\n */\n @Input() IsOpen: boolean = false;\n\n /**\n * The existing view entity (null = creating new)\n */\n @Input() ViewEntity: MJUserViewEntityExtended | null = null;\n\n /**\n * Display name of the entity being viewed\n */\n @Input() EntityName: string = '';\n\n /**\n * Summary of what the current view configuration includes\n */\n @Input() Summary: ViewConfigSummary | null = null;\n\n /**\n * Whether a save is in progress\n */\n @Input() IsSaving: boolean = false;\n\n /**\n * Whether to default to Save As New mode (no longer used for toggle, kept for API compat)\n */\n @Input() DefaultSaveAsNew: boolean = false;\n\n /**\n * Name to pre-fill when creating a NEW view, so the user can accept it with a single click.\n * The field is focused and its text selected on open, so typing replaces it outright.\n *\n * Ignored when {@link ViewEntity} is set — an existing view's own name always wins.\n */\n @Input() SuggestedName: string = '';\n\n /**\n * Emitted when the user saves\n */\n @Output() Save = new EventEmitter<QuickSaveEvent>();\n\n /**\n * Emitted when the dialog should close\n */\n @Output() Close = new EventEmitter<void>();\n\n /**\n * Emitted when user wants to open the full config panel.\n * Carries the partially-filled form data so the config panel can continue the flow.\n */\n @Output() OpenAdvanced = new EventEmitter<QuickSaveAdvancedEvent>();\n\n /** The name input, focused and selected whenever the dialog opens. */\n @ViewChild('nameInput') private nameInput?: ElementRef<HTMLInputElement>;\n\n // Form state\n public Name: string = '';\n public Description: string = '';\n public IsShared: boolean = false;\n public NameTouched: boolean = false;\n\n /**\n * True when the dialog opened before the view existed, so the focus has to wait for\n * `ngAfterViewInit`. The panel is always in the DOM (only `[class.open]` toggles), so after\n * the first render the ViewChild is resolved and opening can focus synchronously.\n */\n private focusPending: boolean = false;\n private viewReady: boolean = false;\n\n constructor(private cdr: ChangeDetectorRef) {}\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['IsOpen'] && this.IsOpen) {\n this.initializeForm();\n if (this.viewReady) {\n this.focusNameField();\n } else {\n this.focusPending = true;\n }\n }\n }\n\n ngAfterViewInit(): void {\n this.viewReady = true;\n if (this.focusPending) {\n this.focusPending = false;\n this.focusNameField();\n }\n }\n\n /**\n * Initialize form from view entity or defaults\n */\n private initializeForm(): void {\n this.NameTouched = false;\n if (this.ViewEntity) {\n this.Name = this.ViewEntity.Name;\n this.Description = this.ViewEntity.Description || '';\n this.IsShared = this.ViewEntity.IsShared;\n } else {\n this.Name = this.SuggestedName || '';\n this.Description = '';\n this.IsShared = false;\n }\n this.cdr.detectChanges();\n }\n\n /**\n * Put the cursor in the name field with its text selected: one click accepts a suggested\n * name, one keystroke replaces it.\n *\n * Deferred by a microtask because `ngModel` writes the seeded value to the element on one of\n * its own — selecting first would select an empty field and leave the caret at the end once\n * the value landed.\n */\n private focusNameField(): void {\n queueMicrotask(() => {\n const input = this.nameInput?.nativeElement;\n if (!input || !this.IsOpen) {\n return;\n }\n input.focus();\n input.select();\n });\n }\n\n /**\n * Handle save button click\n * @param saveAsNew - true to create a new view, false to update existing\n */\n OnSave(saveAsNew: boolean): void {\n if (!this.Name.trim() || this.IsSaving) return;\n\n this.Save.emit({\n Name: this.Name.trim(),\n Description: this.Description,\n IsShared: this.IsShared,\n SaveAsNew: saveAsNew\n });\n }\n\n /**\n * Handle close/cancel\n */\n OnClose(): void {\n this.Close.emit();\n }\n\n /**\n * Open advanced configuration panel, carrying partially-filled form data\n */\n OnOpenAdvanced(): void {\n this.OpenAdvanced.emit({\n Name: this.Name.trim(),\n Description: this.Description,\n IsShared: this.IsShared\n });\n }\n}\n","<!-- Dialog Backdrop -->\n@if (IsOpen) {\n <div class=\"dialog-backdrop\" (click)=\"OnClose()\"></div>\n}\n\n<!-- Dialog Panel -->\n<div class=\"dialog-panel\" [class.open]=\"IsOpen\">\n <!-- Header -->\n <div class=\"dialog-header\">\n <div class=\"header-title\">\n <i class=\"fa-solid fa-bookmark\"></i>\n <span>Save View</span>\n </div>\n @if (EntityName) {\n <span class=\"entity-badge\">{{ EntityName }}</span>\n }\n <button class=\"close-btn\" (click)=\"OnClose()\" title=\"Close\" aria-label=\"Close dialog\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n\n <!-- Content -->\n <div class=\"dialog-content\">\n <!-- Name Field -->\n <div class=\"form-group\">\n <label for=\"quickSaveName\">View Name</label>\n <input\n #nameInput\n id=\"quickSaveName\"\n type=\"text\"\n class=\"form-input\"\n [class.invalid]=\"NameTouched && !Name.trim()\"\n placeholder=\"e.g., Active West Coast Contacts\"\n [(ngModel)]=\"Name\"\n (blur)=\"NameTouched = true\"\n (keydown.enter)=\"OnSave(false)\"\n />\n @if (NameTouched && !Name.trim()) {\n <span class=\"validation-error\">Name is required</span>\n }\n </div>\n\n <!-- Description Field -->\n <div class=\"form-group\">\n <label for=\"quickSaveDescription\">Description <span class=\"optional\">(optional)</span></label>\n <textarea\n id=\"quickSaveDescription\"\n class=\"form-input form-textarea\"\n placeholder=\"What does this view show?\"\n [(ngModel)]=\"Description\"\n rows=\"2\"\n ></textarea>\n </div>\n\n <!-- Share Toggle -->\n <label class=\"checkbox-label\">\n <input type=\"checkbox\" [(ngModel)]=\"IsShared\" />\n <span class=\"checkbox-text\">\n <strong>Share with others</strong>\n <small>Allow other users to use this view</small>\n </span>\n </label>\n\n <!-- View Summary Preview -->\n @if (Summary) {\n <div class=\"summary-section\">\n <div class=\"summary-header\">\n <i class=\"fa-solid fa-list-check\"></i>\n <span>View includes:</span>\n </div>\n <div class=\"summary-items\">\n <div class=\"summary-item\">\n <i class=\"fa-solid fa-columns\"></i>\n <span>{{ Summary.ColumnCount }} column{{ Summary.ColumnCount !== 1 ? 's' : '' }}</span>\n </div>\n @if (Summary.SortCount > 0) {\n <div class=\"summary-item\">\n <i class=\"fa-solid fa-arrow-up-wide-short\"></i>\n <span>{{ Summary.SortCount }} sort level{{ Summary.SortCount !== 1 ? 's' : '' }}</span>\n </div>\n }\n @if (Summary.SmartFilterActive) {\n <div class=\"summary-item smart-filter\">\n <i class=\"fa-solid fa-wand-magic-sparkles\"></i>\n <span>Smart filter: \"{{ Summary.SmartFilterPrompt }}\"</span>\n </div>\n }\n @if (Summary.FilterCount > 0) {\n <div class=\"summary-item\">\n <i class=\"fa-solid fa-filter\"></i>\n <span>{{ Summary.FilterCount }} filter{{ Summary.FilterCount !== 1 ? 's' : '' }}</span>\n </div>\n }\n @if (Summary.AggregateCount > 0) {\n <div class=\"summary-item\">\n <i class=\"fa-solid fa-chart-simple\"></i>\n <span>{{ Summary.AggregateCount }} aggregate{{ Summary.AggregateCount !== 1 ? 's' : '' }}</span>\n </div>\n }\n </div>\n </div>\n }\n\n <!-- Advanced Link -->\n <button class=\"advanced-link\" (click)=\"OnOpenAdvanced()\">\n <i class=\"fa-solid fa-sliders\"></i>\n <span>Customize columns, filters & sorting...</span>\n </button>\n </div>\n\n <!-- Footer -->\n <div class=\"dialog-footer\">\n <div class=\"footer-actions\">\n @if (ViewEntity) {\n <!-- Existing view: Update + Save As New -->\n <button\n class=\"btn btn-primary\"\n (click)=\"OnSave(false)\"\n [disabled]=\"!Name.trim() || IsSaving\">\n @if (IsSaving) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n } @else {\n <i class=\"fa-solid fa-save\"></i>\n }\n {{ IsSaving ? 'Saving...' : 'Update' }}\n </button>\n <button\n class=\"btn btn-secondary\"\n (click)=\"OnSave(true)\"\n [disabled]=\"!Name.trim() || IsSaving\">\n <i class=\"fa-solid fa-plus\"></i>\n Save As New\n </button>\n } @else {\n <!-- New view: Create -->\n <button\n class=\"btn btn-primary\"\n (click)=\"OnSave(true)\"\n [disabled]=\"!Name.trim() || IsSaving\">\n @if (IsSaving) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n } @else {\n <i class=\"fa-solid fa-plus\"></i>\n }\n {{ IsSaving ? 'Saving...' : 'Create View' }}\n </button>\n }\n </div>\n <button class=\"btn btn-cancel\" (click)=\"OnClose()\">\n Cancel\n </button>\n </div>\n</div>\n"]}
@@ -171,7 +171,11 @@ export declare class RecycleBinComponent extends BaseAngularComponent implements
171
171
  private buildSupportingFields;
172
172
  private formatFieldValue;
173
173
  private parseSnapshot;
174
+ FormatTimestamp(date: Date | string | null): string;
175
+ /** @deprecated Use {@link FormatTimestamp}. */
174
176
  formatTimestamp(date: Date | string | null): string;
177
+ GetUserDisplay(user: string | null): string;
178
+ /** @deprecated Use {@link GetUserDisplay}. */
175
179
  getUserDisplay(user: string | null): string;
176
180
  static ɵfac: i0.ɵɵFactoryDeclaration<RecycleBinComponent, never>;
177
181
  static ɵcmp: i0.ɵɵComponentDeclaration<RecycleBinComponent, "mj-recycle-bin", never, { "Visible": { "alias": "Visible"; "required": false; }; "EntityName": { "alias": "EntityName"; "required": false; }; "ContextUser": { "alias": "ContextUser"; "required": false; }; "MaxRecords": { "alias": "MaxRecords"; "required": false; }; }, { "Closed": "Closed"; "BeforeRecycleBinOpen": "BeforeRecycleBinOpen"; "AfterRecycleBinOpen": "AfterRecycleBinOpen"; "BeforeRecordRestore": "BeforeRecordRestore"; "AfterRecordRestore": "AfterRecordRestore"; "BeforeRestoreCommit": "BeforeRestoreCommit"; "AfterRestoreCommit": "AfterRestoreCommit"; }, never, never, false, never>;
@@ -1 +1 @@
1
- {"version":3,"file":"recycle-bin.component.d.ts","sourceRoot":"","sources":["../../../src/lib/recycle-bin/recycle-bin.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EACjB,YAAY,EAEZ,MAAM,EAGP,MAAM,eAAe,CAAC;AACvB,OAAO,EAKL,QAAQ,EACT,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,2BAA2B,EAC3B,4BAA4B,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC5B,eAAe,EAChB,MAAM,6BAA6B,CAAC;;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,qBAQa,mBAAoB,SAAQ,oBAAqB,YAAW,MAAM;IA+FjE,OAAO,CAAC,GAAG;IA5FvB;;;OAGG;IACH,OAAO,CA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,GAAG,MAAM;IAY1D,+CAA+C;IACxC,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM;IAInD,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM;IAMlD,8CAA8C;IACvC,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM;yCAvevC,mBAAmB;2CAAnB,mBAAmB;CA0e/B"}
@@ -577,7 +577,7 @@ export class RecycleBinComponent extends BaseAngularComponent {
577
577
  }
578
578
  }
579
579
  // ─── Display helpers (template) ─────────────────────────────────
580
- formatTimestamp(date) {
580
+ FormatTimestamp(date) {
581
581
  if (!date)
582
582
  return '';
583
583
  return new Intl.DateTimeFormat('en-US', {
@@ -589,13 +589,21 @@ export class RecycleBinComponent extends BaseAngularComponent {
589
589
  hour12: true,
590
590
  }).format(new Date(date));
591
591
  }
592
- getUserDisplay(user) {
592
+ /** @deprecated Use {@link FormatTimestamp}. */
593
+ formatTimestamp(date) {
594
+ return this.FormatTimestamp(date);
595
+ }
596
+ GetUserDisplay(user) {
593
597
  if (!user)
594
598
  return 'Unknown';
595
599
  if (user.includes('@'))
596
600
  return user.split('@')[0];
597
601
  return user;
598
602
  }
603
+ /** @deprecated Use {@link GetUserDisplay}. */
604
+ getUserDisplay(user) {
605
+ return this.GetUserDisplay(user);
606
+ }
599
607
  static ɵfac = function RecycleBinComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RecycleBinComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
600
608
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: RecycleBinComponent, selectors: [["mj-recycle-bin"]], inputs: { Visible: "Visible", EntityName: "EntityName", ContextUser: "ContextUser", MaxRecords: "MaxRecords" }, outputs: { Closed: "Closed", BeforeRecycleBinOpen: "BeforeRecycleBinOpen", AfterRecycleBinOpen: "AfterRecycleBinOpen", BeforeRecordRestore: "BeforeRecordRestore", AfterRecordRestore: "AfterRecordRestore", BeforeRestoreCommit: "BeforeRestoreCommit", AfterRestoreCommit: "AfterRestoreCommit" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 15, vars: 16, consts: [[3, "Closed", "Mode", "Title", "Visible", "Resizable", "MinWidthPx", "MaxWidthRatio"], [1, "rb-container"], [1, "rb-header"], [1, "rb-header-icon"], ["aria-hidden", "true", 1, "fa-solid", "fa-trash-can-arrow-up"], [1, "rb-header-text"], [1, "rb-header-title"], [1, "rb-header-subtitle"], ["Variant", "warning", "Icon", "fa-solid fa-lock", "Title", "Access denied", 3, "Message"], ["text", "Loading deleted records...", "size", "medium"], ["Variant", "error", "Icon", "fa-solid fa-triangle-exclamation", "Title", "Could not load deleted records", 3, "Message"], ["Icon", "fa-solid fa-trash-can", "Title", "Recycle Bin is empty", "Message", "No records have been deleted from this entity, or change tracking isn't enabled here."], [1, "rb-list"], [3, "RestoreConfirmed", "RestoreCancelled", "Visible", "Mode", "RecordChange", "EntityName"], [1, "rb-card"], [1, "rb-card-info"], [1, "rb-card-name"], [1, "rb-card-fields"], [1, "rb-card-meta"], ["aria-hidden", "true", 1, "fa-solid", "fa-trash"], [1, "rb-card-actions"], ["type", "button", 1, "rb-btn", "rb-btn-restore", 3, "click", "disabled", "title"], ["aria-hidden", "true", 1, "fa-solid", "fa-rotate-left"], [1, "rb-card-field"]], template: function RecycleBinComponent_Template(rf, ctx) { if (rf & 1) {
601
609
  i0.ɵɵelementStart(0, "mj-slide-panel", 0);
@@ -1 +1 @@
1
- {"version":3,"file":"recycle-bin.component.js","sourceRoot":"","sources":["../../../src/lib/recycle-bin/recycle-bin.component.ts","../../../src/lib/recycle-bin/recycle-bin.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,uBAAuB,EAEvB,YAAY,EACZ,KAAK,EAEL,MAAM,EACN,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAIL,OAAO,GAER,MAAM,sBAAsB,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8BAC3B;;;iFDRhB,mBAAmB;cAR/B,SAAS;6BACI,KAAK,YACP,gBAAgB,mBAGT,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,IAAI;;kBAUpC,KAAK;;kBAeL,KAAK;;kBAML,KAAK;;kBAQL,KAAK;;kBAKL,MAAM;;kBAON,MAAM;;kBAGN,MAAM;;kBAQN,MAAM;;kBAMN,MAAM;;kBAON,MAAM;;kBAGN,MAAM;;kFA5EI,mBAAmB","sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n EntityFieldInfo,\n EntityInfo,\n Metadata,\n RunView,\n UserInfo,\n} from '@memberjunction/core';\nimport { MJRecordChangeEntity } from '@memberjunction/core-entities';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { RestoreCommitEvent } from '@memberjunction/ng-record-changes';\nimport {\n AfterRecordRestoreEventArgs,\n AfterRecycleBinOpenEventArgs,\n AfterRestoreCommitEventArgs,\n BeforeRecordRestoreEventArgs,\n BeforeRecycleBinOpenEventArgs,\n BeforeRestoreCommitEventArgs,\n RecycleBinEntry,\n} from './events/recycle-bin-events';\n\n/**\n * Slide-in panel that lists all hard-deleted records for a single entity\n * and lets a user with `Delete` permission re-create any of them from its\n * historical RecordChange snapshot.\n *\n * ### When to use\n *\n * Surface this component from any entity-viewing context where the user\n * might need to restore a hard-deleted record. The {@link EntityViewerComponent},\n * {@link EntityDataGridComponent}, and {@link EntityCardsComponent}\n * already expose a `ShowRecycleBin` input (default `true`) that renders a\n * chip in their toolbar — you only need to use this component directly if\n * you're building a custom viewer.\n *\n * ### Permissions\n *\n * The chip / panel is gated on `entity.UserPermissions.CanDelete` —\n * rationale: there is no native \"undelete\" permission in MemberJunction,\n * but if a user has the higher-trust permission to *delete* records of an\n * entity, restoring deleted ones is well within scope. The actual\n * re-create action additionally requires `CanCreate`; without it the\n * Restore button on each card disables with a tooltip.\n *\n * ### Soft deletes vs hard deletes\n *\n * This component only surfaces *hard*-deleted records. Soft-deletes (e.g.,\n * `IsDeleted` flags, `Status='Inactive'`, etc.) leave the record visible\n * in normal entity views, so the standard Record Changes panel + restore\n * preview already handles them — no Recycle Bin needed.\n *\n * ### Cancelable Before/After event surface\n *\n * Every meaningful action emits a paired `before*` / `after*` event. The\n * `before*` event carries `cancel: boolean` so consumers can intercept\n * — useful for custom approval workflows, audit logging, or to take over\n * the actual restore execution entirely. See {@link BeforeRecordRestoreEventArgs}\n * and friends.\n *\n * @example Basic usage (rare — usually embedded by entity-viewer)\n * <mj-recycle-bin\n * [Visible]=\"showBin\"\n * [EntityName]=\"'Customers'\"\n * (Closed)=\"showBin = false\"\n * (BeforeRecordRestore)=\"auditRestore($event)\"\n * (AfterRestoreCommit)=\"onRestored($event)\">\n * </mj-recycle-bin>\n *\n * @example Intercepting a restore\n * onBeforeRecordRestore(e: BeforeRecordRestoreEventArgs) {\n * if (!myCustomApproval(e.entry)) {\n * e.cancel = true;\n * e.cancelReason = 'Awaiting compliance approval';\n * }\n * }\n */\n@Component({\n standalone: false,\n selector: 'mj-recycle-bin',\n templateUrl: './recycle-bin.component.html',\n styleUrls: ['./recycle-bin.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class RecycleBinComponent extends BaseAngularComponent implements OnInit {\n // ─── Inputs ─────────────────────────────────────────────────────\n\n /**\n * Controls panel visibility. Set to true to slide in (and trigger an\n * initial load); false to slide out.\n */\n private _visible = false;\n @Input()\n set Visible(value: boolean) {\n const wasVisible = this._visible;\n this._visible = value;\n if (value && !wasVisible && this.isInitialized) {\n this.LoadDeletedRecords();\n }\n }\n get Visible(): boolean {\n return this._visible;\n }\n\n /**\n * The name of the entity whose deleted records will be listed. Required.\n */\n @Input() EntityName: string | null = null;\n\n /**\n * Optional context user. When omitted, falls back to\n * {@link this.ProviderToUse.CurrentUser} per standard MJ conventions.\n */\n @Input() ContextUser: UserInfo | null = null;\n\n /**\n * Maximum number of deleted-record cards to load. Defaults to 200 — this\n * is a UI affordance, not a hard limit; consumers needing pagination\n * should listen to {@link AfterRecycleBinOpen} and surface their own UI\n * if `deletedRecordCount === MaxRecords`.\n */\n @Input() MaxRecords = 200;\n\n // ─── Outputs ────────────────────────────────────────────────────\n\n /** Fires when the user closes the panel. */\n @Output() Closed = new EventEmitter<void>();\n\n /**\n * Cancelable. Fires when {@link Visible} flips to true and the bin is\n * about to query for deleted records. Setting `cancel = true` aborts\n * the query (and the panel will show the empty state).\n */\n @Output() BeforeRecycleBinOpen = new EventEmitter<BeforeRecycleBinOpenEventArgs>();\n\n /** Fires after the deleted-record query completes. */\n @Output() AfterRecycleBinOpen = new EventEmitter<AfterRecycleBinOpenEventArgs>();\n\n /**\n * Cancelable. Fires when the user clicks Restore on a deleted-record\n * card, before the preview panel opens. Setting `cancel = true` skips\n * the preview entirely — useful for consumers that want to take over\n * the restore flow themselves.\n */\n @Output() BeforeRecordRestore = new EventEmitter<BeforeRecordRestoreEventArgs>();\n\n /**\n * Fires after the user closes the restore preview, with `success`\n * indicating whether the actual insert worked.\n */\n @Output() AfterRecordRestore = new EventEmitter<AfterRecordRestoreEventArgs>();\n\n /**\n * Cancelable. Fires after the user clicks Restore in the preview but\n * before the entity is inserted. Setting `cancel = true` aborts the\n * insert.\n */\n @Output() BeforeRestoreCommit = new EventEmitter<BeforeRestoreCommitEventArgs>();\n\n /** Fires after the insert completes (success or failure). */\n @Output() AfterRestoreCommit = new EventEmitter<AfterRestoreCommitEventArgs>();\n\n // ─── Public template state ──────────────────────────────────────\n\n public IsLoading = false;\n public LoadError: string | null = null;\n public Entries: RecycleBinEntry[] = [];\n\n /** The currently selected entry whose preview is open. */\n public SelectedEntry: RecycleBinEntry | null = null;\n public PreviewVisible = false;\n\n /** Permission flags (computed once when EntityName is set). */\n public CanDelete = false;\n public CanCreate = false;\n\n private isInitialized = false;\n private resolvedEntityInfo: EntityInfo | null = null;\n\n constructor(private cdr: ChangeDetectorRef) {\n super();}\n\n ngOnInit(): void {\n this.isInitialized = true;\n if (this.Visible) this.LoadDeletedRecords();\n }\n\n // ─── Derived state ──────────────────────────────────────────────\n\n public get HeaderSubtitle(): string {\n if (!this.EntityName) return '';\n const n = this.Entries.length;\n return `${n} record${n === 1 ? '' : 's'} have been deleted from ${this.EntityName}.`;\n }\n\n /**\n * The user has Delete permission and may browse the bin. The Restore\n * button on each card additionally requires {@link CanCreate}.\n */\n public get HasAccess(): boolean {\n return this.CanDelete;\n }\n\n // ─── Public actions ─────────────────────────────────────────────\n\n /**\n * Manually trigger a re-load — useful for consumers who want to refresh\n * after some external event (e.g., a delete happened and they want the\n * bin to re-populate immediately).\n */\n public async LoadDeletedRecords(): Promise<void> {\n if (!this.EntityName) {\n this.LoadError = 'EntityName is required';\n return;\n }\n\n // Resolve metadata + permissions\n const md = this.ProviderToUse;\n const entityInfo = md.Entities.find(\n e => e.Name.trim().toLowerCase() === this.EntityName!.trim().toLowerCase(),\n );\n if (!entityInfo) {\n this.LoadError = `Entity '${this.EntityName}' not found`;\n this.cdr.markForCheck();\n return;\n }\n this.resolvedEntityInfo = entityInfo;\n const effectiveUser = this.ContextUser ?? md.CurrentUser;\n if (effectiveUser) {\n const perms = entityInfo.GetUserPermisions(effectiveUser);\n this.CanDelete = perms?.CanDelete ?? false;\n this.CanCreate = perms?.CanCreate ?? false;\n } else {\n this.CanDelete = false;\n this.CanCreate = false;\n }\n\n if (!this.CanDelete) {\n this.Entries = [];\n this.LoadError = 'You do not have Delete permission for this entity.';\n this.cdr.markForCheck();\n return;\n }\n\n // Fire BeforeRecycleBinOpen — consumer may cancel\n const beforeArgs: BeforeRecycleBinOpenEventArgs = {\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName,\n cancel: false,\n _kind: 'beforeRecycleBinOpen',\n };\n this.BeforeRecycleBinOpen.emit(beforeArgs);\n if (beforeArgs.cancel) {\n this.LoadError = beforeArgs.cancelReason ?? 'Cancelled by host';\n this.cdr.markForCheck();\n return;\n }\n\n this.IsLoading = true;\n this.LoadError = null;\n this.Entries = [];\n this.cdr.markForCheck();\n\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n // Get the most recent Delete change per RecordID. We over-fetch and\n // dedupe in JS — the data is small and SQL grouping with the latest\n // change per ID is awkward across dialects.\n const result = await rv.RunView<MJRecordChangeEntity>(\n {\n EntityName: 'MJ: Record Changes',\n ExtraFilter: `EntityID='${entityInfo.ID}' AND Type='Delete'`,\n OrderBy: 'ChangedAt DESC',\n MaxRows: this.MaxRecords * 2, // dedupe headroom\n ResultType: 'entity_object',\n },\n this.ContextUser ?? undefined,\n );\n\n if (!result.Success) {\n this.LoadError = result.ErrorMessage || 'Failed to load deleted records';\n } else {\n this.Entries = this.dedupeAndBuildEntries(result.Results, entityInfo);\n }\n } catch (e) {\n this.LoadError = e instanceof Error ? e.message : 'Unknown error';\n } finally {\n this.IsLoading = false;\n this.cdr.markForCheck();\n }\n\n // Fire AfterRecycleBinOpen\n this.AfterRecycleBinOpen.emit({\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName,\n deletedRecordCount: this.Entries.length,\n _kind: 'afterRecycleBinOpen',\n });\n }\n\n /**\n * User clicked Restore on a card — open the preview panel (unless a\n * BeforeRecordRestore handler cancelled).\n */\n public OnRestoreClicked(entry: RecycleBinEntry): void {\n if (!this.CanCreate) return; // gated in template too\n\n const beforeArgs: BeforeRecordRestoreEventArgs = {\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName ?? '',\n entry,\n cancel: false,\n _kind: 'beforeRecordRestore',\n };\n this.BeforeRecordRestore.emit(beforeArgs);\n if (beforeArgs.cancel) return;\n\n this.SelectedEntry = entry;\n this.PreviewVisible = true;\n this.cdr.markForCheck();\n }\n\n /**\n * Preview panel emitted RestoreConfirmed — perform the insert and emit\n * the matching after* events.\n */\n public async OnPreviewConfirmed(commit: RestoreCommitEvent): Promise<void> {\n if (!this.SelectedEntry || !this.resolvedEntityInfo) return;\n const entry = this.SelectedEntry;\n\n const beforeArgs: BeforeRestoreCommitEventArgs = {\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName ?? '',\n entry,\n fieldValues: commit.FieldValues,\n reason: commit.Reason,\n cancel: false,\n _kind: 'beforeRestoreCommit',\n };\n this.BeforeRestoreCommit.emit(beforeArgs);\n if (beforeArgs.cancel) {\n this.PreviewVisible = false;\n this.cdr.markForCheck();\n return;\n }\n\n let success = false;\n let errorMessage: string | undefined;\n let newRecordID: string | undefined;\n\n try {\n const md = this.ProviderToUse;\n const entity = await md.GetEntityObject(this.resolvedEntityInfo.Name, this.ContextUser ?? undefined);\n\n // Apply the snapshot fields, including the original primary key\n // (preserves any FK references that still point at this ID).\n for (const fv of commit.FieldValues) {\n entity.Set(fv.FieldName, fv.Value);\n }\n // Also re-apply the original primary key from the snapshot so dangling\n // FK references continue to work. Set() on a fresh entity treats this\n // as the new record's PK.\n try {\n const snapshotData = JSON.parse(entry.RecordChange.FullRecordJSON || '{}');\n for (const pk of this.resolvedEntityInfo.PrimaryKeys) {\n if (snapshotData[pk.Name] != null) {\n entity.Set(pk.Name, snapshotData[pk.Name]);\n }\n }\n } catch {\n // PK preservation is best-effort\n }\n\n entity.SetRestoreContext(commit.SourceChangeID, commit.Reason);\n\n try {\n success = await entity.Save();\n if (success) {\n newRecordID = entity.PrimaryKey.ToString();\n } else {\n errorMessage = entity.LatestResult?.CompleteMessage ?? 'Save returned false';\n }\n } finally {\n entity.ClearRestoreContext();\n }\n } catch (e) {\n success = false;\n errorMessage = e instanceof Error ? e.message : 'Unknown error';\n }\n\n this.AfterRestoreCommit.emit({\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName ?? '',\n entry,\n success,\n newRecordID,\n errorMessage,\n _kind: 'afterRestoreCommit',\n });\n\n this.AfterRecordRestore.emit({\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName ?? '',\n entry,\n success,\n errorMessage,\n _kind: 'afterRecordRestore',\n });\n\n if (success) {\n // Remove the restored entry from the list and close preview\n this.Entries = this.Entries.filter(e => e !== entry);\n }\n this.PreviewVisible = false;\n this.SelectedEntry = null;\n this.cdr.markForCheck();\n }\n\n public OnPreviewCancelled(): void {\n this.PreviewVisible = false;\n this.SelectedEntry = null;\n this.cdr.markForCheck();\n }\n\n public OnClose(): void {\n this._visible = false;\n this.cdr.markForCheck();\n this.Closed.emit();\n }\n\n // ─── Internal: build entries from raw RecordChange rows ─────────\n\n /**\n * Dedupes the raw delete-change rows: keeps only the most recent Delete\n * per RecordID (since a record could in principle have been recreated\n * and re-deleted). Builds the display fields heuristically by reading\n * the snapshot JSON.\n */\n private dedupeAndBuildEntries(\n rows: MJRecordChangeEntity[],\n entityInfo: EntityInfo,\n ): RecycleBinEntry[] {\n const seen = new Set<string>();\n const entries: RecycleBinEntry[] = [];\n\n for (const row of rows) {\n if (entries.length >= this.MaxRecords) break;\n if (seen.has(row.RecordID)) continue;\n seen.add(row.RecordID);\n\n const snapshot = this.parseSnapshot(row.FullRecordJSON);\n if (!snapshot) continue;\n\n const entry: RecycleBinEntry = {\n RecordChange: row,\n RecordID: row.RecordID,\n DisplaySummary: this.buildDisplaySummary(snapshot, entityInfo),\n SupportingFields: this.buildSupportingFields(snapshot, entityInfo),\n };\n entries.push(entry);\n }\n\n return entries;\n }\n\n /**\n * Builds the headline of the card. Prefers the entity's name field, then\n * any non-PK string field, then the RecordID itself as a last resort.\n */\n private buildDisplaySummary(snapshot: Record<string, unknown>, entityInfo: EntityInfo): string {\n const nameField = entityInfo.NameField;\n if (nameField && snapshot[nameField.Name] != null && snapshot[nameField.Name] !== '') {\n return String(snapshot[nameField.Name]);\n }\n // Fallback: first non-PK, non-empty string field\n for (const f of entityInfo.Fields) {\n if (f.IsPrimaryKey) continue;\n const v = snapshot[f.Name];\n if (typeof v === 'string' && v.trim().length > 0) return v;\n }\n // Last resort: every primary-key column's value (the entity is arbitrary and may be composite-keyed)\n const keyValues = entityInfo.PrimaryKeys\n .map((pk) => snapshot[pk.Name])\n .filter((v) => v != null && v !== '')\n .map((v) => String(v));\n return `Record ${keyValues.join(', ')}`;\n }\n\n /**\n * Picks up to 3 \"interesting\" fields from the snapshot to render as\n * supporting metadata under the headline. Heuristic: prefer fields that\n * are non-empty, non-PK, non-system, and have a display name.\n */\n private buildSupportingFields(\n snapshot: Record<string, unknown>,\n entityInfo: EntityInfo,\n ): Array<{ Name: string; DisplayName: string; Value: string }> {\n const out: Array<{ Name: string; DisplayName: string; Value: string }> = [];\n const nameFieldName = entityInfo.NameField?.Name;\n\n for (const f of entityInfo.Fields) {\n if (out.length >= 3) break;\n if (f.IsPrimaryKey) continue;\n if (f.Name.startsWith('__mj_')) continue;\n if (f.Name === nameFieldName) continue;\n\n const v = snapshot[f.Name];\n if (v == null || v === '') continue;\n\n out.push({\n Name: f.Name,\n DisplayName: f.DisplayNameOrName,\n Value: this.formatFieldValue(v, f),\n });\n }\n return out;\n }\n\n private formatFieldValue(value: unknown, _field: EntityFieldInfo): string {\n if (value == null) return '';\n if (typeof value === 'object') {\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n }\n return String(value);\n }\n\n private parseSnapshot(json: string | null | undefined): Record<string, unknown> | null {\n if (!json) return null;\n try {\n return JSON.parse(json) as Record<string, unknown>;\n } catch {\n return null;\n }\n }\n\n // ─── Display helpers (template) ─────────────────────────────────\n\n public formatTimestamp(date: Date | string | null): string {\n if (!date) return '';\n return new Intl.DateTimeFormat('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n hour12: true,\n }).format(new Date(date));\n }\n\n public getUserDisplay(user: string | null): string {\n if (!user) return 'Unknown';\n if (user.includes('@')) return user.split('@')[0];\n return user;\n }\n}\n","<mj-slide-panel\n [Mode]=\"'slide'\"\n [Title]=\"'Recycle Bin · ' + (EntityName || '')\"\n [Visible]=\"Visible\"\n [Resizable]=\"true\"\n [MinWidthPx]=\"480\"\n [MaxWidthRatio]=\"0.6\"\n (Closed)=\"OnClose()\">\n\n <div class=\"rb-container\">\n\n <!-- Header -->\n <div class=\"rb-header\">\n <div class=\"rb-header-icon\">\n <i class=\"fa-solid fa-trash-can-arrow-up\" aria-hidden=\"true\"></i>\n </div>\n <div class=\"rb-header-text\">\n <div class=\"rb-header-title\">Recycle Bin</div>\n @if (EntityName) {\n <div class=\"rb-header-subtitle\">{{ HeaderSubtitle }}</div>\n }\n </div>\n </div>\n\n <!-- No-permission state -->\n @if (!IsLoading && LoadError && !HasAccess) {\n <mj-empty-state\n Variant=\"warning\"\n Icon=\"fa-solid fa-lock\"\n Title=\"Access denied\"\n [Message]=\"LoadError\" />\n }\n\n <!-- Loading -->\n @if (IsLoading) {\n <mj-loading text=\"Loading deleted records...\" size=\"medium\"></mj-loading>\n }\n\n <!-- Generic error -->\n @if (!IsLoading && LoadError && HasAccess) {\n <mj-empty-state\n Variant=\"error\"\n Icon=\"fa-solid fa-triangle-exclamation\"\n Title=\"Could not load deleted records\"\n [Message]=\"LoadError\" />\n }\n\n <!-- Empty state -->\n @if (!IsLoading && !LoadError && HasAccess && Entries.length === 0) {\n <mj-empty-state\n Icon=\"fa-solid fa-trash-can\"\n Title=\"Recycle Bin is empty\"\n Message=\"No records have been deleted from this entity, or change tracking isn't enabled here.\" />\n }\n\n <!-- Entries -->\n @if (!IsLoading && !LoadError && Entries.length > 0) {\n <div class=\"rb-list\">\n @for (entry of Entries; track entry.RecordChange.ID) {\n <div class=\"rb-card\">\n <div class=\"rb-card-info\">\n <div class=\"rb-card-name\">{{ entry.DisplaySummary }}</div>\n @if (entry.SupportingFields.length > 0) {\n <div class=\"rb-card-fields\">\n @for (sf of entry.SupportingFields; track sf.Name) {\n <span class=\"rb-card-field\">\n <strong>{{ sf.DisplayName }}:</strong> {{ sf.Value }}\n </span>\n }\n </div>\n }\n <div class=\"rb-card-meta\">\n <i class=\"fa-solid fa-trash\" aria-hidden=\"true\"></i>\n Deleted {{ formatTimestamp(entry.RecordChange.ChangedAt) }}\n @if (entry.RecordChange.User) {\n by {{ getUserDisplay(entry.RecordChange.User) }}\n }\n </div>\n </div>\n <div class=\"rb-card-actions\">\n <button class=\"rb-btn rb-btn-restore\"\n [disabled]=\"!CanCreate\"\n [title]=\"CanCreate ? 'Re-create this record from its snapshot' : 'You do not have Create permission for this entity'\"\n (click)=\"OnRestoreClicked(entry)\"\n type=\"button\">\n <i class=\"fa-solid fa-rotate-left\" aria-hidden=\"true\"></i>\n Restore\n </button>\n </div>\n </div>\n }\n </div>\n }\n\n </div>\n\n <!-- Restore preview slide-in (reused from ng-record-changes) -->\n <mj-restore-preview-panel\n [Visible]=\"PreviewVisible\"\n [Mode]=\"'undelete'\"\n [RecordChange]=\"SelectedEntry?.RecordChange ?? null\"\n [EntityName]=\"EntityName\"\n (RestoreConfirmed)=\"OnPreviewConfirmed($event)\"\n (RestoreCancelled)=\"OnPreviewCancelled()\">\n </mj-restore-preview-panel>\n\n</mj-slide-panel>\n"]}
1
+ {"version":3,"file":"recycle-bin.component.js","sourceRoot":"","sources":["../../../src/lib/recycle-bin/recycle-bin.component.ts","../../../src/lib/recycle-bin/recycle-bin.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,uBAAuB,EAEvB,YAAY,EACZ,KAAK,EAEL,MAAM,EACN,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAIL,OAAO,GAER,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;;;;;;;ICC3D,8BAAgC;IAAA,YAAoB;IAAA,iBAAM;;;IAA1B,cAAoB;IAApB,2CAAoB;;;IAOxD,oCAI0B;;;IAAxB,0CAAqB;;;IAKvB,gCAAyE;;;IAKzE,qCAI0B;;;IAAxB,0CAAqB;;;IAKvB,qCAGoG;;;IAcpF,AADF,gCAA4B,aAClB;IAAA,YAAqB;IAAA,iBAAS;IAAC,YACzC;IAAA,iBAAO;;;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kBAUpC,KAAK;;kBAeL,KAAK;;kBAML,KAAK;;kBAQL,KAAK;;kBAKL,MAAM;;kBAON,MAAM;;kBAGN,MAAM;;kBAQN,MAAM;;kBAMN,MAAM;;kBAON,MAAM;;kBAGN,MAAM;;kFA5EI,mBAAmB","sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n EntityFieldInfo,\n EntityInfo,\n Metadata,\n RunView,\n UserInfo,\n} from '@memberjunction/core';\nimport { MJRecordChangeEntity } from '@memberjunction/core-entities';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { RestoreCommitEvent } from '@memberjunction/ng-record-changes';\nimport {\n AfterRecordRestoreEventArgs,\n AfterRecycleBinOpenEventArgs,\n AfterRestoreCommitEventArgs,\n BeforeRecordRestoreEventArgs,\n BeforeRecycleBinOpenEventArgs,\n BeforeRestoreCommitEventArgs,\n RecycleBinEntry,\n} from './events/recycle-bin-events';\n\n/**\n * Slide-in panel that lists all hard-deleted records for a single entity\n * and lets a user with `Delete` permission re-create any of them from its\n * historical RecordChange snapshot.\n *\n * ### When to use\n *\n * Surface this component from any entity-viewing context where the user\n * might need to restore a hard-deleted record. The {@link EntityViewerComponent},\n * {@link EntityDataGridComponent}, and {@link EntityCardsComponent}\n * already expose a `ShowRecycleBin` input (default `true`) that renders a\n * chip in their toolbar — you only need to use this component directly if\n * you're building a custom viewer.\n *\n * ### Permissions\n *\n * The chip / panel is gated on `entity.UserPermissions.CanDelete` —\n * rationale: there is no native \"undelete\" permission in MemberJunction,\n * but if a user has the higher-trust permission to *delete* records of an\n * entity, restoring deleted ones is well within scope. The actual\n * re-create action additionally requires `CanCreate`; without it the\n * Restore button on each card disables with a tooltip.\n *\n * ### Soft deletes vs hard deletes\n *\n * This component only surfaces *hard*-deleted records. Soft-deletes (e.g.,\n * `IsDeleted` flags, `Status='Inactive'`, etc.) leave the record visible\n * in normal entity views, so the standard Record Changes panel + restore\n * preview already handles them — no Recycle Bin needed.\n *\n * ### Cancelable Before/After event surface\n *\n * Every meaningful action emits a paired `before*` / `after*` event. The\n * `before*` event carries `cancel: boolean` so consumers can intercept\n * — useful for custom approval workflows, audit logging, or to take over\n * the actual restore execution entirely. See {@link BeforeRecordRestoreEventArgs}\n * and friends.\n *\n * @example Basic usage (rare — usually embedded by entity-viewer)\n * <mj-recycle-bin\n * [Visible]=\"showBin\"\n * [EntityName]=\"'Customers'\"\n * (Closed)=\"showBin = false\"\n * (BeforeRecordRestore)=\"auditRestore($event)\"\n * (AfterRestoreCommit)=\"onRestored($event)\">\n * </mj-recycle-bin>\n *\n * @example Intercepting a restore\n * onBeforeRecordRestore(e: BeforeRecordRestoreEventArgs) {\n * if (!myCustomApproval(e.entry)) {\n * e.cancel = true;\n * e.cancelReason = 'Awaiting compliance approval';\n * }\n * }\n */\n@Component({\n standalone: false,\n selector: 'mj-recycle-bin',\n templateUrl: './recycle-bin.component.html',\n styleUrls: ['./recycle-bin.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class RecycleBinComponent extends BaseAngularComponent implements OnInit {\n // ─── Inputs ─────────────────────────────────────────────────────\n\n /**\n * Controls panel visibility. Set to true to slide in (and trigger an\n * initial load); false to slide out.\n */\n private _visible = false;\n @Input()\n set Visible(value: boolean) {\n const wasVisible = this._visible;\n this._visible = value;\n if (value && !wasVisible && this.isInitialized) {\n this.LoadDeletedRecords();\n }\n }\n get Visible(): boolean {\n return this._visible;\n }\n\n /**\n * The name of the entity whose deleted records will be listed. Required.\n */\n @Input() EntityName: string | null = null;\n\n /**\n * Optional context user. When omitted, falls back to\n * {@link this.ProviderToUse.CurrentUser} per standard MJ conventions.\n */\n @Input() ContextUser: UserInfo | null = null;\n\n /**\n * Maximum number of deleted-record cards to load. Defaults to 200 — this\n * is a UI affordance, not a hard limit; consumers needing pagination\n * should listen to {@link AfterRecycleBinOpen} and surface their own UI\n * if `deletedRecordCount === MaxRecords`.\n */\n @Input() MaxRecords = 200;\n\n // ─── Outputs ────────────────────────────────────────────────────\n\n /** Fires when the user closes the panel. */\n @Output() Closed = new EventEmitter<void>();\n\n /**\n * Cancelable. Fires when {@link Visible} flips to true and the bin is\n * about to query for deleted records. Setting `cancel = true` aborts\n * the query (and the panel will show the empty state).\n */\n @Output() BeforeRecycleBinOpen = new EventEmitter<BeforeRecycleBinOpenEventArgs>();\n\n /** Fires after the deleted-record query completes. */\n @Output() AfterRecycleBinOpen = new EventEmitter<AfterRecycleBinOpenEventArgs>();\n\n /**\n * Cancelable. Fires when the user clicks Restore on a deleted-record\n * card, before the preview panel opens. Setting `cancel = true` skips\n * the preview entirely — useful for consumers that want to take over\n * the restore flow themselves.\n */\n @Output() BeforeRecordRestore = new EventEmitter<BeforeRecordRestoreEventArgs>();\n\n /**\n * Fires after the user closes the restore preview, with `success`\n * indicating whether the actual insert worked.\n */\n @Output() AfterRecordRestore = new EventEmitter<AfterRecordRestoreEventArgs>();\n\n /**\n * Cancelable. Fires after the user clicks Restore in the preview but\n * before the entity is inserted. Setting `cancel = true` aborts the\n * insert.\n */\n @Output() BeforeRestoreCommit = new EventEmitter<BeforeRestoreCommitEventArgs>();\n\n /** Fires after the insert completes (success or failure). */\n @Output() AfterRestoreCommit = new EventEmitter<AfterRestoreCommitEventArgs>();\n\n // ─── Public template state ──────────────────────────────────────\n\n public IsLoading = false;\n public LoadError: string | null = null;\n public Entries: RecycleBinEntry[] = [];\n\n /** The currently selected entry whose preview is open. */\n public SelectedEntry: RecycleBinEntry | null = null;\n public PreviewVisible = false;\n\n /** Permission flags (computed once when EntityName is set). */\n public CanDelete = false;\n public CanCreate = false;\n\n private isInitialized = false;\n private resolvedEntityInfo: EntityInfo | null = null;\n\n constructor(private cdr: ChangeDetectorRef) {\n super();}\n\n ngOnInit(): void {\n this.isInitialized = true;\n if (this.Visible) this.LoadDeletedRecords();\n }\n\n // ─── Derived state ──────────────────────────────────────────────\n\n public get HeaderSubtitle(): string {\n if (!this.EntityName) return '';\n const n = this.Entries.length;\n return `${n} record${n === 1 ? '' : 's'} have been deleted from ${this.EntityName}.`;\n }\n\n /**\n * The user has Delete permission and may browse the bin. The Restore\n * button on each card additionally requires {@link CanCreate}.\n */\n public get HasAccess(): boolean {\n return this.CanDelete;\n }\n\n // ─── Public actions ─────────────────────────────────────────────\n\n /**\n * Manually trigger a re-load — useful for consumers who want to refresh\n * after some external event (e.g., a delete happened and they want the\n * bin to re-populate immediately).\n */\n public async LoadDeletedRecords(): Promise<void> {\n if (!this.EntityName) {\n this.LoadError = 'EntityName is required';\n return;\n }\n\n // Resolve metadata + permissions\n const md = this.ProviderToUse;\n const entityInfo = md.Entities.find(\n e => e.Name.trim().toLowerCase() === this.EntityName!.trim().toLowerCase(),\n );\n if (!entityInfo) {\n this.LoadError = `Entity '${this.EntityName}' not found`;\n this.cdr.markForCheck();\n return;\n }\n this.resolvedEntityInfo = entityInfo;\n const effectiveUser = this.ContextUser ?? md.CurrentUser;\n if (effectiveUser) {\n const perms = entityInfo.GetUserPermisions(effectiveUser);\n this.CanDelete = perms?.CanDelete ?? false;\n this.CanCreate = perms?.CanCreate ?? false;\n } else {\n this.CanDelete = false;\n this.CanCreate = false;\n }\n\n if (!this.CanDelete) {\n this.Entries = [];\n this.LoadError = 'You do not have Delete permission for this entity.';\n this.cdr.markForCheck();\n return;\n }\n\n // Fire BeforeRecycleBinOpen — consumer may cancel\n const beforeArgs: BeforeRecycleBinOpenEventArgs = {\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName,\n cancel: false,\n _kind: 'beforeRecycleBinOpen',\n };\n this.BeforeRecycleBinOpen.emit(beforeArgs);\n if (beforeArgs.cancel) {\n this.LoadError = beforeArgs.cancelReason ?? 'Cancelled by host';\n this.cdr.markForCheck();\n return;\n }\n\n this.IsLoading = true;\n this.LoadError = null;\n this.Entries = [];\n this.cdr.markForCheck();\n\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n // Get the most recent Delete change per RecordID. We over-fetch and\n // dedupe in JS — the data is small and SQL grouping with the latest\n // change per ID is awkward across dialects.\n const result = await rv.RunView<MJRecordChangeEntity>(\n {\n EntityName: 'MJ: Record Changes',\n ExtraFilter: `EntityID='${entityInfo.ID}' AND Type='Delete'`,\n OrderBy: 'ChangedAt DESC',\n MaxRows: this.MaxRecords * 2, // dedupe headroom\n ResultType: 'entity_object',\n },\n this.ContextUser ?? undefined,\n );\n\n if (!result.Success) {\n this.LoadError = result.ErrorMessage || 'Failed to load deleted records';\n } else {\n this.Entries = this.dedupeAndBuildEntries(result.Results, entityInfo);\n }\n } catch (e) {\n this.LoadError = e instanceof Error ? e.message : 'Unknown error';\n } finally {\n this.IsLoading = false;\n this.cdr.markForCheck();\n }\n\n // Fire AfterRecycleBinOpen\n this.AfterRecycleBinOpen.emit({\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName,\n deletedRecordCount: this.Entries.length,\n _kind: 'afterRecycleBinOpen',\n });\n }\n\n /**\n * User clicked Restore on a card — open the preview panel (unless a\n * BeforeRecordRestore handler cancelled).\n */\n public OnRestoreClicked(entry: RecycleBinEntry): void {\n if (!this.CanCreate) return; // gated in template too\n\n const beforeArgs: BeforeRecordRestoreEventArgs = {\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName ?? '',\n entry,\n cancel: false,\n _kind: 'beforeRecordRestore',\n };\n this.BeforeRecordRestore.emit(beforeArgs);\n if (beforeArgs.cancel) return;\n\n this.SelectedEntry = entry;\n this.PreviewVisible = true;\n this.cdr.markForCheck();\n }\n\n /**\n * Preview panel emitted RestoreConfirmed — perform the insert and emit\n * the matching after* events.\n */\n public async OnPreviewConfirmed(commit: RestoreCommitEvent): Promise<void> {\n if (!this.SelectedEntry || !this.resolvedEntityInfo) return;\n const entry = this.SelectedEntry;\n\n const beforeArgs: BeforeRestoreCommitEventArgs = {\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName ?? '',\n entry,\n fieldValues: commit.FieldValues,\n reason: commit.Reason,\n cancel: false,\n _kind: 'beforeRestoreCommit',\n };\n this.BeforeRestoreCommit.emit(beforeArgs);\n if (beforeArgs.cancel) {\n this.PreviewVisible = false;\n this.cdr.markForCheck();\n return;\n }\n\n let success = false;\n let errorMessage: string | undefined;\n let newRecordID: string | undefined;\n\n try {\n const md = this.ProviderToUse;\n const entity = await md.GetEntityObject(this.resolvedEntityInfo.Name, this.ContextUser ?? undefined);\n\n // Apply the snapshot fields, including the original primary key\n // (preserves any FK references that still point at this ID).\n for (const fv of commit.FieldValues) {\n entity.Set(fv.FieldName, fv.Value);\n }\n // Also re-apply the original primary key from the snapshot so dangling\n // FK references continue to work. Set() on a fresh entity treats this\n // as the new record's PK.\n try {\n const snapshotData = JSON.parse(entry.RecordChange.FullRecordJSON || '{}');\n for (const pk of this.resolvedEntityInfo.PrimaryKeys) {\n if (snapshotData[pk.Name] != null) {\n entity.Set(pk.Name, snapshotData[pk.Name]);\n }\n }\n } catch {\n // PK preservation is best-effort\n }\n\n entity.SetRestoreContext(commit.SourceChangeID, commit.Reason);\n\n try {\n success = await entity.Save();\n if (success) {\n newRecordID = entity.PrimaryKey.ToString();\n } else {\n errorMessage = entity.LatestResult?.CompleteMessage ?? 'Save returned false';\n }\n } finally {\n entity.ClearRestoreContext();\n }\n } catch (e) {\n success = false;\n errorMessage = e instanceof Error ? e.message : 'Unknown error';\n }\n\n this.AfterRestoreCommit.emit({\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName ?? '',\n entry,\n success,\n newRecordID,\n errorMessage,\n _kind: 'afterRestoreCommit',\n });\n\n this.AfterRecordRestore.emit({\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName ?? '',\n entry,\n success,\n errorMessage,\n _kind: 'afterRecordRestore',\n });\n\n if (success) {\n // Remove the restored entry from the list and close preview\n this.Entries = this.Entries.filter(e => e !== entry);\n }\n this.PreviewVisible = false;\n this.SelectedEntry = null;\n this.cdr.markForCheck();\n }\n\n public OnPreviewCancelled(): void {\n this.PreviewVisible = false;\n this.SelectedEntry = null;\n this.cdr.markForCheck();\n }\n\n public OnClose(): void {\n this._visible = false;\n this.cdr.markForCheck();\n this.Closed.emit();\n }\n\n // ─── Internal: build entries from raw RecordChange rows ─────────\n\n /**\n * Dedupes the raw delete-change rows: keeps only the most recent Delete\n * per RecordID (since a record could in principle have been recreated\n * and re-deleted). Builds the display fields heuristically by reading\n * the snapshot JSON.\n */\n private dedupeAndBuildEntries(\n rows: MJRecordChangeEntity[],\n entityInfo: EntityInfo,\n ): RecycleBinEntry[] {\n const seen = new Set<string>();\n const entries: RecycleBinEntry[] = [];\n\n for (const row of rows) {\n if (entries.length >= this.MaxRecords) break;\n if (seen.has(row.RecordID)) continue;\n seen.add(row.RecordID);\n\n const snapshot = this.parseSnapshot(row.FullRecordJSON);\n if (!snapshot) continue;\n\n const entry: RecycleBinEntry = {\n RecordChange: row,\n RecordID: row.RecordID,\n DisplaySummary: this.buildDisplaySummary(snapshot, entityInfo),\n SupportingFields: this.buildSupportingFields(snapshot, entityInfo),\n };\n entries.push(entry);\n }\n\n return entries;\n }\n\n /**\n * Builds the headline of the card. Prefers the entity's name field, then\n * any non-PK string field, then the RecordID itself as a last resort.\n */\n private buildDisplaySummary(snapshot: Record<string, unknown>, entityInfo: EntityInfo): string {\n const nameField = entityInfo.NameField;\n if (nameField && snapshot[nameField.Name] != null && snapshot[nameField.Name] !== '') {\n return String(snapshot[nameField.Name]);\n }\n // Fallback: first non-PK, non-empty string field\n for (const f of entityInfo.Fields) {\n if (f.IsPrimaryKey) continue;\n const v = snapshot[f.Name];\n if (typeof v === 'string' && v.trim().length > 0) return v;\n }\n // Last resort: every primary-key column's value (the entity is arbitrary and may be composite-keyed)\n const keyValues = entityInfo.PrimaryKeys\n .map((pk) => snapshot[pk.Name])\n .filter((v) => v != null && v !== '')\n .map((v) => String(v));\n return `Record ${keyValues.join(', ')}`;\n }\n\n /**\n * Picks up to 3 \"interesting\" fields from the snapshot to render as\n * supporting metadata under the headline. Heuristic: prefer fields that\n * are non-empty, non-PK, non-system, and have a display name.\n */\n private buildSupportingFields(\n snapshot: Record<string, unknown>,\n entityInfo: EntityInfo,\n ): Array<{ Name: string; DisplayName: string; Value: string }> {\n const out: Array<{ Name: string; DisplayName: string; Value: string }> = [];\n const nameFieldName = entityInfo.NameField?.Name;\n\n for (const f of entityInfo.Fields) {\n if (out.length >= 3) break;\n if (f.IsPrimaryKey) continue;\n if (f.Name.startsWith('__mj_')) continue;\n if (f.Name === nameFieldName) continue;\n\n const v = snapshot[f.Name];\n if (v == null || v === '') continue;\n\n out.push({\n Name: f.Name,\n DisplayName: f.DisplayNameOrName,\n Value: this.formatFieldValue(v, f),\n });\n }\n return out;\n }\n\n private formatFieldValue(value: unknown, _field: EntityFieldInfo): string {\n if (value == null) return '';\n if (typeof value === 'object') {\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n }\n return String(value);\n }\n\n private parseSnapshot(json: string | null | undefined): Record<string, unknown> | null {\n if (!json) return null;\n try {\n return JSON.parse(json) as Record<string, unknown>;\n } catch {\n return null;\n }\n }\n\n // ─── Display helpers (template) ─────────────────────────────────\n\n public FormatTimestamp(date: Date | string | null): string {\n if (!date) return '';\n return new Intl.DateTimeFormat('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n hour12: true,\n }).format(new Date(date));\n }\n\n /** @deprecated Use {@link FormatTimestamp}. */\n public formatTimestamp(date: Date | string | null): string {\n return this.FormatTimestamp(date);\n }\n\n public GetUserDisplay(user: string | null): string {\n if (!user) return 'Unknown';\n if (user.includes('@')) return user.split('@')[0];\n return user;\n }\n\n /** @deprecated Use {@link GetUserDisplay}. */\n public getUserDisplay(user: string | null): string {\n return this.GetUserDisplay(user);\n }\n}\n","<mj-slide-panel\n [Mode]=\"'slide'\"\n [Title]=\"'Recycle Bin · ' + (EntityName || '')\"\n [Visible]=\"Visible\"\n [Resizable]=\"true\"\n [MinWidthPx]=\"480\"\n [MaxWidthRatio]=\"0.6\"\n (Closed)=\"OnClose()\">\n\n <div class=\"rb-container\">\n\n <!-- Header -->\n <div class=\"rb-header\">\n <div class=\"rb-header-icon\">\n <i class=\"fa-solid fa-trash-can-arrow-up\" aria-hidden=\"true\"></i>\n </div>\n <div class=\"rb-header-text\">\n <div class=\"rb-header-title\">Recycle Bin</div>\n @if (EntityName) {\n <div class=\"rb-header-subtitle\">{{ HeaderSubtitle }}</div>\n }\n </div>\n </div>\n\n <!-- No-permission state -->\n @if (!IsLoading && LoadError && !HasAccess) {\n <mj-empty-state\n Variant=\"warning\"\n Icon=\"fa-solid fa-lock\"\n Title=\"Access denied\"\n [Message]=\"LoadError\" />\n }\n\n <!-- Loading -->\n @if (IsLoading) {\n <mj-loading text=\"Loading deleted records...\" size=\"medium\"></mj-loading>\n }\n\n <!-- Generic error -->\n @if (!IsLoading && LoadError && HasAccess) {\n <mj-empty-state\n Variant=\"error\"\n Icon=\"fa-solid fa-triangle-exclamation\"\n Title=\"Could not load deleted records\"\n [Message]=\"LoadError\" />\n }\n\n <!-- Empty state -->\n @if (!IsLoading && !LoadError && HasAccess && Entries.length === 0) {\n <mj-empty-state\n Icon=\"fa-solid fa-trash-can\"\n Title=\"Recycle Bin is empty\"\n Message=\"No records have been deleted from this entity, or change tracking isn't enabled here.\" />\n }\n\n <!-- Entries -->\n @if (!IsLoading && !LoadError && Entries.length > 0) {\n <div class=\"rb-list\">\n @for (entry of Entries; track entry.RecordChange.ID) {\n <div class=\"rb-card\">\n <div class=\"rb-card-info\">\n <div class=\"rb-card-name\">{{ entry.DisplaySummary }}</div>\n @if (entry.SupportingFields.length > 0) {\n <div class=\"rb-card-fields\">\n @for (sf of entry.SupportingFields; track sf.Name) {\n <span class=\"rb-card-field\">\n <strong>{{ sf.DisplayName }}:</strong> {{ sf.Value }}\n </span>\n }\n </div>\n }\n <div class=\"rb-card-meta\">\n <i class=\"fa-solid fa-trash\" aria-hidden=\"true\"></i>\n Deleted {{ formatTimestamp(entry.RecordChange.ChangedAt) }}\n @if (entry.RecordChange.User) {\n by {{ getUserDisplay(entry.RecordChange.User) }}\n }\n </div>\n </div>\n <div class=\"rb-card-actions\">\n <button class=\"rb-btn rb-btn-restore\"\n [disabled]=\"!CanCreate\"\n [title]=\"CanCreate ? 'Re-create this record from its snapshot' : 'You do not have Create permission for this entity'\"\n (click)=\"OnRestoreClicked(entry)\"\n type=\"button\">\n <i class=\"fa-solid fa-rotate-left\" aria-hidden=\"true\"></i>\n Restore\n </button>\n </div>\n </div>\n }\n </div>\n }\n\n </div>\n\n <!-- Restore preview slide-in (reused from ng-record-changes) -->\n <mj-restore-preview-panel\n [Visible]=\"PreviewVisible\"\n [Mode]=\"'undelete'\"\n [RecordChange]=\"SelectedEntry?.RecordChange ?? null\"\n [EntityName]=\"EntityName\"\n (RestoreConfirmed)=\"OnPreviewConfirmed($event)\"\n (RestoreCancelled)=\"OnPreviewCancelled()\">\n </mj-restore-preview-panel>\n\n</mj-slide-panel>\n"]}
@@ -0,0 +1,21 @@
1
+ import type { EntityInfo, EntityFieldInfo } from '@memberjunction/core';
2
+ import type { MJUserViewEntity_IGridAggregate as ViewGridAggregate } from '@memberjunction/core-entities';
3
+ /**
4
+ * The one column an aggregate summarises, or null when it summarises anything more complex.
5
+ *
6
+ * An aggregate carries an expression and a value, never field metadata, so the column has to be
7
+ * read out of the expression: `MIN(IntakeDate)` and `MAX([Intake Date])` name one column, while
8
+ * `COUNT(*)`, `SUM(Amount) + 1` and `MIN(YEAR(IntakeDate))` do not. When the expression gives
9
+ * nothing, the column the aggregate is pinned under is the fallback.
10
+ *
11
+ * Parsed positionally rather than with a pattern: a regular expression over user-authored text is
12
+ * where backtracking blow-ups live (CodeQL js/polynomial-redos).
13
+ */
14
+ export declare function AggregateFieldName(agg: Pick<ViewGridAggregate, 'expression' | 'column'>): string | null;
15
+ /**
16
+ * The entity field an aggregate summarises, or null when it cannot be resolved. Resolving the
17
+ * field is what lets a display path tell a `date` column (a calendar day) from a timestamp (an
18
+ * instant) and render each in the right zone.
19
+ */
20
+ export declare function AggregateField(agg: Pick<ViewGridAggregate, 'expression' | 'column'>, entity: EntityInfo | null | undefined): EntityFieldInfo | null;
21
+ //# sourceMappingURL=aggregate-field.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregate-field.util.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/aggregate-field.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,KAAK,EAAE,+BAA+B,IAAI,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAE1G;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,IAAI,CAAC,iBAAiB,EAAE,YAAY,GAAG,QAAQ,CAAC,GAAG,MAAM,GAAG,IAAI,CAEvG;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,iBAAiB,EAAE,YAAY,GAAG,QAAQ,CAAC,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,GAAG,eAAe,GAAG,IAAI,CAInJ"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The one column an aggregate summarises, or null when it summarises anything more complex.
3
+ *
4
+ * An aggregate carries an expression and a value, never field metadata, so the column has to be
5
+ * read out of the expression: `MIN(IntakeDate)` and `MAX([Intake Date])` name one column, while
6
+ * `COUNT(*)`, `SUM(Amount) + 1` and `MIN(YEAR(IntakeDate))` do not. When the expression gives
7
+ * nothing, the column the aggregate is pinned under is the fallback.
8
+ *
9
+ * Parsed positionally rather than with a pattern: a regular expression over user-authored text is
10
+ * where backtracking blow-ups live (CodeQL js/polynomial-redos).
11
+ */
12
+ export function AggregateFieldName(agg) {
13
+ return singleFieldOfExpression(agg.expression) ?? agg.column ?? null;
14
+ }
15
+ /**
16
+ * The entity field an aggregate summarises, or null when it cannot be resolved. Resolving the
17
+ * field is what lets a display path tell a `date` column (a calendar day) from a timestamp (an
18
+ * instant) and render each in the right zone.
19
+ */
20
+ export function AggregateField(agg, entity) {
21
+ const name = AggregateFieldName(agg);
22
+ if (!name || !entity)
23
+ return null;
24
+ return entity.Fields.find(f => f.Name === name) ?? null;
25
+ }
26
+ function singleFieldOfExpression(expression) {
27
+ const text = (expression ?? '').trim();
28
+ const open = text.indexOf('(');
29
+ if (open <= 0 || !text.endsWith(')') || text.indexOf(')') !== text.length - 1)
30
+ return null;
31
+ if (!/^\w+$/.test(text.substring(0, open).trim()))
32
+ return null;
33
+ let inner = text.substring(open + 1, text.length - 1).trim();
34
+ if (inner.startsWith('[') && inner.endsWith(']'))
35
+ inner = inner.substring(1, inner.length - 1).trim();
36
+ if (inner.length === 0 || inner === '*' || inner.includes('(') || inner.includes(','))
37
+ return null;
38
+ return inner;
39
+ }
40
+ //# sourceMappingURL=aggregate-field.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregate-field.util.js","sourceRoot":"","sources":["../../../src/lib/utils/aggregate-field.util.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAqD;IACpF,OAAO,uBAAuB,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,MAAM,IAAI,IAAI,CAAC;AACzE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,GAAqD,EAAE,MAAqC;IACvH,MAAM,IAAI,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAClC,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,IAAI,CAAC;AAC5D,CAAC;AAED,SAAS,uBAAuB,CAAC,UAA8B;IAC3D,MAAM,IAAI,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACvC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3F,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC;IAC/D,IAAI,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC7D,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACtG,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACnG,OAAO,KAAK,CAAC;AACjB,CAAC","sourcesContent":["import type { EntityInfo, EntityFieldInfo } from '@memberjunction/core';\nimport type { MJUserViewEntity_IGridAggregate as ViewGridAggregate } from '@memberjunction/core-entities';\n\n/**\n * The one column an aggregate summarises, or null when it summarises anything more complex.\n *\n * An aggregate carries an expression and a value, never field metadata, so the column has to be\n * read out of the expression: `MIN(IntakeDate)` and `MAX([Intake Date])` name one column, while\n * `COUNT(*)`, `SUM(Amount) + 1` and `MIN(YEAR(IntakeDate))` do not. When the expression gives\n * nothing, the column the aggregate is pinned under is the fallback.\n *\n * Parsed positionally rather than with a pattern: a regular expression over user-authored text is\n * where backtracking blow-ups live (CodeQL js/polynomial-redos).\n */\nexport function AggregateFieldName(agg: Pick<ViewGridAggregate, 'expression' | 'column'>): string | null {\n return singleFieldOfExpression(agg.expression) ?? agg.column ?? null;\n}\n\n/**\n * The entity field an aggregate summarises, or null when it cannot be resolved. Resolving the\n * field is what lets a display path tell a `date` column (a calendar day) from a timestamp (an\n * instant) and render each in the right zone.\n */\nexport function AggregateField(agg: Pick<ViewGridAggregate, 'expression' | 'column'>, entity: EntityInfo | null | undefined): EntityFieldInfo | null {\n const name = AggregateFieldName(agg);\n if (!name || !entity) return null;\n return entity.Fields.find(f => f.Name === name) ?? null;\n}\n\nfunction singleFieldOfExpression(expression: string | undefined): string | null {\n const text = (expression ?? '').trim();\n const open = text.indexOf('(');\n if (open <= 0 || !text.endsWith(')') || text.indexOf(')') !== text.length - 1) return null;\n if (!/^\\w+$/.test(text.substring(0, open).trim())) return null;\n let inner = text.substring(open + 1, text.length - 1).trim();\n if (inner.startsWith('[') && inner.endsWith(']')) inner = inner.substring(1, inner.length - 1).trim();\n if (inner.length === 0 || inner === '*' || inner.includes('(') || inner.includes(',')) return null;\n return inner;\n}\n"]}
@@ -19,6 +19,8 @@ export declare class HighlightUtil {
19
19
  * @param searchTerm The search term (may include % wildcards)
20
20
  * @returns true if the value matches the search pattern
21
21
  */
22
+ static Matches(value: string, searchTerm: string): boolean;
23
+ /** @deprecated Use {@link Matches}. */
22
24
  static matches(value: string, searchTerm: string): boolean;
23
25
  /**
24
26
  * Highlight matching text in a string based on the filter text.
@@ -30,6 +32,8 @@ export declare class HighlightUtil {
30
32
  * @param escapeHtml Whether to escape HTML characters (default: true)
31
33
  * @returns HTML string with highlighted matches, or the original text if no match
32
34
  */
35
+ static Highlight(text: string, searchTerm: string, escapeHtml?: boolean): string;
36
+ /** @deprecated Use {@link Highlight}. */
33
37
  static highlight(text: string, searchTerm: string, escapeHtml?: boolean): string;
34
38
  /**
35
39
  * Highlight a simple (non-wildcard) search term
@@ -64,6 +68,8 @@ export declare class HighlightUtil {
64
68
  /**
65
69
  * Escape HTML special characters to prevent XSS
66
70
  */
71
+ static EscapeHtml(text: string): string;
72
+ /** @deprecated Use {@link EscapeHtml}. */
67
73
  static escapeHtml(text: string): string;
68
74
  }
69
75
  //# sourceMappingURL=highlight.util.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"highlight.util.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/highlight.util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,qBAAa,aAAa;IACxB;;;;;;;OAOG;IACH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO;IAgC1D;;;;;;;;;OASG;IACH,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAE,OAAc,GAAG,MAAM;IAwBtF;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAa9B;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAgBhC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAkBjC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAmBxC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAmBrC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAyBrC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IAI1B;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAcxC"}
1
+ {"version":3,"file":"highlight.util.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/highlight.util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,qBAAa,aAAa;IACxB;;;;;;;OAOG;IACH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO;IAgC1D,uCAAuC;IACvC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO;IAI1D;;;;;;;;;OASG;IACH,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAE,OAAc,GAAG,MAAM;IAwBtF,yCAAyC;IACzC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAE,OAAc,GAAG,MAAM;IAItF;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAa9B;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAgBhC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAkBjC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAmBxC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAmBrC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAyBrC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IAI1B;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAevC,0CAA0C;IAC1C,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAGxC"}
@@ -19,7 +19,7 @@ export class HighlightUtil {
19
19
  * @param searchTerm The search term (may include % wildcards)
20
20
  * @returns true if the value matches the search pattern
21
21
  */
22
- static matches(value, searchTerm) {
22
+ static Matches(value, searchTerm) {
23
23
  if (!value || !searchTerm)
24
24
  return false;
25
25
  const lowerValue = value.toLowerCase();
@@ -45,6 +45,10 @@ export class HighlightUtil {
45
45
  }
46
46
  return true;
47
47
  }
48
+ /** @deprecated Use {@link Matches}. */
49
+ static matches(value, searchTerm) {
50
+ return this.Matches(value, searchTerm);
51
+ }
48
52
  /**
49
53
  * Highlight matching text in a string based on the filter text.
50
54
  * IMPORTANT: Only highlights if the text actually matches the pattern.
@@ -55,17 +59,17 @@ export class HighlightUtil {
55
59
  * @param escapeHtml Whether to escape HTML characters (default: true)
56
60
  * @returns HTML string with highlighted matches, or the original text if no match
57
61
  */
58
- static highlight(text, searchTerm, escapeHtml = true) {
62
+ static Highlight(text, searchTerm, escapeHtml = true) {
59
63
  if (!text)
60
64
  return '';
61
65
  if (!searchTerm || searchTerm.trim() === '') {
62
- return escapeHtml ? this.escapeHtml(text) : text;
66
+ return escapeHtml ? this.EscapeHtml(text) : text;
63
67
  }
64
68
  const trimmedSearch = searchTerm.trim();
65
69
  // First check if this text actually matches the pattern
66
- if (!this.matches(text, trimmedSearch)) {
70
+ if (!this.Matches(text, trimmedSearch)) {
67
71
  // No match - return text without highlighting
68
- return escapeHtml ? this.escapeHtml(text) : text;
72
+ return escapeHtml ? this.EscapeHtml(text) : text;
69
73
  }
70
74
  // Text matches - now apply highlighting
71
75
  if (!trimmedSearch.includes('%')) {
@@ -75,6 +79,10 @@ export class HighlightUtil {
75
79
  // Wildcard case: highlight each segment that appears in order
76
80
  return this.highlightWildcard(text, trimmedSearch, escapeHtml);
77
81
  }
82
+ /** @deprecated Use {@link Highlight}. */
83
+ static highlight(text, searchTerm, escapeHtml = true) {
84
+ return this.Highlight(text, searchTerm, escapeHtml);
85
+ }
78
86
  /**
79
87
  * Highlight a simple (non-wildcard) search term
80
88
  */
@@ -97,12 +105,12 @@ export class HighlightUtil {
97
105
  static highlightWildcard(text, searchTerm, escapeHtml) {
98
106
  const segments = searchTerm.split('%').filter(s => s.length > 0);
99
107
  if (segments.length === 0) {
100
- return escapeHtml ? this.escapeHtml(text) : text;
108
+ return escapeHtml ? this.EscapeHtml(text) : text;
101
109
  }
102
110
  // Find positions of each segment in order (only the first occurrence that maintains order)
103
111
  const matches = this.findOrderedMatchPositions(text, segments);
104
112
  if (matches.length === 0) {
105
- return escapeHtml ? this.escapeHtml(text) : text;
113
+ return escapeHtml ? this.EscapeHtml(text) : text;
106
114
  }
107
115
  return this.buildHighlightedString(text, matches, escapeHtml);
108
116
  }
@@ -174,17 +182,17 @@ export class HighlightUtil {
174
182
  for (const range of ranges) {
175
183
  // Add text before this match
176
184
  const before = text.substring(lastEnd, range.start);
177
- result += escapeHtml ? this.escapeHtml(before) : before;
185
+ result += escapeHtml ? this.EscapeHtml(before) : before;
178
186
  // Add highlighted match
179
187
  const match = text.substring(range.start, range.end);
180
188
  result += '<span class="highlight-match">';
181
- result += escapeHtml ? this.escapeHtml(match) : match;
189
+ result += escapeHtml ? this.EscapeHtml(match) : match;
182
190
  result += '</span>';
183
191
  lastEnd = range.end;
184
192
  }
185
193
  // Add remaining text
186
194
  const remaining = text.substring(lastEnd);
187
- result += escapeHtml ? this.escapeHtml(remaining) : remaining;
195
+ result += escapeHtml ? this.EscapeHtml(remaining) : remaining;
188
196
  return result;
189
197
  }
190
198
  /**
@@ -196,7 +204,7 @@ export class HighlightUtil {
196
204
  /**
197
205
  * Escape HTML special characters to prevent XSS
198
206
  */
199
- static escapeHtml(text) {
207
+ static EscapeHtml(text) {
200
208
  if (typeof document !== 'undefined') {
201
209
  const div = document.createElement('div');
202
210
  div.textContent = text;
@@ -210,5 +218,9 @@ export class HighlightUtil {
210
218
  .replace(/"/g, '&quot;')
211
219
  .replace(/'/g, '&#039;');
212
220
  }
221
+ /** @deprecated Use {@link EscapeHtml}. */
222
+ static escapeHtml(text) {
223
+ return this.EscapeHtml(text);
224
+ }
213
225
  }
214
226
  //# sourceMappingURL=highlight.util.js.map