@memberjunction/ng-entity-viewer 6.2.0-edge.0 → 6.2.0-edge.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/lib/aggregate-setup-dialog/aggregate-setup-dialog.component.d.ts +22 -0
  2. package/dist/lib/aggregate-setup-dialog/aggregate-setup-dialog.component.d.ts.map +1 -1
  3. package/dist/lib/aggregate-setup-dialog/aggregate-setup-dialog.component.js +57 -13
  4. package/dist/lib/aggregate-setup-dialog/aggregate-setup-dialog.component.js.map +1 -1
  5. package/dist/lib/entity-cards/entity-cards.component.d.ts +67 -5
  6. package/dist/lib/entity-cards/entity-cards.component.d.ts.map +1 -1
  7. package/dist/lib/entity-cards/entity-cards.component.js +202 -71
  8. package/dist/lib/entity-cards/entity-cards.component.js.map +1 -1
  9. package/dist/lib/entity-data-grid/entity-data-grid.component.d.ts +159 -20
  10. package/dist/lib/entity-data-grid/entity-data-grid.component.d.ts.map +1 -1
  11. package/dist/lib/entity-data-grid/entity-data-grid.component.js +446 -167
  12. package/dist/lib/entity-data-grid/entity-data-grid.component.js.map +1 -1
  13. package/dist/lib/entity-data-grid/events/grid-events.js +67 -67
  14. package/dist/lib/entity-data-grid/events/grid-events.js.map +1 -1
  15. package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.d.ts +112 -8
  16. package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.d.ts.map +1 -1
  17. package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.js +245 -61
  18. package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.js.map +1 -1
  19. package/dist/lib/entity-viewer/entity-viewer.component.d.ts +13 -0
  20. package/dist/lib/entity-viewer/entity-viewer.component.d.ts.map +1 -1
  21. package/dist/lib/entity-viewer/entity-viewer.component.js +53 -10
  22. package/dist/lib/entity-viewer/entity-viewer.component.js.map +1 -1
  23. package/dist/lib/pill/pill.component.d.ts +13 -3
  24. package/dist/lib/pill/pill.component.d.ts.map +1 -1
  25. package/dist/lib/pill/pill.component.js +34 -10
  26. package/dist/lib/pill/pill.component.js.map +1 -1
  27. package/dist/lib/quick-save-dialog/quick-save-dialog.component.d.ts +29 -3
  28. package/dist/lib/quick-save-dialog/quick-save-dialog.component.d.ts.map +1 -1
  29. package/dist/lib/quick-save-dialog/quick-save-dialog.component.js +173 -114
  30. package/dist/lib/quick-save-dialog/quick-save-dialog.component.js.map +1 -1
  31. package/dist/lib/recycle-bin/recycle-bin.component.d.ts +4 -0
  32. package/dist/lib/recycle-bin/recycle-bin.component.d.ts.map +1 -1
  33. package/dist/lib/recycle-bin/recycle-bin.component.js +10 -2
  34. package/dist/lib/recycle-bin/recycle-bin.component.js.map +1 -1
  35. package/dist/lib/utils/export-column.util.d.ts +14 -0
  36. package/dist/lib/utils/export-column.util.d.ts.map +1 -0
  37. package/dist/lib/utils/export-column.util.js +34 -0
  38. package/dist/lib/utils/export-column.util.js.map +1 -0
  39. package/dist/lib/utils/highlight.util.d.ts +6 -0
  40. package/dist/lib/utils/highlight.util.d.ts.map +1 -1
  41. package/dist/lib/utils/highlight.util.js +23 -11
  42. package/dist/lib/utils/highlight.util.js.map +1 -1
  43. package/dist/lib/utils/record.util.d.ts +10 -0
  44. package/dist/lib/utils/record.util.d.ts.map +1 -1
  45. package/dist/lib/utils/record.util.js +20 -4
  46. package/dist/lib/utils/record.util.js.map +1 -1
  47. package/dist/lib/view-config-panel/view-config-panel.component.d.ts +17 -1
  48. package/dist/lib/view-config-panel/view-config-panel.component.d.ts.map +1 -1
  49. package/dist/lib/view-config-panel/view-config-panel.component.js +39 -6
  50. package/dist/lib/view-config-panel/view-config-panel.component.js.map +1 -1
  51. package/dist/lib/view-selector/view-selector.component.js +2 -2
  52. package/dist/lib/view-types/renderers/cards-view-renderer.component.d.ts +15 -3
  53. package/dist/lib/view-types/renderers/cards-view-renderer.component.d.ts.map +1 -1
  54. package/dist/lib/view-types/renderers/cards-view-renderer.component.js +33 -5
  55. package/dist/lib/view-types/renderers/cards-view-renderer.component.js.map +1 -1
  56. package/dist/lib/view-types/renderers/grid-view-renderer.component.d.ts +70 -2
  57. package/dist/lib/view-types/renderers/grid-view-renderer.component.d.ts.map +1 -1
  58. package/dist/lib/view-types/renderers/grid-view-renderer.component.js +155 -33
  59. package/dist/lib/view-types/renderers/grid-view-renderer.component.js.map +1 -1
  60. package/dist/lib/view-types/renderers/map-view-renderer.component.d.ts +16 -2
  61. package/dist/lib/view-types/renderers/map-view-renderer.component.d.ts.map +1 -1
  62. package/dist/lib/view-types/renderers/map-view-renderer.component.js +37 -9
  63. package/dist/lib/view-types/renderers/map-view-renderer.component.js.map +1 -1
  64. package/dist/lib/view-types/renderers/timeline-view-renderer.component.d.ts +2 -0
  65. package/dist/lib/view-types/renderers/timeline-view-renderer.component.d.ts.map +1 -1
  66. package/dist/lib/view-types/renderers/timeline-view-renderer.component.js +11 -2
  67. package/dist/lib/view-types/renderers/timeline-view-renderer.component.js.map +1 -1
  68. package/dist/lib/view-types/view-type.contracts.d.ts +8 -0
  69. package/dist/lib/view-types/view-type.contracts.d.ts.map +1 -1
  70. package/dist/lib/view-types/view-type.contracts.js.map +1 -1
  71. package/dist/lib/view-workspace/view-workspace.component.d.ts +244 -25
  72. package/dist/lib/view-workspace/view-workspace.component.d.ts.map +1 -1
  73. package/dist/lib/view-workspace/view-workspace.component.js +639 -182
  74. package/dist/lib/view-workspace/view-workspace.component.js.map +1 -1
  75. package/dist/public-api.d.ts +1 -0
  76. package/dist/public-api.d.ts.map +1 -1
  77. package/dist/public-api.js +1 -0
  78. package/dist/public-api.js.map +1 -1
  79. package/package.json +21 -20
@@ -1 +1 @@
1
- {"version":3,"file":"timeline-view-renderer.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/view-types/renderers/timeline-view-renderer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,YAAY,EAEZ,MAAM,EAGP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UA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O,CAAC,oBAAoB;IA6C5B;;;OAGG;IACH,OAAO,CAAC,cAAc;IAuBtB,2EAA2E;IAC3E,OAAO,CAAC,oBAAoB;IAiB5B;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAwBzB,iGAAiG;IACjG,OAAO,CAAC,cAAc;yCAvZX,6BAA6B;2CAA7B,6BAA6B;CAgazC;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAG/C"}
1
+ {"version":3,"file":"timeline-view-renderer.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/view-types/renderers/timeline-view-renderer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,YAAY,EAEZ,MAAM,EAGP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,eAAe,EAAwC,MAAM,sBAAsB,CAAC;AAEzG,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;;AAEvD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,kBAAkB;IACjC,2FAA2F;IAC3F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,qEAAqE;IACrE,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,8EAA8E;IAC9E,eAAe,CAAC,EAAE,mBAAmB,CAAC;CACvC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAuKa,6BACX,SAAQ,oBACR,YAAW,aAAa,CAAC,kBAAkB,CAAC,EAAE,MAAM;IAMpD,OAAO,CAAC,OAAO,CAA2B;IAC1C,uGAAuG;IACvG,IACI,MAAM,CAAC,KAAK,EAAE,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,IAAI,CAa3C;IAMD,4FAA4F;IAC5F,yBAAyB,IAAI,IAAI;IAMjC,mGAAmG;IACnG,uBAAuB,IAAI,IAAI;IAM/B,4FAA4F;IAC5F,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAa7C;;;;OAIG;IACH,oBAAoB,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI;IAWtD;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;IAO1B,8EAA8E;IAC9E,OAAO,CAAC,gBAAgB;IAcxB;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAsBxB;;;OAGG;IACH,OAAO,CAAC,wBAAwB;IAMhC;;;OAGG;IACH,OAAO,CAAC,6BAA6B;IAcrC;;;;OAIG;IACH,OAAO,CAAC,oBAAoB;IAiD5B,6FAA6F;IAC7F,OAAO,CAAC,eAAe;IAKvB;;;OAGG;IACH,OAAO,CAAC,cAAc;IAuBtB,2EAA2E;IAC3E,OAAO,CAAC,oBAAoB;IAiB5B;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAwBzB,iGAAiG;IACjG,OAAO,CAAC,cAAc;yCAjaX,6BAA6B;2CAA7B,6BAA6B;CA0azC;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAG/C"}
@@ -1,5 +1,5 @@
1
1
  import { Component, Input, Output, EventEmitter, ChangeDetectorRef, ViewEncapsulation, inject, } from '@angular/core';
2
- import { EntityFieldTSType } from '@memberjunction/core';
2
+ import { EntityFieldTSType, IsDateOnlySQLType } from '@memberjunction/core';
3
3
  import { UUIDsEqual } from '@memberjunction/global';
4
4
  import { BaseAngularComponent } from '@memberjunction/ng-base-types';
5
5
  import { TimelineGroup, } from '@memberjunction/ng-timeline';
@@ -335,6 +335,9 @@ export class TimelineViewRendererComponent extends BaseAngularComponent {
335
335
  group.DateFieldName = this.SelectedTimelineDateField;
336
336
  group.IdFieldName = 'ID';
337
337
  group.GroupLabel = this._entity.Name;
338
+ // The records are plain `simple` rows with no EntityInfo of their own: the group needs the
339
+ // entity's metadata to know a SQL `date` field is a calendar day, not an instant.
340
+ group.EntityInfo = this._entity;
338
341
  const descField = this.findDescriptionField();
339
342
  if (descField) {
340
343
  group.DescriptionFieldName = descField;
@@ -348,13 +351,19 @@ export class TimelineViewRendererComponent extends BaseAngularComponent {
348
351
  collapsible: true,
349
352
  defaultExpanded: false,
350
353
  showDate: true,
351
- dateFormat: 'MMM d, yyyy h:mm a',
354
+ // A calendar day has no time: "12:00 AM" on it would be invented.
355
+ dateFormat: this.isDateOnlyField(this.SelectedTimelineDateField) ? 'MMM d, yyyy' : 'MMM d, yyyy h:mm a',
352
356
  ...(imageField
353
357
  ? { imageField, imagePosition: 'left', imageSize: 'small' }
354
358
  : {}),
355
359
  };
356
360
  this.TimelineGroups = [group];
357
361
  }
362
+ /** Whether the named field of the current entity is a SQL `date` column (a calendar day). */
363
+ isDateOnlyField(fieldName) {
364
+ const field = this._entity?.Fields.find((f) => f.Name.toLowerCase() === fieldName.toLowerCase());
365
+ return IsDateOnlySQLType(field?.Type);
366
+ }
358
367
  /**
359
368
  * Find the best field to use as the event title: the entity's NameField, then a
360
369
  * `DefaultInView` string field matching a common name pattern, then the first string field.
@@ -1 +1 @@
1
- {"version":3,"file":"timeline-view-renderer.component.js","sourceRoot":"","sources":["../../../../src/lib/view-types/renderers/timeline-view-renderer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EACZ,iBAAiB,EAEjB,iBAAiB,EACjB,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAA+B,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EACL,aAAa,GAId,MAAM,6BAA6B,CAAC;;;;;;;IAgE3B,+BAA+B;IAAA,YAAkC;I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SA/ZU,6BAA6B,yBAA7B,6BAA6B;6DAA7B,6BAA6B;YA9JpC,AAFF,8BAAkC,aAEI;YAClC,uBAAyC;YAGvC,AAFF,gGAAwC,4EAEK;YAU/C,iBAAM;YAIJ,AADF,8BAAyC,gBAI6D;YADlG,0GAAS,+BAA2B,IAAC;YAErC,oBAAoH;YAExH,AADE,iBAAS,EACL;YAIJ,AADF,8BAAkC,gBAIkH;YADhJ,0GAAS,6BAAyB,IAAC;YAEnC,qBAA6H;YAGnI,AADE,AADE,iBAAS,EACL,EACF;YAcJ,AAZF,yGAAqB,sFAYZ;;YA/CL,eAWC;YAXD,wGAWC;YAQC,eAAiG;YAAjG,mHAAiG;YAC9F,cAA4G;YAA5G,qHAA4G;YAS/G,eAA+I;YAA/I,iKAA+I;YAC5I,cAAqH;YAArH,8HAAqH;YAK9H,cAkBC;YAlBD,6CAkBC;;;iFAuGQ,6BAA6B;cAvKzC,SAAS;6BACI,KAAK,YACP,2BAA2B,iBACtB,iBAAiB,CAAC,IAAI,YAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DT;;kBAgHA,KAAK;;kBAeL,KAAK;;kBAWL,KAAK;;kBAGL,KAAK;;kBAQL,KAAK;;kBAiBL,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kFAtEI,6BAA6B;AAka1C;;;GAGG;AACH,MAAM,UAAU,wBAAwB;IACtC,4EAA4E;IAC5E,KAAK,6BAA6B,CAAC;AACrC,CAAC","sourcesContent":["import {\n Component,\n Input,\n Output,\n EventEmitter,\n ChangeDetectorRef,\n OnInit,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\nimport { EntityInfo, EntityFieldInfo, EntityFieldTSType } from '@memberjunction/core';\nimport { UUIDsEqual } from '@memberjunction/global';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport {\n TimelineGroup,\n TimeSegmentGrouping,\n TimelineSortOrder,\n AfterEventClickArgs,\n} from '@memberjunction/ng-timeline';\nimport { TimelineOrientation } from '../../types';\nimport { IViewRenderer } from '../view-type.contracts';\n\n/**\n * The persisted configuration shape for the Timeline view type.\n *\n * This is the `config` payload the host hands to the renderer on mount and that the\n * renderer emits back (in full) via {@link TimelineViewRendererComponent.configChanged}\n * whenever the user changes any of the timeline chrome controls. The host treats it as an\n * opaque blob — only this renderer (and an eventual prop-sheet) understands its keys — and\n * persists it per `MJ: View Types` row.\n *\n * All fields are optional: on first mount the renderer falls back to sensible defaults\n * (first available date field, vertical orientation, descending sort, monthly segments).\n */\nexport interface TimelineViewConfig {\n /** The entity date-field used to place records on the timeline (e.g. `__mj_CreatedAt`). */\n dateFieldName?: string;\n /** Vertical (alternating) vs. horizontal (single-row) timeline layout. */\n orientation?: TimelineOrientation;\n /** Newest-first (`desc`) vs. oldest-first (`asc`) event ordering. */\n sortOrder?: TimelineSortOrder;\n /** How events are bucketed into collapsible segments (day/week/month/...). */\n segmentGrouping?: TimeSegmentGrouping;\n}\n\n/**\n * TimelineViewRendererComponent\n * -----------------------------\n * The Timeline **view type** as a self-contained {@link IViewRenderer} plug-in. Where the\n * Timeline view used to be hard-wired into the generic `mj-entity-viewer` host (which owned\n * the date-field detection, the record→{@link TimelineGroup} transformation, and the\n * date-field / orientation / sort chrome), this component now OWNS all of it. The host simply\n * dynamic-mounts this renderer when Timeline is the active view type and feeds it the standard\n * renderer inputs (`entity` / `records` / `selectedRecordId` / `filterText` / `config`).\n *\n * It renders a small chrome header row (date-field selector + orientation toggle + sort toggle)\n * above a flex-filling `<mj-timeline>`, exactly reproducing the host's previous timeline chrome\n * and bindings. Because the host only mounts this plug-in when Timeline is active, the chrome\n * always renders — no extra `EffectiveViewMode === 'timeline'` guard is needed.\n *\n * **What was absorbed from the host** (`EntityViewerComponent`): `detectDateFields()`,\n * `sortDateFieldsByPriority()`, `AvailableDateFields`/`HasDateFields`, `configureTimeline()`,\n * `updateTimelineGroups()` (+ `findTitleField`/`findDescriptionField`/`findSubtitleField`),\n * `ToggleTimelineOrientation()`, `ToggleTimelineSortOrder()`, `SetTimelineDateField()`,\n * `SelectedDateFieldDisplayName`, `OnTimelineEventClick()`, and the `TimelineSelectedEventID`\n * composite-key→raw-id derivation.\n *\n * Inputs use the camelCase names mandated by the {@link IViewRenderer} contract (the host binds\n * them by those exact names) rather than MJ's usual PascalCase for public members.\n */\n@Component({\n standalone: false,\n selector: 'mj-timeline-view-renderer',\n encapsulation: ViewEncapsulation.None,\n template: `\n <!-- Chrome row: date-field selector + orientation toggle + sort toggle.\n Always rendered — this plug-in only mounts when Timeline is the active view. -->\n <div class=\"timeline-view-chrome\">\n <!-- Date Field Selector -->\n <div class=\"timeline-date-selector\">\n <i class=\"fa-solid fa-calendar-days\"></i>\n @if (AvailableDateFields.length === 1) {\n <span class=\"date-field-label\">{{ SelectedDateFieldDisplayName }}</span>\n } @else if (AvailableDateFields.length > 1) {\n <select\n class=\"date-field-select\"\n [value]=\"SelectedTimelineDateField\"\n (change)=\"SetTimelineDateField($any($event.target).value)\">\n @for (field of AvailableDateFields; track field.Name) {\n <option [value]=\"field.Name\">{{ field.DisplayNameOrName }}</option>\n }\n </select>\n }\n </div>\n\n <!-- Orientation Toggle -->\n <div class=\"timeline-orientation-toggle\">\n <button\n class=\"toggle-btn\"\n (click)=\"ToggleTimelineOrientation()\"\n [title]=\"TimelineOrientationState === 'vertical' ? 'Switch to Horizontal' : 'Switch to Vertical'\">\n <i [class]=\"TimelineOrientationState === 'vertical' ? 'fa-solid fa-ellipsis-vertical' : 'fa-solid fa-ellipsis'\"></i>\n </button>\n </div>\n\n <!-- Sort Order Toggle -->\n <div class=\"timeline-sort-toggle\">\n <button\n class=\"toggle-btn\"\n (click)=\"ToggleTimelineSortOrder()\"\n [title]=\"TimelineSortOrderState === 'desc' ? 'Showing Newest First (click for Oldest First)' : 'Showing Oldest First (click for Newest First)'\">\n <i [class]=\"TimelineSortOrderState === 'desc' ? 'fa-solid fa-arrow-down-wide-short' : 'fa-solid fa-arrow-up-wide-short'\"></i>\n </button>\n </div>\n </div>\n\n @if (HasDateFields) {\n <mj-timeline\n [groups]=\"TimelineGroups\"\n [orientation]=\"TimelineOrientationState\"\n [layout]=\"TimelineOrientationState === 'vertical' ? 'alternating' : 'single'\"\n [sortOrder]=\"TimelineSortOrderState\"\n [segmentGrouping]=\"TimelineSegmentGrouping\"\n [segmentsCollapsible]=\"true\"\n [segmentsDefaultExpanded]=\"true\"\n [selectedEventId]=\"TimelineSelectedEventID\"\n (afterEventClick)=\"OnTimelineEventClick($event)\">\n </mj-timeline>\n } @else {\n <mj-empty-state\n class=\"timeline-view-empty-fill\"\n Variant=\"warning\"\n Icon=\"fa-solid fa-calendar-xmark\"\n Title=\"This entity has no date fields to plot on a timeline.\" />\n }\n `,\n styles: [\n `\n :host {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .timeline-view-chrome {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 8px 12px;\n flex: 0 0 auto;\n }\n\n .timeline-view-renderer mj-timeline,\n :host mj-timeline {\n flex: 1 1 auto;\n min-height: 0;\n }\n\n /* Timeline Date Field Selector */\n .timeline-date-selector {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: 13px;\n color: var(--mj-text-secondary);\n }\n\n .timeline-date-selector i {\n color: var(--mj-text-disabled);\n }\n\n .date-field-label {\n color: var(--mj-text-secondary);\n font-weight: 500;\n }\n\n .date-field-select {\n padding: 4px 8px;\n border: 1px solid var(--mj-border-default);\n border-radius: 4px;\n font-size: 13px;\n background: var(--mj-bg-surface);\n color: var(--mj-text-secondary);\n cursor: pointer;\n outline: none;\n transition: border-color 0.15s ease;\n }\n\n .date-field-select:hover {\n border-color: var(--mj-border-strong);\n }\n\n .date-field-select:focus {\n border-color: var(--mj-brand-primary);\n }\n\n /* Orientation / Sort toggles */\n .timeline-orientation-toggle,\n .timeline-sort-toggle {\n display: flex;\n background: var(--mj-bg-surface-card);\n border-radius: 6px;\n padding: 2px;\n }\n\n .toggle-btn {\n width: 32px;\n height: 32px;\n border: none;\n background: transparent;\n border-radius: 4px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--mj-text-muted);\n transition: all 0.15s ease;\n }\n\n .toggle-btn:hover {\n color: var(--mj-text-secondary);\n }\n\n .toggle-btn.active {\n background: var(--mj-bg-surface);\n color: var(--mj-brand-primary);\n box-shadow: 0 1px 3px color-mix(in srgb, var(--mj-text-primary) 10%, transparent);\n }\n\n /* Flex-fill so the empty-state placeholder occupies the timeline area\n (the host centers its content but does not grow to fill the parent). */\n .timeline-view-empty-fill {\n flex: 1 1 auto;\n }\n `,\n ],\n})\nexport class TimelineViewRendererComponent\n extends BaseAngularComponent\n implements IViewRenderer<TimelineViewConfig>, OnInit\n{\n // ========================================\n // IViewRenderer inputs (camelCase per the host contract)\n // ========================================\n\n private _entity: EntityInfo | null = null;\n /** The entity whose records are being rendered. Re-detects date fields + rebuilds groups on change. */\n @Input()\n set entity(value: EntityInfo | null) {\n const changed = !UUIDsEqual(value?.ID, this._entity?.ID);\n this._entity = value;\n if (changed) {\n this.detectDateFields();\n this.cdr.detectChanges();\n }\n }\n get entity(): EntityInfo | null {\n return this._entity;\n }\n\n private _records: Record<string, unknown>[] = [];\n /** The records to render (already loaded/filtered by the host). Rebuilds groups on change. */\n @Input()\n set records(value: Record<string, unknown>[]) {\n this._records = value ?? [];\n this.updateTimelineGroups();\n this.cdr.detectChanges();\n }\n get records(): Record<string, unknown>[] {\n return this._records;\n }\n\n /** Primary-key string of the currently selected record, if any (composite-key encoded). */\n @Input() selectedRecordId: string | null = null;\n\n /** Active filter text — accepted for contract uniformity; the host pre-filters `records`. */\n @Input() filterText: string | null = null;\n\n private _config: TimelineViewConfig = {};\n /**\n * This view's persisted configuration. Seeding the chrome controls from it is deferred to\n * {@link applyConfigToState}, called both here (for late updates) and in {@link ngOnInit}\n * (for the initial mount, where the host sets `config` via `setInput` before init runs).\n */\n @Input()\n set config(value: TimelineViewConfig) {\n this._config = value ?? {};\n if (this._initialized) {\n this.applyConfigToState();\n this.cdr.detectChanges();\n }\n }\n get config(): TimelineViewConfig {\n return this._config;\n }\n\n // ========================================\n // IViewRenderer outputs\n // ========================================\n\n /** Emitted when a timeline event is clicked — payload is the RAW record object. */\n @Output() recordSelected = new EventEmitter<unknown>();\n\n /** Emitted when a record should be opened — payload is the RAW record object. */\n @Output() recordOpened = new EventEmitter<unknown>();\n\n /** Emitted (with the FULL updated config) whenever the user changes a chrome control. */\n @Output() configChanged = new EventEmitter<TimelineViewConfig>();\n\n // ========================================\n // RENDER STATE (absorbed from the host)\n // ========================================\n\n /** Whether the current entity has any date fields available for timeline view. */\n public HasDateFields = false;\n\n /** Available date fields from the entity, sorted by priority. */\n public AvailableDateFields: EntityFieldInfo[] = [];\n\n /** The currently selected date field name for the timeline. */\n public SelectedTimelineDateField: string | null = null;\n\n /** The built timeline groups handed to `<mj-timeline>`. */\n public TimelineGroups: TimelineGroup<Record<string, unknown>>[] = [];\n\n /**\n * Timeline sort order. Named `…State` (not `TimelineSortOrder`) to avoid colliding with the\n * imported {@link TimelineSortOrder} type symbol used in the template / signatures.\n */\n public TimelineSortOrderState: TimelineSortOrder = 'desc';\n\n /** Timeline segment grouping (day/week/month/...). */\n public TimelineSegmentGrouping: TimeSegmentGrouping = 'month';\n\n /**\n * Timeline orientation. Named `…State` to avoid colliding with the imported\n * {@link TimelineOrientation} type symbol.\n */\n public TimelineOrientationState: TimelineOrientation = 'vertical';\n\n private _initialized = false;\n private cdr = inject(ChangeDetectorRef);\n\n // ========================================\n // LIFECYCLE\n // ========================================\n\n ngOnInit(): void {\n // The host sets entity/records/config via setInput BEFORE ngOnInit, so detection may have\n // already run. Apply the seeded config now (controls + defaults), then (re)build groups.\n this._initialized = true;\n this.applyConfigToState();\n this.detectDateFields();\n this.cdr.detectChanges();\n }\n\n // ========================================\n // COMPUTED\n // ========================================\n\n /** Display name of the currently selected timeline date field. */\n get SelectedDateFieldDisplayName(): string {\n if (!this.SelectedTimelineDateField) {\n return '';\n }\n const field = this.AvailableDateFields.find((f) => f.Name === this.SelectedTimelineDateField);\n return field?.DisplayNameOrName || this.SelectedTimelineDateField;\n }\n\n /**\n * The raw ID value derived from {@link selectedRecordId} for timeline selection. The host\n * passes the selection in composite-key format (`ID|abc-123` or `ID=abc-123`), but the\n * timeline stores just the raw ID value — so strip the field-name prefix.\n */\n get TimelineSelectedEventID(): string | null {\n if (!this.selectedRecordId) {\n return null;\n }\n if (this.selectedRecordId.includes('|')) {\n const parts = this.selectedRecordId.split('|');\n return parts.length > 1 ? parts[1] : this.selectedRecordId;\n }\n if (this.selectedRecordId.includes('=')) {\n const parts = this.selectedRecordId.split('=');\n return parts.length > 1 ? parts[1] : this.selectedRecordId;\n }\n return this.selectedRecordId;\n }\n\n // ========================================\n // CHROME ACTIONS (absorbed from the host)\n // ========================================\n\n /** Toggle timeline orientation between vertical and horizontal, then persist via config. */\n ToggleTimelineOrientation(): void {\n this.TimelineOrientationState = this.TimelineOrientationState === 'vertical' ? 'horizontal' : 'vertical';\n this.emitConfigChange();\n this.cdr.detectChanges();\n }\n\n /** Toggle timeline sort order between newest-first (desc) and oldest-first (asc), then persist. */\n ToggleTimelineSortOrder(): void {\n this.TimelineSortOrderState = this.TimelineSortOrderState === 'desc' ? 'asc' : 'desc';\n this.emitConfigChange();\n this.cdr.detectChanges();\n }\n\n /** Change the date field used for the timeline, rebuild groups, then persist via config. */\n SetTimelineDateField(fieldName: string): void {\n if (this.AvailableDateFields.some((f) => f.Name === fieldName)) {\n this.SelectedTimelineDateField = fieldName;\n this.updateTimelineGroups();\n this.emitConfigChange();\n this.cdr.detectChanges();\n }\n }\n\n // ========================================\n // TIMELINE EVENT → RECORD MAPPING\n // ========================================\n\n /**\n * Handle a timeline event click. Maps the {@link AfterEventClickArgs} to the underlying raw\n * record (`event.event.entity`) and emits it on {@link recordSelected}. The host's dynamic\n * handler builds the composite key from the raw record, so we emit the record object as-is.\n */\n OnTimelineEventClick(event: AfterEventClickArgs): void {\n const record = event.event.entity as Record<string, unknown> | undefined;\n if (record) {\n this.recordSelected.emit(record);\n }\n }\n\n // ========================================\n // CONFIG <-> STATE\n // ========================================\n\n /**\n * Seed the chrome control state from {@link config}, applying sensible defaults where the\n * config is silent (vertical orientation, descending sort, monthly segments). The selected\n * date field is resolved against the currently-available date fields in {@link detectDateFields}.\n */\n private applyConfigToState(): void {\n const c = this._config;\n this.TimelineOrientationState = c.orientation ?? 'vertical';\n this.TimelineSortOrderState = c.sortOrder ?? 'desc';\n this.TimelineSegmentGrouping = c.segmentGrouping ?? 'month';\n }\n\n /** Emit the FULL current config object so the host can persist the change. */\n private emitConfigChange(): void {\n this._config = {\n dateFieldName: this.SelectedTimelineDateField ?? undefined,\n orientation: this.TimelineOrientationState,\n sortOrder: this.TimelineSortOrderState,\n segmentGrouping: this.TimelineSegmentGrouping,\n };\n this.configChanged.emit(this._config);\n }\n\n // ========================================\n // DATE-FIELD DETECTION (absorbed from the host)\n // ========================================\n\n /**\n * Detect the entity's date fields and configure the timeline. Resolves the selected date\n * field (preferring the configured one, falling back to the highest-priority available field)\n * and rebuilds the groups. No-ops to an empty state when the entity has no date fields.\n */\n private detectDateFields(): void {\n if (!this._entity) {\n this.HasDateFields = false;\n this.AvailableDateFields = [];\n this.TimelineGroups = [];\n return;\n }\n\n const dateFields = this._entity.Fields.filter((f) => f.TSType === EntityFieldTSType.Date);\n if (dateFields.length === 0) {\n this.HasDateFields = false;\n this.AvailableDateFields = [];\n this.TimelineGroups = [];\n return;\n }\n\n this.AvailableDateFields = this.sortDateFieldsByPriority(dateFields);\n this.HasDateFields = true;\n this.SelectedTimelineDateField = this.getEffectiveTimelineDateField();\n this.updateTimelineGroups();\n }\n\n /**\n * Sort date fields by priority: `DefaultInView` fields first (by Sequence), then the rest\n * (by Sequence).\n */\n private sortDateFieldsByPriority(dateFields: EntityFieldInfo[]): EntityFieldInfo[] {\n const defaultInView = dateFields.filter((f) => f.DefaultInView).sort((a, b) => a.Sequence - b.Sequence);\n const others = dateFields.filter((f) => !f.DefaultInView).sort((a, b) => a.Sequence - b.Sequence);\n return [...defaultInView, ...others];\n }\n\n /**\n * Resolve which date field to use: the configured `dateFieldName` when it's still a valid\n * available field, otherwise the first (highest-priority) available date field.\n */\n private getEffectiveTimelineDateField(): string {\n if (this._config.dateFieldName) {\n const configField = this.AvailableDateFields.find((f) => f.Name === this._config.dateFieldName);\n if (configField) {\n return configField.Name;\n }\n }\n return this.AvailableDateFields[0].Name;\n }\n\n // ========================================\n // GROUP BUILDING (absorbed from the host)\n // ========================================\n\n /**\n * Build the single {@link TimelineGroup} for the current entity + records + selected date\n * field, mirroring the host's previous `updateTimelineGroups()`. No-ops to an empty state\n * when there is no entity or no selected date field.\n */\n private updateTimelineGroups(): void {\n // Emit NO group until there is an entity, a resolved date field, AND records. Emitting an empty\n // group (records not loaded yet) makes the inner <mj-timeline> run its first refresh with zero\n // events and mark itself loaded; the later records-populated update can then be dropped by its\n // concurrent-refresh / already-loaded guards, leaving \"No events to display\". Waiting for records\n // means its first real load happens with data.\n if (!this._entity || !this.SelectedTimelineDateField || this._records.length === 0) {\n this.TimelineGroups = [];\n return;\n }\n\n const titleField = this.findTitleField();\n\n const group = new TimelineGroup<Record<string, unknown>>();\n group.DataSourceType = 'array';\n group.EntityObjects = this._records;\n group.TitleFieldName = titleField;\n group.DateFieldName = this.SelectedTimelineDateField;\n group.IdFieldName = 'ID';\n group.GroupLabel = this._entity.Name;\n\n const descField = this.findDescriptionField();\n if (descField) {\n group.DescriptionFieldName = descField;\n }\n\n const subtitleField = this.findSubtitleField(titleField);\n if (subtitleField) {\n group.SubtitleFieldName = subtitleField;\n }\n\n const imageField = this.findImageField();\n group.CardConfig = {\n collapsible: true,\n defaultExpanded: false,\n showDate: true,\n dateFormat: 'MMM d, yyyy h:mm a',\n ...(imageField\n ? { imageField, imagePosition: 'left' as const, imageSize: 'small' as const }\n : {}),\n };\n\n this.TimelineGroups = [group];\n }\n\n /**\n * Find the best field to use as the event title: the entity's NameField, then a\n * `DefaultInView` string field matching a common name pattern, then the first string field.\n */\n private findTitleField(): string {\n if (!this._entity) {\n return 'ID';\n }\n if (this._entity.NameField) {\n return this._entity.NameField.Name;\n }\n\n const stringFields = this._entity.Fields.filter(\n (f) => f.TSType === EntityFieldTSType.String && f.DefaultInView && !f.Name.startsWith('__mj_'),\n ).sort((a, b) => a.Sequence - b.Sequence);\n\n const namePatterns = ['name', 'title', 'subject', 'label'];\n for (const pattern of namePatterns) {\n const match = stringFields.find((f) => f.Name.toLowerCase().includes(pattern));\n if (match) {\n return match.Name;\n }\n }\n\n return stringFields.length > 0 ? stringFields[0].Name : 'ID';\n }\n\n /** Find a suitable description field by common naming pattern, or null. */\n private findDescriptionField(): string | null {\n if (!this._entity) {\n return null;\n }\n const descPatterns = ['description', 'notes', 'summary', 'content', 'body', 'details'];\n const textFields = this._entity.Fields.filter(\n (f) => f.TSType === EntityFieldTSType.String && !f.Name.startsWith('__mj_'),\n );\n for (const pattern of descPatterns) {\n const match = textFields.find((f) => f.Name.toLowerCase().includes(pattern));\n if (match) {\n return match.Name;\n }\n }\n return null;\n }\n\n /**\n * Find a suitable subtitle field (different from the title): a `DefaultInView` string field\n * matching a classification pattern (status/type/category/...), else the first other string\n * field, else null.\n */\n private findSubtitleField(excludeField: string): string | null {\n if (!this._entity) {\n return null;\n }\n const patterns = ['status', 'type', 'category', 'state', 'priority'];\n const fields = this._entity.Fields.filter(\n (f) =>\n f.TSType === EntityFieldTSType.String &&\n f.DefaultInView &&\n f.Name !== excludeField &&\n !f.Name.startsWith('__mj_'),\n ).sort((a, b) => a.Sequence - b.Sequence);\n\n for (const pattern of patterns) {\n const match = fields.find((f) => f.Name.toLowerCase().includes(pattern));\n if (match) {\n return match.Name;\n }\n }\n\n const firstOther = fields.find((f) => f.Name !== excludeField);\n return firstOther?.Name || null;\n }\n\n /** Image field (ExtendedType='Image') so timeline cards crop a thumbnail, same as grid/cards. */\n private findImageField(): string | null {\n if (!this._entity) {\n return null;\n }\n const match = this._entity.Fields.find(\n (f) => f.ExtendedType === 'Image' && f.TSType === EntityFieldTSType.String,\n );\n return match?.Name ?? null;\n }\n}\n\n/**\n * Tree-shaking guard. Force-references the component class so bundlers don't drop this module\n * when it's only mounted dynamically via the view-type descriptor's `RendererComponent`.\n */\nexport function LoadTimelineViewRenderer(): void {\n // no-op; presence prevents tree-shaking of the dynamically-mounted renderer\n void TimelineViewRendererComponent;\n}\n"]}
1
+ {"version":3,"file":"timeline-view-renderer.component.js","sourceRoot":"","sources":["../../../../src/lib/view-types/renderers/timeline-view-renderer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EACZ,iBAAiB,EAEjB,iBAAiB,EACjB,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAA+B,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzG,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EACL,aAAa,GAId,MAAM,6BAA6B,CAAC;;;;;;;IAgE3B,+BAA+B;IAAA,YAAkC;IAAA,iBAAO;;;IAAzC,cAAkC;IAAlC,yDAAkC;;;IAO7D,kCAA6B;IAAA,YAA6B;IAAA,iBAAS;;;IAA3D,qCAAoB;IAAC,cAA6B;IAA7B,gDAA6B;;;;IAL9D,kCAG6D;IAA3D,yMAAU,gDAA+C,KAAC;IAC1D,kHAEC;IACH,iBAAS;;;IALP,wDAAmC;IAEnC,cAEC;IAFD,yCAEC;;;;IA2BP,uCASmD;IAAjD,iOAAmB,mCAA4B,KAAC;IAClD,iBAAc;;;IAFZ,AADA,AADA,AADA,AADA,AADA,AADA,AADA,8CAAyB,gDACe,qFACqC,4CACzC,mDACO,6BACf,iCACI,mDACW;;;IAI7C,oCAIkE;;AAxFxE;;;;;;;;;;;;;;;;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AI,CAAC;IAC7B,CAAC;iSAzaU,6BAA6B,yBAA7B,6BAA6B;6DAA7B,6BAA6B;YA9JpC,AAFF,8BAAkC,aAEI;YAClC,uBAAyC;YAGvC,AAFF,gGAAwC,4EAEK;YAU/C,iBAAM;YAIJ,AADF,8BAAyC,gBAI6D;YADlG,0GAAS,+BAA2B,IAAC;YAErC,oBAAoH;YAExH,AADE,iBAAS,EACL;YAIJ,AADF,8BAAkC,gBAIkH;YADhJ,0GAAS,6BAAyB,IAAC;YAEnC,qBAA6H;YAGnI,AADE,AADE,iBAAS,EACL,EACF;YAcJ,AAZF,yGAAqB,sFAYZ;;YA/CL,eAWC;YAXD,wGAWC;YAQC,eAAiG;YAAjG,mHAAiG;YAC9F,cAA4G;YAA5G,qHAA4G;YAS/G,eAA+I;YAA/I,iKAA+I;YAC5I,cAAqH;YAArH,8HAAqH;YAK9H,cAkBC;YAlBD,6CAkBC;;;iFAuGQ,6BAA6B;cAvKzC,SAAS;6BACI,KAAK,YACP,2BAA2B,iBACtB,iBAAiB,CAAC,IAAI,YAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DT;;kBAgHA,KAAK;;kBAeL,KAAK;;kBAWL,KAAK;;kBAGL,KAAK;;kBAQL,KAAK;;kBAiBL,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kFAtEI,6BAA6B;AA4a1C;;;GAGG;AACH,MAAM,UAAU,wBAAwB;IACtC,4EAA4E;IAC5E,KAAK,6BAA6B,CAAC;AACrC,CAAC","sourcesContent":["import {\n Component,\n Input,\n Output,\n EventEmitter,\n ChangeDetectorRef,\n OnInit,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\nimport { EntityInfo, EntityFieldInfo, EntityFieldTSType, IsDateOnlySQLType } from '@memberjunction/core';\nimport { UUIDsEqual } from '@memberjunction/global';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport {\n TimelineGroup,\n TimeSegmentGrouping,\n TimelineSortOrder,\n AfterEventClickArgs,\n} from '@memberjunction/ng-timeline';\nimport { TimelineOrientation } from '../../types';\nimport { IViewRenderer } from '../view-type.contracts';\n\n/**\n * The persisted configuration shape for the Timeline view type.\n *\n * This is the `config` payload the host hands to the renderer on mount and that the\n * renderer emits back (in full) via {@link TimelineViewRendererComponent.configChanged}\n * whenever the user changes any of the timeline chrome controls. The host treats it as an\n * opaque blob — only this renderer (and an eventual prop-sheet) understands its keys — and\n * persists it per `MJ: View Types` row.\n *\n * All fields are optional: on first mount the renderer falls back to sensible defaults\n * (first available date field, vertical orientation, descending sort, monthly segments).\n */\nexport interface TimelineViewConfig {\n /** The entity date-field used to place records on the timeline (e.g. `__mj_CreatedAt`). */\n dateFieldName?: string;\n /** Vertical (alternating) vs. horizontal (single-row) timeline layout. */\n orientation?: TimelineOrientation;\n /** Newest-first (`desc`) vs. oldest-first (`asc`) event ordering. */\n sortOrder?: TimelineSortOrder;\n /** How events are bucketed into collapsible segments (day/week/month/...). */\n segmentGrouping?: TimeSegmentGrouping;\n}\n\n/**\n * TimelineViewRendererComponent\n * -----------------------------\n * The Timeline **view type** as a self-contained {@link IViewRenderer} plug-in. Where the\n * Timeline view used to be hard-wired into the generic `mj-entity-viewer` host (which owned\n * the date-field detection, the record→{@link TimelineGroup} transformation, and the\n * date-field / orientation / sort chrome), this component now OWNS all of it. The host simply\n * dynamic-mounts this renderer when Timeline is the active view type and feeds it the standard\n * renderer inputs (`entity` / `records` / `selectedRecordId` / `filterText` / `config`).\n *\n * It renders a small chrome header row (date-field selector + orientation toggle + sort toggle)\n * above a flex-filling `<mj-timeline>`, exactly reproducing the host's previous timeline chrome\n * and bindings. Because the host only mounts this plug-in when Timeline is active, the chrome\n * always renders — no extra `EffectiveViewMode === 'timeline'` guard is needed.\n *\n * **What was absorbed from the host** (`EntityViewerComponent`): `detectDateFields()`,\n * `sortDateFieldsByPriority()`, `AvailableDateFields`/`HasDateFields`, `configureTimeline()`,\n * `updateTimelineGroups()` (+ `findTitleField`/`findDescriptionField`/`findSubtitleField`),\n * `ToggleTimelineOrientation()`, `ToggleTimelineSortOrder()`, `SetTimelineDateField()`,\n * `SelectedDateFieldDisplayName`, `OnTimelineEventClick()`, and the `TimelineSelectedEventID`\n * composite-key→raw-id derivation.\n *\n * Inputs use the camelCase names mandated by the {@link IViewRenderer} contract (the host binds\n * them by those exact names) rather than MJ's usual PascalCase for public members.\n */\n@Component({\n standalone: false,\n selector: 'mj-timeline-view-renderer',\n encapsulation: ViewEncapsulation.None,\n template: `\n <!-- Chrome row: date-field selector + orientation toggle + sort toggle.\n Always rendered — this plug-in only mounts when Timeline is the active view. -->\n <div class=\"timeline-view-chrome\">\n <!-- Date Field Selector -->\n <div class=\"timeline-date-selector\">\n <i class=\"fa-solid fa-calendar-days\"></i>\n @if (AvailableDateFields.length === 1) {\n <span class=\"date-field-label\">{{ SelectedDateFieldDisplayName }}</span>\n } @else if (AvailableDateFields.length > 1) {\n <select\n class=\"date-field-select\"\n [value]=\"SelectedTimelineDateField\"\n (change)=\"SetTimelineDateField($any($event.target).value)\">\n @for (field of AvailableDateFields; track field.Name) {\n <option [value]=\"field.Name\">{{ field.DisplayNameOrName }}</option>\n }\n </select>\n }\n </div>\n\n <!-- Orientation Toggle -->\n <div class=\"timeline-orientation-toggle\">\n <button\n class=\"toggle-btn\"\n (click)=\"ToggleTimelineOrientation()\"\n [title]=\"TimelineOrientationState === 'vertical' ? 'Switch to Horizontal' : 'Switch to Vertical'\">\n <i [class]=\"TimelineOrientationState === 'vertical' ? 'fa-solid fa-ellipsis-vertical' : 'fa-solid fa-ellipsis'\"></i>\n </button>\n </div>\n\n <!-- Sort Order Toggle -->\n <div class=\"timeline-sort-toggle\">\n <button\n class=\"toggle-btn\"\n (click)=\"ToggleTimelineSortOrder()\"\n [title]=\"TimelineSortOrderState === 'desc' ? 'Showing Newest First (click for Oldest First)' : 'Showing Oldest First (click for Newest First)'\">\n <i [class]=\"TimelineSortOrderState === 'desc' ? 'fa-solid fa-arrow-down-wide-short' : 'fa-solid fa-arrow-up-wide-short'\"></i>\n </button>\n </div>\n </div>\n\n @if (HasDateFields) {\n <mj-timeline\n [groups]=\"TimelineGroups\"\n [orientation]=\"TimelineOrientationState\"\n [layout]=\"TimelineOrientationState === 'vertical' ? 'alternating' : 'single'\"\n [sortOrder]=\"TimelineSortOrderState\"\n [segmentGrouping]=\"TimelineSegmentGrouping\"\n [segmentsCollapsible]=\"true\"\n [segmentsDefaultExpanded]=\"true\"\n [selectedEventId]=\"TimelineSelectedEventID\"\n (afterEventClick)=\"OnTimelineEventClick($event)\">\n </mj-timeline>\n } @else {\n <mj-empty-state\n class=\"timeline-view-empty-fill\"\n Variant=\"warning\"\n Icon=\"fa-solid fa-calendar-xmark\"\n Title=\"This entity has no date fields to plot on a timeline.\" />\n }\n `,\n styles: [\n `\n :host {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .timeline-view-chrome {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 8px 12px;\n flex: 0 0 auto;\n }\n\n .timeline-view-renderer mj-timeline,\n :host mj-timeline {\n flex: 1 1 auto;\n min-height: 0;\n }\n\n /* Timeline Date Field Selector */\n .timeline-date-selector {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: 13px;\n color: var(--mj-text-secondary);\n }\n\n .timeline-date-selector i {\n color: var(--mj-text-disabled);\n }\n\n .date-field-label {\n color: var(--mj-text-secondary);\n font-weight: 500;\n }\n\n .date-field-select {\n padding: 4px 8px;\n border: 1px solid var(--mj-border-default);\n border-radius: 4px;\n font-size: 13px;\n background: var(--mj-bg-surface);\n color: var(--mj-text-secondary);\n cursor: pointer;\n outline: none;\n transition: border-color 0.15s ease;\n }\n\n .date-field-select:hover {\n border-color: var(--mj-border-strong);\n }\n\n .date-field-select:focus {\n border-color: var(--mj-brand-primary);\n }\n\n /* Orientation / Sort toggles */\n .timeline-orientation-toggle,\n .timeline-sort-toggle {\n display: flex;\n background: var(--mj-bg-surface-card);\n border-radius: 6px;\n padding: 2px;\n }\n\n .toggle-btn {\n width: 32px;\n height: 32px;\n border: none;\n background: transparent;\n border-radius: 4px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--mj-text-muted);\n transition: all 0.15s ease;\n }\n\n .toggle-btn:hover {\n color: var(--mj-text-secondary);\n }\n\n .toggle-btn.active {\n background: var(--mj-bg-surface);\n color: var(--mj-brand-primary);\n box-shadow: 0 1px 3px color-mix(in srgb, var(--mj-text-primary) 10%, transparent);\n }\n\n /* Flex-fill so the empty-state placeholder occupies the timeline area\n (the host centers its content but does not grow to fill the parent). */\n .timeline-view-empty-fill {\n flex: 1 1 auto;\n }\n `,\n ],\n})\nexport class TimelineViewRendererComponent\n extends BaseAngularComponent\n implements IViewRenderer<TimelineViewConfig>, OnInit\n{\n // ========================================\n // IViewRenderer inputs (camelCase per the host contract)\n // ========================================\n\n private _entity: EntityInfo | null = null;\n /** The entity whose records are being rendered. Re-detects date fields + rebuilds groups on change. */\n @Input()\n set entity(value: EntityInfo | null) {\n const changed = !UUIDsEqual(value?.ID, this._entity?.ID);\n this._entity = value;\n if (changed) {\n this.detectDateFields();\n this.cdr.detectChanges();\n }\n }\n get entity(): EntityInfo | null {\n return this._entity;\n }\n\n private _records: Record<string, unknown>[] = [];\n /** The records to render (already loaded/filtered by the host). Rebuilds groups on change. */\n @Input()\n set records(value: Record<string, unknown>[]) {\n this._records = value ?? [];\n this.updateTimelineGroups();\n this.cdr.detectChanges();\n }\n get records(): Record<string, unknown>[] {\n return this._records;\n }\n\n /** Primary-key string of the currently selected record, if any (composite-key encoded). */\n @Input() selectedRecordId: string | null = null;\n\n /** Active filter text — accepted for contract uniformity; the host pre-filters `records`. */\n @Input() filterText: string | null = null;\n\n private _config: TimelineViewConfig = {};\n /**\n * This view's persisted configuration. Seeding the chrome controls from it is deferred to\n * {@link applyConfigToState}, called both here (for late updates) and in {@link ngOnInit}\n * (for the initial mount, where the host sets `config` via `setInput` before init runs).\n */\n @Input()\n set config(value: TimelineViewConfig) {\n this._config = value ?? {};\n if (this._initialized) {\n this.applyConfigToState();\n this.cdr.detectChanges();\n }\n }\n get config(): TimelineViewConfig {\n return this._config;\n }\n\n // ========================================\n // IViewRenderer outputs\n // ========================================\n\n /** Emitted when a timeline event is clicked — payload is the RAW record object. */\n @Output() recordSelected = new EventEmitter<unknown>();\n\n /** Emitted when a record should be opened — payload is the RAW record object. */\n @Output() recordOpened = new EventEmitter<unknown>();\n\n /** Emitted (with the FULL updated config) whenever the user changes a chrome control. */\n @Output() configChanged = new EventEmitter<TimelineViewConfig>();\n\n // ========================================\n // RENDER STATE (absorbed from the host)\n // ========================================\n\n /** Whether the current entity has any date fields available for timeline view. */\n public HasDateFields = false;\n\n /** Available date fields from the entity, sorted by priority. */\n public AvailableDateFields: EntityFieldInfo[] = [];\n\n /** The currently selected date field name for the timeline. */\n public SelectedTimelineDateField: string | null = null;\n\n /** The built timeline groups handed to `<mj-timeline>`. */\n public TimelineGroups: TimelineGroup<Record<string, unknown>>[] = [];\n\n /**\n * Timeline sort order. Named `…State` (not `TimelineSortOrder`) to avoid colliding with the\n * imported {@link TimelineSortOrder} type symbol used in the template / signatures.\n */\n public TimelineSortOrderState: TimelineSortOrder = 'desc';\n\n /** Timeline segment grouping (day/week/month/...). */\n public TimelineSegmentGrouping: TimeSegmentGrouping = 'month';\n\n /**\n * Timeline orientation. Named `…State` to avoid colliding with the imported\n * {@link TimelineOrientation} type symbol.\n */\n public TimelineOrientationState: TimelineOrientation = 'vertical';\n\n private _initialized = false;\n private cdr = inject(ChangeDetectorRef);\n\n // ========================================\n // LIFECYCLE\n // ========================================\n\n ngOnInit(): void {\n // The host sets entity/records/config via setInput BEFORE ngOnInit, so detection may have\n // already run. Apply the seeded config now (controls + defaults), then (re)build groups.\n this._initialized = true;\n this.applyConfigToState();\n this.detectDateFields();\n this.cdr.detectChanges();\n }\n\n // ========================================\n // COMPUTED\n // ========================================\n\n /** Display name of the currently selected timeline date field. */\n get SelectedDateFieldDisplayName(): string {\n if (!this.SelectedTimelineDateField) {\n return '';\n }\n const field = this.AvailableDateFields.find((f) => f.Name === this.SelectedTimelineDateField);\n return field?.DisplayNameOrName || this.SelectedTimelineDateField;\n }\n\n /**\n * The raw ID value derived from {@link selectedRecordId} for timeline selection. The host\n * passes the selection in composite-key format (`ID|abc-123` or `ID=abc-123`), but the\n * timeline stores just the raw ID value — so strip the field-name prefix.\n */\n get TimelineSelectedEventID(): string | null {\n if (!this.selectedRecordId) {\n return null;\n }\n if (this.selectedRecordId.includes('|')) {\n const parts = this.selectedRecordId.split('|');\n return parts.length > 1 ? parts[1] : this.selectedRecordId;\n }\n if (this.selectedRecordId.includes('=')) {\n const parts = this.selectedRecordId.split('=');\n return parts.length > 1 ? parts[1] : this.selectedRecordId;\n }\n return this.selectedRecordId;\n }\n\n // ========================================\n // CHROME ACTIONS (absorbed from the host)\n // ========================================\n\n /** Toggle timeline orientation between vertical and horizontal, then persist via config. */\n ToggleTimelineOrientation(): void {\n this.TimelineOrientationState = this.TimelineOrientationState === 'vertical' ? 'horizontal' : 'vertical';\n this.emitConfigChange();\n this.cdr.detectChanges();\n }\n\n /** Toggle timeline sort order between newest-first (desc) and oldest-first (asc), then persist. */\n ToggleTimelineSortOrder(): void {\n this.TimelineSortOrderState = this.TimelineSortOrderState === 'desc' ? 'asc' : 'desc';\n this.emitConfigChange();\n this.cdr.detectChanges();\n }\n\n /** Change the date field used for the timeline, rebuild groups, then persist via config. */\n SetTimelineDateField(fieldName: string): void {\n if (this.AvailableDateFields.some((f) => f.Name === fieldName)) {\n this.SelectedTimelineDateField = fieldName;\n this.updateTimelineGroups();\n this.emitConfigChange();\n this.cdr.detectChanges();\n }\n }\n\n // ========================================\n // TIMELINE EVENT → RECORD MAPPING\n // ========================================\n\n /**\n * Handle a timeline event click. Maps the {@link AfterEventClickArgs} to the underlying raw\n * record (`event.event.entity`) and emits it on {@link recordSelected}. The host's dynamic\n * handler builds the composite key from the raw record, so we emit the record object as-is.\n */\n OnTimelineEventClick(event: AfterEventClickArgs): void {\n const record = event.event.entity as Record<string, unknown> | undefined;\n if (record) {\n this.recordSelected.emit(record);\n }\n }\n\n // ========================================\n // CONFIG <-> STATE\n // ========================================\n\n /**\n * Seed the chrome control state from {@link config}, applying sensible defaults where the\n * config is silent (vertical orientation, descending sort, monthly segments). The selected\n * date field is resolved against the currently-available date fields in {@link detectDateFields}.\n */\n private applyConfigToState(): void {\n const c = this._config;\n this.TimelineOrientationState = c.orientation ?? 'vertical';\n this.TimelineSortOrderState = c.sortOrder ?? 'desc';\n this.TimelineSegmentGrouping = c.segmentGrouping ?? 'month';\n }\n\n /** Emit the FULL current config object so the host can persist the change. */\n private emitConfigChange(): void {\n this._config = {\n dateFieldName: this.SelectedTimelineDateField ?? undefined,\n orientation: this.TimelineOrientationState,\n sortOrder: this.TimelineSortOrderState,\n segmentGrouping: this.TimelineSegmentGrouping,\n };\n this.configChanged.emit(this._config);\n }\n\n // ========================================\n // DATE-FIELD DETECTION (absorbed from the host)\n // ========================================\n\n /**\n * Detect the entity's date fields and configure the timeline. Resolves the selected date\n * field (preferring the configured one, falling back to the highest-priority available field)\n * and rebuilds the groups. No-ops to an empty state when the entity has no date fields.\n */\n private detectDateFields(): void {\n if (!this._entity) {\n this.HasDateFields = false;\n this.AvailableDateFields = [];\n this.TimelineGroups = [];\n return;\n }\n\n const dateFields = this._entity.Fields.filter((f) => f.TSType === EntityFieldTSType.Date);\n if (dateFields.length === 0) {\n this.HasDateFields = false;\n this.AvailableDateFields = [];\n this.TimelineGroups = [];\n return;\n }\n\n this.AvailableDateFields = this.sortDateFieldsByPriority(dateFields);\n this.HasDateFields = true;\n this.SelectedTimelineDateField = this.getEffectiveTimelineDateField();\n this.updateTimelineGroups();\n }\n\n /**\n * Sort date fields by priority: `DefaultInView` fields first (by Sequence), then the rest\n * (by Sequence).\n */\n private sortDateFieldsByPriority(dateFields: EntityFieldInfo[]): EntityFieldInfo[] {\n const defaultInView = dateFields.filter((f) => f.DefaultInView).sort((a, b) => a.Sequence - b.Sequence);\n const others = dateFields.filter((f) => !f.DefaultInView).sort((a, b) => a.Sequence - b.Sequence);\n return [...defaultInView, ...others];\n }\n\n /**\n * Resolve which date field to use: the configured `dateFieldName` when it's still a valid\n * available field, otherwise the first (highest-priority) available date field.\n */\n private getEffectiveTimelineDateField(): string {\n if (this._config.dateFieldName) {\n const configField = this.AvailableDateFields.find((f) => f.Name === this._config.dateFieldName);\n if (configField) {\n return configField.Name;\n }\n }\n return this.AvailableDateFields[0].Name;\n }\n\n // ========================================\n // GROUP BUILDING (absorbed from the host)\n // ========================================\n\n /**\n * Build the single {@link TimelineGroup} for the current entity + records + selected date\n * field, mirroring the host's previous `updateTimelineGroups()`. No-ops to an empty state\n * when there is no entity or no selected date field.\n */\n private updateTimelineGroups(): void {\n // Emit NO group until there is an entity, a resolved date field, AND records. Emitting an empty\n // group (records not loaded yet) makes the inner <mj-timeline> run its first refresh with zero\n // events and mark itself loaded; the later records-populated update can then be dropped by its\n // concurrent-refresh / already-loaded guards, leaving \"No events to display\". Waiting for records\n // means its first real load happens with data.\n if (!this._entity || !this.SelectedTimelineDateField || this._records.length === 0) {\n this.TimelineGroups = [];\n return;\n }\n\n const titleField = this.findTitleField();\n\n const group = new TimelineGroup<Record<string, unknown>>();\n group.DataSourceType = 'array';\n group.EntityObjects = this._records;\n group.TitleFieldName = titleField;\n group.DateFieldName = this.SelectedTimelineDateField;\n group.IdFieldName = 'ID';\n group.GroupLabel = this._entity.Name;\n // The records are plain `simple` rows with no EntityInfo of their own: the group needs the\n // entity's metadata to know a SQL `date` field is a calendar day, not an instant.\n group.EntityInfo = this._entity;\n\n const descField = this.findDescriptionField();\n if (descField) {\n group.DescriptionFieldName = descField;\n }\n\n const subtitleField = this.findSubtitleField(titleField);\n if (subtitleField) {\n group.SubtitleFieldName = subtitleField;\n }\n\n const imageField = this.findImageField();\n group.CardConfig = {\n collapsible: true,\n defaultExpanded: false,\n showDate: true,\n // A calendar day has no time: \"12:00 AM\" on it would be invented.\n dateFormat: this.isDateOnlyField(this.SelectedTimelineDateField) ? 'MMM d, yyyy' : 'MMM d, yyyy h:mm a',\n ...(imageField\n ? { imageField, imagePosition: 'left' as const, imageSize: 'small' as const }\n : {}),\n };\n\n this.TimelineGroups = [group];\n }\n\n /** Whether the named field of the current entity is a SQL `date` column (a calendar day). */\n private isDateOnlyField(fieldName: string): boolean {\n const field = this._entity?.Fields.find((f) => f.Name.toLowerCase() === fieldName.toLowerCase());\n return IsDateOnlySQLType(field?.Type);\n }\n\n /**\n * Find the best field to use as the event title: the entity's NameField, then a\n * `DefaultInView` string field matching a common name pattern, then the first string field.\n */\n private findTitleField(): string {\n if (!this._entity) {\n return 'ID';\n }\n if (this._entity.NameField) {\n return this._entity.NameField.Name;\n }\n\n const stringFields = this._entity.Fields.filter(\n (f) => f.TSType === EntityFieldTSType.String && f.DefaultInView && !f.Name.startsWith('__mj_'),\n ).sort((a, b) => a.Sequence - b.Sequence);\n\n const namePatterns = ['name', 'title', 'subject', 'label'];\n for (const pattern of namePatterns) {\n const match = stringFields.find((f) => f.Name.toLowerCase().includes(pattern));\n if (match) {\n return match.Name;\n }\n }\n\n return stringFields.length > 0 ? stringFields[0].Name : 'ID';\n }\n\n /** Find a suitable description field by common naming pattern, or null. */\n private findDescriptionField(): string | null {\n if (!this._entity) {\n return null;\n }\n const descPatterns = ['description', 'notes', 'summary', 'content', 'body', 'details'];\n const textFields = this._entity.Fields.filter(\n (f) => f.TSType === EntityFieldTSType.String && !f.Name.startsWith('__mj_'),\n );\n for (const pattern of descPatterns) {\n const match = textFields.find((f) => f.Name.toLowerCase().includes(pattern));\n if (match) {\n return match.Name;\n }\n }\n return null;\n }\n\n /**\n * Find a suitable subtitle field (different from the title): a `DefaultInView` string field\n * matching a classification pattern (status/type/category/...), else the first other string\n * field, else null.\n */\n private findSubtitleField(excludeField: string): string | null {\n if (!this._entity) {\n return null;\n }\n const patterns = ['status', 'type', 'category', 'state', 'priority'];\n const fields = this._entity.Fields.filter(\n (f) =>\n f.TSType === EntityFieldTSType.String &&\n f.DefaultInView &&\n f.Name !== excludeField &&\n !f.Name.startsWith('__mj_'),\n ).sort((a, b) => a.Sequence - b.Sequence);\n\n for (const pattern of patterns) {\n const match = fields.find((f) => f.Name.toLowerCase().includes(pattern));\n if (match) {\n return match.Name;\n }\n }\n\n const firstOther = fields.find((f) => f.Name !== excludeField);\n return firstOther?.Name || null;\n }\n\n /** Image field (ExtendedType='Image') so timeline cards crop a thumbnail, same as grid/cards. */\n private findImageField(): string | null {\n if (!this._entity) {\n return null;\n }\n const match = this._entity.Fields.find(\n (f) => f.ExtendedType === 'Image' && f.TSType === EntityFieldTSType.String,\n );\n return match?.Name ?? null;\n }\n}\n\n/**\n * Tree-shaking guard. Force-references the component class so bundlers don't drop this module\n * when it's only mounted dynamically via the view-type descriptor's `RendererComponent`.\n */\nexport function LoadTimelineViewRenderer(): void {\n // no-op; presence prevents tree-shaking of the dynamically-mounted renderer\n void TimelineViewRendererComponent;\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  import { Type, EventEmitter } from '@angular/core';
2
2
  import { EntityInfo, IMetadataProvider } from '@memberjunction/core';
3
+ import { ExportColumn } from '@memberjunction/export-engine';
3
4
  /**
4
5
  * View-Type Plugin Architecture — Contracts
5
6
  * -----------------------------------------
@@ -190,6 +191,13 @@ export interface IViewRenderer<TConfig = unknown> {
190
191
  * @returns true when the export was initiated, false when it couldn't be (no data / unsupported).
191
192
  */
192
193
  exportRecords?(format?: 'csv' | 'excel' | 'json'): Promise<boolean>;
194
+ /**
195
+ * Optional: the columns this renderer is showing, in on-screen order and with on-screen headers.
196
+ * A host that exports on the renderer's behalf (the workspace toolbar's Export) uses this so its
197
+ * export matches the screen. Renderers without a column layout (Cards, Map, Timeline) omit it and
198
+ * the host falls back to the view's saved columns.
199
+ */
200
+ GetExportColumns?(): ExportColumn[];
193
201
  }
194
202
  /**
195
203
  * A generic, view-type-agnostic request from a renderer for the host to change how it loads the
@@ -1 +1 @@
1
- {"version":3,"file":"view-type.contracts.d.ts","sourceRoot":"","sources":["../../../src/lib/view-types/view-type.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGrE;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;;;;;GAQG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,oFAAoF;IACpF,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,gFAAgF;IAChF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAE1C;;;;OAIG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAE5C;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAE1C;;;;;;;OAOG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAErC;;;;;;;OAOG;IACH,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC;IAE1E;;;;;;;;;OASG;IACH,sBAAsB,CAAC,CAAC,QAAQ,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtE;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa,CAAC,OAAO,GAAG,OAAO;IAC9C,mDAAmD;IACnD,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAE1B,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC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E,OAAO,CAAS;IAE5C;;;OAGG;IACH,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,iBAAiB,GAAG,OAAO;IAI3E;;;OAGG;IACG,sBAAsB,CAAC,SAAS,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;CAG3E;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAG5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"view-type.contracts.js","sourceRoot":"","sources":["../../../src/lib/view-types/view-type.contracts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAsQvD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAgB,sBAAsB;IAKjC,kBAAkB,CAAiB;IAE5C;;;;OAIG;IACM,sBAAsB,GAAY,KAAK,CAAC;IAEjD;;;;OAIG;IACM,iBAAiB,GAAY,KAAK,CAAC;IAE5C;;;OAGG;IACH,cAAc,CAAC,OAAmB,EAAE,SAA6B;QAC/D,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,sBAAsB,CAAC,SAA6B;QACxD,mBAAmB;IACrB,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB;IACnC,kFAAkF;IAClF,KAAK,aAAa,CAAC;AACrB,CAAC","sourcesContent":["import { Type, EventEmitter } from '@angular/core';\nimport { EntityInfo, IMetadataProvider } from '@memberjunction/core';\nimport { RegisterClass } from '@memberjunction/global';\n\n/**\n * View-Type Plugin Architecture — Contracts\n * -----------------------------------------\n * This file defines the framework-level contracts for the entity-viewer's pluggable\n * view-type system. A \"view type\" is a way of rendering a set of entity records — the\n * built-in ones being Grid, Cards, Timeline, and Map, with future additions like\n * Cluster and Tag Cloud.\n *\n * The design separates three concerns:\n * 1. {@link IViewTypeDescriptor} — metadata + availability + the component types to mount.\n * Descriptors are discovered at runtime via the {@link https MemberJunction ClassFactory}\n * keyed off the `DriverClass` stored in the `MJ: View Types` entity.\n * 2. {@link IViewRenderer} — the contract a renderer component honors so the host can\n * feed it data and listen for selection/open/config events uniformly.\n * 3. {@link IViewPropSheet} — the contract a configuration prop-sheet component honors.\n *\n * Because this lives in an Angular package, it is acceptable for the descriptor to reference\n * Angular's `Type<T>` (it points at the concrete component classes to instantiate).\n */\n\n/**\n * Framework-agnostic-ish descriptor for a single view type.\n *\n * A descriptor is the bridge between the `MJ: View Types` metadata row (which stores\n * the `DriverClass` name) and the concrete Angular components that actually render the\n * view and edit its configuration. Descriptors are registered with the ClassFactory via\n * `@RegisterClass(BaseViewTypeDescriptor, '<DriverClass>')` so they can be discovered by\n * name without a hard import from the host.\n */\nexport interface IViewTypeDescriptor {\n /**\n * Stable internal key for the view type — matches the `DriverClass` column on the\n * `MJ: View Types` entity and the `@RegisterClass` registration key\n * (e.g. \"GridViewType\", \"CardsViewType\").\n */\n readonly Name: string;\n\n /** User-facing label shown in the view-mode switcher (e.g. \"Grid\", \"Tag Cloud\"). */\n readonly DisplayName: string;\n\n /** Font Awesome icon class shown in the switcher (e.g. \"fa-solid fa-table\"). */\n readonly Icon: string;\n\n /**\n * The Angular component class that renders this view type. The host instantiates /\n * mounts this component and feeds it data per the {@link IViewRenderer} contract.\n */\n readonly RendererComponent: Type<unknown>;\n\n /**\n * Optional Angular component class for this view type's configuration prop-sheet\n * (honors {@link IViewPropSheet}). Undefined when the view type has no configurable\n * options.\n */\n readonly PropSheetComponent?: Type<unknown>;\n\n /**\n * When `true`, this view type's `config.gridState` is backed by the **canonical**\n * `UserView.GridState` column (the single, framework-wide store for a view's\n * columns / sort / filter / aggregates — also read by `MJUserViewEntity.Columns`,\n * the GraphQL data provider's field list, and export) rather than by an opaque\n * per-view-type blob in `DisplayState.viewTypeConfigs`.\n *\n * The container honors this by (a) seeding the renderer's `config.gridState` from\n * the canonical store and (b) routing the renderer's `configChanged.gridState`\n * back to it on persist. This keeps the grid, the config panel, the server query,\n * and export all reading/writing one source of truth. Defaults to `false`, so\n * non-grid view types (Cards/Timeline/Map) keep their opaque per-type config.\n */\n readonly UsesCanonicalGridState?: boolean;\n\n /**\n * When `true`, this view type ships its OWN in-view export affordance (e.g. the Grid renderer's\n * in-toolbar \"Export\" button + {@link IViewRenderer.exportRecords}). Hosts use this to decide\n * whether to render a FALLBACK export button for view types that DON'T (Cards / Map / Timeline),\n * so every view type can export without a duplicate button on the ones that already have one.\n * Defaults to `false`. This is read off the (synchronously-resolved) descriptor rather than the\n * mounted renderer instance, so it's correct the instant the active view type changes.\n */\n readonly ProvidesOwnExport?: boolean;\n\n /**\n * Predicate that decides whether this view type is available for a given entity.\n * For example, Timeline requires a date field; Map requires geocoding support.\n * Grid and Cards are always available.\n *\n * @param entity the entity the viewer is currently displaying\n * @param provider optional metadata provider (for multi-provider scenarios)\n */\n IsAvailableFor(entity: EntityInfo, provider?: IMetadataProvider): boolean;\n\n /**\n * Optional async hook to load any data this descriptor's {@link IsAvailableFor} predicate\n * depends on (e.g. the Cluster view type needs the set of entities that have an active\n * Entity Document with vectors). The host awaits this once — before computing availability —\n * so the synchronous predicate can read from a now-populated cache. Implementations should\n * be cheap/idempotent (typically `await SomeEngine.Instance.Config(false, ...)`). Omit when\n * availability is computable purely from the {@link EntityInfo} (Grid/Cards/Timeline/Map).\n *\n * @param provider optional metadata provider (for multi-provider scenarios)\n */\n EnsureAvailabilityData?(provider?: IMetadataProvider): Promise<void>;\n}\n\n/**\n * Contract honored by a view renderer component. The host binds these inputs and\n * subscribes to these outputs uniformly across all view types.\n *\n * @typeParam TConfig the shape of this view type's configuration object\n */\nexport interface IViewRenderer<TConfig = unknown> {\n /** The entity whose records are being rendered. */\n entity: EntityInfo | null;\n\n /** The records to render (already loaded/filtered by the host). */\n records: Record<string, unknown>[];\n\n /** Primary-key string of the currently selected record, if any. */\n selectedRecordId: string | null;\n\n /** Active filter text (for highlighting / client-side concerns). */\n filterText: string | null;\n\n /** View-type-specific configuration. */\n config: TConfig;\n\n /**\n * Optional: the metadata provider, handed to plug-ins that issue their own data calls\n * (multi-provider safety). Generic — not specific to any one view type.\n */\n provider?: IMetadataProvider | null;\n\n /**\n * Optional generic data-context the host supplies alongside {@link records}. These are\n * universal \"a view of records\" concepts (counts, current page, loading) — NOT specific to any\n * view type — so a renderer that paginates or shows a total can read them, and one that doesn't\n * simply ignores them. The host owns the actual data fetch; these describe its current result.\n */\n totalRecordCount?: number;\n /** One-based current page of {@link records} when the host is paginating. */\n page?: number;\n /** Page size the host is using. */\n pageSize?: number;\n /** Whether the host is currently (re)loading the record set. */\n isLoading?: boolean;\n\n /** Emitted when a record is selected (single click). Payload is the raw record object. */\n recordSelected: EventEmitter<unknown>;\n\n /**\n * Emitted when THIS entity's record should be opened (double-click / open). Payload is the raw\n * record. This is a NAVIGATION request — the only category of signal that legitimately bubbles\n * to the outer app (routing lives there). Everything else a view does (export, add-to-list,\n * delete, …) is self-contained in the plug-in via Generic dialogs and never bubbles up.\n */\n recordOpened: EventEmitter<unknown>;\n\n /**\n * Optional: NAVIGATION request to open a *related* record on a DIFFERENT entity (e.g. a\n * foreign-key drill-through in a grid cell). Bubbles to the outer app for routing. Generic —\n * the container forwards it without acting on it.\n */\n openRelatedRecordRequested?: EventEmitter<ViewRelatedRecordNavigation>;\n\n /**\n * Optional: NAVIGATION request to create a new record of the current entity (e.g. a grid's\n * \"New\" button) — opening the create form is a routing concern owned by the outer app. Bubbles\n * up; the container forwards it without acting on it.\n */\n createRecordRequested?: EventEmitter<void>;\n\n /**\n * Emitted when the renderer mutates its own opaque {@link config} (e.g. timeline date field,\n * grid columns/sort/widths, map render mode). The container persists the blob verbatim against\n * the active `ViewTypeID` and never inspects it. (Container ↔ plug-in coordination inside the\n * Generic layer — NOT a signal that drives the outer app.)\n */\n configChanged: EventEmitter<TConfig>;\n\n /**\n * Optional: ask the container to (re)load the record set differently. The ONLY data-access\n * channel a plug-in has, fully generic — the container honors the request (sort / page /\n * load-all) without knowing which plug-in asked or why. A grid emits sort/page; a map emits\n * `{ loadAll: true }`; a plug-in happy with the records it's given emits nothing. The container\n * owns the actual `RunView`; no per-view-type branching. (Container ↔ plug-in coordination —\n * NOT a signal that drives the outer app.)\n */\n dataRequest?: EventEmitter<ViewDataRequest>;\n\n /**\n * Optional: ask the host to open this view's configuration UI (e.g. the workspace's config\n * panel). Generic — every view type has configurable settings (the descriptor's\n * {@link IViewTypeDescriptor.PropSheetComponent}); a plug-in raises this when the user invokes\n * an in-renderer affordance for it (e.g. the grid's \"Manage Columns\" toolbar item). The\n * container forwards it to the host, which owns the config UI; no per-view-type branching.\n * (Container ↔ plug-in coordination — NOT a signal that drives the outer app.)\n */\n configureRequested?: EventEmitter<void>;\n\n /**\n * Optional IMPERATIVE export entry point. A renderer that owns a self-contained export\n * affordance (e.g. the grid's export dialog) may expose this so an external driver — the\n * host's programmatic API, ultimately the AI agent — can trigger an export of the current\n * record set WITHOUT going through the renderer's own toolbar UI. Renderers that don't\n * support export simply don't implement it (the host treats absence as \"not exportable\").\n *\n * This is NOT a navigation/UI-coordination signal — it's a direct method call the host makes\n * on the active renderer, mirroring how export is otherwise self-contained in the plug-in.\n *\n * @param format optional output format ('csv' | 'excel' | 'json'); the renderer picks a sensible\n * default (typically 'excel') when omitted.\n * @returns true when the export was initiated, false when it couldn't be (no data / unsupported).\n */\n exportRecords?(format?: 'csv' | 'excel' | 'json'): Promise<boolean>;\n}\n\n/**\n * A generic, view-type-agnostic request from a renderer for the host to change how it loads the\n * record set. Every field is optional; the host applies whatever is present. No field names a\n * specific view type — these are universal data-access concepts.\n */\nexport interface ViewDataRequest {\n /** Desired sort, applied to the host's RunView OrderBy. Empty/omitted clears sorting. */\n sort?: Array<{ field: string; direction: 'asc' | 'desc' }>;\n /** One-based page to load (for paginated views). */\n page?: number;\n /** Page size to load. */\n pageSize?: number;\n /** When true, the host loads the full result set (up to its safety cap) instead of paginating. */\n loadAll?: boolean;\n}\n\n/**\n * A NAVIGATION request to open a record on a (possibly different) entity — the generic payload\n * for {@link IViewRenderer.openRelatedRecordRequested}. Routing lives in the outer app, so this\n * is one of the few signals that legitimately bubbles up. The container forwards it untouched.\n */\nexport interface ViewRelatedRecordNavigation {\n /** The entity whose record should be opened. */\n entityName: string;\n /** The record's key — a composite-key string or the raw key value(s). Opaque to the container. */\n recordKey: unknown;\n}\n\n/**\n * Contract honored by a view-type configuration prop-sheet component.\n *\n * @typeParam TConfig the shape of the configuration object being edited\n */\nexport interface IViewPropSheet<TConfig = unknown> {\n /** The entity the configuration applies to. */\n entity: EntityInfo | null;\n\n /** The current configuration being edited. */\n config: TConfig;\n\n /** Emitted when the user changes the configuration. */\n configChange: EventEmitter<TConfig>;\n}\n\n/**\n * Abstract base class for all view-type descriptors.\n *\n * Concrete descriptors extend this and register themselves with the ClassFactory:\n *\n * ```typescript\n * @RegisterClass(BaseViewTypeDescriptor, 'GridViewType')\n * export class GridViewType extends BaseViewTypeDescriptor {\n * readonly Name = 'GridViewType';\n * readonly DisplayName = 'Grid';\n * readonly Icon = 'fa-solid fa-table';\n * readonly RendererComponent = EntityDataGridComponent;\n * IsAvailableFor(): boolean { return true; }\n * }\n * ```\n *\n * The {@link ViewTypeEngine} resolves descriptors by `DriverClass` name after\n * probing ClassFactory registrations, then `CreateInstance`. Unregistered keys\n * (e.g. a seeded TagCloud row) are omitted rather than falling back to this base.\n *\n * NOTE: This class is registered with the ClassFactory itself (via subclasses) and is\n * intentionally NOT decorated — only concrete subclasses carry `@RegisterClass`.\n */\nexport abstract class BaseViewTypeDescriptor implements IViewTypeDescriptor {\n abstract readonly Name: string;\n abstract readonly DisplayName: string;\n abstract readonly Icon: string;\n abstract readonly RendererComponent: Type<unknown>;\n readonly PropSheetComponent?: Type<unknown>;\n\n /**\n * Default: this view type uses its own opaque per-view-type config (stored in\n * `DisplayState.viewTypeConfigs`). Override to `true` in a view type that renders the\n * canonical grid columns (see {@link IViewTypeDescriptor.UsesCanonicalGridState}).\n */\n readonly UsesCanonicalGridState: boolean = false;\n\n /**\n * Default: this view type has no built-in export UI, so a host should provide a fallback Export\n * affordance. Override to `true` in a view type that ships its own export (see\n * {@link IViewTypeDescriptor.ProvidesOwnExport}).\n */\n readonly ProvidesOwnExport: boolean = false;\n\n /**\n * Default availability: available for every entity. Override in subclasses that have\n * requirements (e.g. Timeline needs a date field, Map needs geocoding).\n */\n IsAvailableFor(_entity: EntityInfo, _provider?: IMetadataProvider): boolean {\n return true;\n }\n\n /**\n * Default: nothing to preload. Override in subclasses whose availability predicate needs\n * async data (e.g. the Cluster view type loading which entities have Entity Documents).\n */\n async EnsureAvailabilityData(_provider?: IMetadataProvider): Promise<void> {\n // no-op by default\n }\n}\n\n/**\n * Tree-shaking guard. Force-references {@link RegisterClass} so bundlers don't drop the\n * decorator import in builds that only touch this contracts module. Concrete descriptor\n * modules each carry their own `@RegisterClass` and load guard, but this keeps the base\n * module self-consistent.\n */\nexport function LoadViewTypeContracts(): void {\n // no-op; presence prevents tree-shaking of this module's side-effect-free exports\n void RegisterClass;\n}\n"]}
1
+ {"version":3,"file":"view-type.contracts.js","sourceRoot":"","sources":["../../../src/lib/view-types/view-type.contracts.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AA8QvD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAgB,sBAAsB;IAKjC,kBAAkB,CAAiB;IAE5C;;;;OAIG;IACM,sBAAsB,GAAY,KAAK,CAAC;IAEjD;;;;OAIG;IACM,iBAAiB,GAAY,KAAK,CAAC;IAE5C;;;OAGG;IACH,cAAc,CAAC,OAAmB,EAAE,SAA6B;QAC/D,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,sBAAsB,CAAC,SAA6B;QACxD,mBAAmB;IACrB,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB;IACnC,kFAAkF;IAClF,KAAK,aAAa,CAAC;AACrB,CAAC","sourcesContent":["import { Type, EventEmitter } from '@angular/core';\nimport { EntityInfo, IMetadataProvider } from '@memberjunction/core';\nimport { ExportColumn } from '@memberjunction/export-engine';\nimport { RegisterClass } from '@memberjunction/global';\n\n/**\n * View-Type Plugin Architecture — Contracts\n * -----------------------------------------\n * This file defines the framework-level contracts for the entity-viewer's pluggable\n * view-type system. A \"view type\" is a way of rendering a set of entity records — the\n * built-in ones being Grid, Cards, Timeline, and Map, with future additions like\n * Cluster and Tag Cloud.\n *\n * The design separates three concerns:\n * 1. {@link IViewTypeDescriptor} — metadata + availability + the component types to mount.\n * Descriptors are discovered at runtime via the {@link https MemberJunction ClassFactory}\n * keyed off the `DriverClass` stored in the `MJ: View Types` entity.\n * 2. {@link IViewRenderer} — the contract a renderer component honors so the host can\n * feed it data and listen for selection/open/config events uniformly.\n * 3. {@link IViewPropSheet} — the contract a configuration prop-sheet component honors.\n *\n * Because this lives in an Angular package, it is acceptable for the descriptor to reference\n * Angular's `Type<T>` (it points at the concrete component classes to instantiate).\n */\n\n/**\n * Framework-agnostic-ish descriptor for a single view type.\n *\n * A descriptor is the bridge between the `MJ: View Types` metadata row (which stores\n * the `DriverClass` name) and the concrete Angular components that actually render the\n * view and edit its configuration. Descriptors are registered with the ClassFactory via\n * `@RegisterClass(BaseViewTypeDescriptor, '<DriverClass>')` so they can be discovered by\n * name without a hard import from the host.\n */\nexport interface IViewTypeDescriptor {\n /**\n * Stable internal key for the view type — matches the `DriverClass` column on the\n * `MJ: View Types` entity and the `@RegisterClass` registration key\n * (e.g. \"GridViewType\", \"CardsViewType\").\n */\n readonly Name: string;\n\n /** User-facing label shown in the view-mode switcher (e.g. \"Grid\", \"Tag Cloud\"). */\n readonly DisplayName: string;\n\n /** Font Awesome icon class shown in the switcher (e.g. \"fa-solid fa-table\"). */\n readonly Icon: string;\n\n /**\n * The Angular component class that renders this view type. The host instantiates /\n * mounts this component and feeds it data per the {@link IViewRenderer} contract.\n */\n readonly RendererComponent: Type<unknown>;\n\n /**\n * Optional Angular component class for this view type's configuration prop-sheet\n * (honors {@link IViewPropSheet}). Undefined when the view type has no configurable\n * options.\n */\n readonly PropSheetComponent?: Type<unknown>;\n\n /**\n * When `true`, this view type's `config.gridState` is backed by the **canonical**\n * `UserView.GridState` column (the single, framework-wide store for a view's\n * columns / sort / filter / aggregates — also read by `MJUserViewEntity.Columns`,\n * the GraphQL data provider's field list, and export) rather than by an opaque\n * per-view-type blob in `DisplayState.viewTypeConfigs`.\n *\n * The container honors this by (a) seeding the renderer's `config.gridState` from\n * the canonical store and (b) routing the renderer's `configChanged.gridState`\n * back to it on persist. This keeps the grid, the config panel, the server query,\n * and export all reading/writing one source of truth. Defaults to `false`, so\n * non-grid view types (Cards/Timeline/Map) keep their opaque per-type config.\n */\n readonly UsesCanonicalGridState?: boolean;\n\n /**\n * When `true`, this view type ships its OWN in-view export affordance (e.g. the Grid renderer's\n * in-toolbar \"Export\" button + {@link IViewRenderer.exportRecords}). Hosts use this to decide\n * whether to render a FALLBACK export button for view types that DON'T (Cards / Map / Timeline),\n * so every view type can export without a duplicate button on the ones that already have one.\n * Defaults to `false`. This is read off the (synchronously-resolved) descriptor rather than the\n * mounted renderer instance, so it's correct the instant the active view type changes.\n */\n readonly ProvidesOwnExport?: boolean;\n\n /**\n * Predicate that decides whether this view type is available for a given entity.\n * For example, Timeline requires a date field; Map requires geocoding support.\n * Grid and Cards are always available.\n *\n * @param entity the entity the viewer is currently displaying\n * @param provider optional metadata provider (for multi-provider scenarios)\n */\n IsAvailableFor(entity: EntityInfo, provider?: IMetadataProvider): boolean;\n\n /**\n * Optional async hook to load any data this descriptor's {@link IsAvailableFor} predicate\n * depends on (e.g. the Cluster view type needs the set of entities that have an active\n * Entity Document with vectors). The host awaits this once — before computing availability —\n * so the synchronous predicate can read from a now-populated cache. Implementations should\n * be cheap/idempotent (typically `await SomeEngine.Instance.Config(false, ...)`). Omit when\n * availability is computable purely from the {@link EntityInfo} (Grid/Cards/Timeline/Map).\n *\n * @param provider optional metadata provider (for multi-provider scenarios)\n */\n EnsureAvailabilityData?(provider?: IMetadataProvider): Promise<void>;\n}\n\n/**\n * Contract honored by a view renderer component. The host binds these inputs and\n * subscribes to these outputs uniformly across all view types.\n *\n * @typeParam TConfig the shape of this view type's configuration object\n */\nexport interface IViewRenderer<TConfig = unknown> {\n /** The entity whose records are being rendered. */\n entity: EntityInfo | null; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /** The records to render (already loaded/filtered by the host). */\n records: Record<string, unknown>[]; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /** Primary-key string of the currently selected record, if any. */\n selectedRecordId: string | null; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /** Active filter text (for highlighting / client-side concerns). */\n filterText: string | null; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /** View-type-specific configuration. */\n config: TConfig; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional: the metadata provider, handed to plug-ins that issue their own data calls\n * (multi-provider safety). Generic — not specific to any one view type.\n */\n provider?: IMetadataProvider | null; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional generic data-context the host supplies alongside {@link records}. These are\n * universal \"a view of records\" concepts (counts, current page, loading) — NOT specific to any\n * view type — so a renderer that paginates or shows a total can read them, and one that doesn't\n * simply ignores them. The host owns the actual data fetch; these describe its current result.\n */\n totalRecordCount?: number; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n /** One-based current page of {@link records} when the host is paginating. */\n page?: number; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n /** Page size the host is using. */\n pageSize?: number; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n /** Whether the host is currently (re)loading the record set. */\n isLoading?: boolean; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /** Emitted when a record is selected (single click). Payload is the raw record object. */\n recordSelected: EventEmitter<unknown>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Emitted when THIS entity's record should be opened (double-click / open). Payload is the raw\n * record. This is a NAVIGATION request — the only category of signal that legitimately bubbles\n * to the outer app (routing lives there). Everything else a view does (export, add-to-list,\n * delete, …) is self-contained in the plug-in via Generic dialogs and never bubbles up.\n */\n recordOpened: EventEmitter<unknown>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional: NAVIGATION request to open a *related* record on a DIFFERENT entity (e.g. a\n * foreign-key drill-through in a grid cell). Bubbles to the outer app for routing. Generic —\n * the container forwards it without acting on it.\n */\n openRelatedRecordRequested?: EventEmitter<ViewRelatedRecordNavigation>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional: NAVIGATION request to create a new record of the current entity (e.g. a grid's\n * \"New\" button) — opening the create form is a routing concern owned by the outer app. Bubbles\n * up; the container forwards it without acting on it.\n */\n createRecordRequested?: EventEmitter<void>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Emitted when the renderer mutates its own opaque {@link config} (e.g. timeline date field,\n * grid columns/sort/widths, map render mode). The container persists the blob verbatim against\n * the active `ViewTypeID` and never inspects it. (Container ↔ plug-in coordination inside the\n * Generic layer — NOT a signal that drives the outer app.)\n */\n configChanged: EventEmitter<TConfig>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional: ask the container to (re)load the record set differently. The ONLY data-access\n * channel a plug-in has, fully generic — the container honors the request (sort / page /\n * load-all) without knowing which plug-in asked or why. A grid emits sort/page; a map emits\n * `{ loadAll: true }`; a plug-in happy with the records it's given emits nothing. The container\n * owns the actual `RunView`; no per-view-type branching. (Container ↔ plug-in coordination —\n * NOT a signal that drives the outer app.)\n */\n dataRequest?: EventEmitter<ViewDataRequest>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional: ask the host to open this view's configuration UI (e.g. the workspace's config\n * panel). Generic — every view type has configurable settings (the descriptor's\n * {@link IViewTypeDescriptor.PropSheetComponent}); a plug-in raises this when the user invokes\n * an in-renderer affordance for it (e.g. the grid's \"Manage Columns\" toolbar item). The\n * container forwards it to the host, which owns the config UI; no per-view-type branching.\n * (Container ↔ plug-in coordination — NOT a signal that drives the outer app.)\n */\n configureRequested?: EventEmitter<void>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional IMPERATIVE export entry point. A renderer that owns a self-contained export\n * affordance (e.g. the grid's export dialog) may expose this so an external driver — the\n * host's programmatic API, ultimately the AI agent — can trigger an export of the current\n * record set WITHOUT going through the renderer's own toolbar UI. Renderers that don't\n * support export simply don't implement it (the host treats absence as \"not exportable\").\n *\n * This is NOT a navigation/UI-coordination signal — it's a direct method call the host makes\n * on the active renderer, mirroring how export is otherwise self-contained in the plug-in.\n *\n * @param format optional output format ('csv' | 'excel' | 'json'); the renderer picks a sensible\n * default (typically 'excel') when omitted.\n * @returns true when the export was initiated, false when it couldn't be (no data / unsupported).\n */\n exportRecords?(format?: 'csv' | 'excel' | 'json'): Promise<boolean>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional: the columns this renderer is showing, in on-screen order and with on-screen headers.\n * A host that exports on the renderer's behalf (the workspace toolbar's Export) uses this so its\n * export matches the screen. Renderers without a column layout (Cards, Map, Timeline) omit it and\n * the host falls back to the view's saved columns.\n */\n GetExportColumns?(): ExportColumn[];\n}\n\n/**\n * A generic, view-type-agnostic request from a renderer for the host to change how it loads the\n * record set. Every field is optional; the host applies whatever is present. No field names a\n * specific view type — these are universal data-access concepts.\n */\nexport interface ViewDataRequest {\n /** Desired sort, applied to the host's RunView OrderBy. Empty/omitted clears sorting. */\n sort?: Array<{ field: string; direction: 'asc' | 'desc' }>;\n /** One-based page to load (for paginated views). */\n page?: number;\n /** Page size to load. */\n pageSize?: number;\n /** When true, the host loads the full result set (up to its safety cap) instead of paginating. */\n loadAll?: boolean;\n}\n\n/**\n * A NAVIGATION request to open a record on a (possibly different) entity — the generic payload\n * for {@link IViewRenderer.openRelatedRecordRequested}. Routing lives in the outer app, so this\n * is one of the few signals that legitimately bubbles up. The container forwards it untouched.\n */\nexport interface ViewRelatedRecordNavigation {\n /** The entity whose record should be opened. */\n entityName: string;\n /** The record's key — a composite-key string or the raw key value(s). Opaque to the container. */\n recordKey: unknown;\n}\n\n/**\n * Contract honored by a view-type configuration prop-sheet component.\n *\n * @typeParam TConfig the shape of the configuration object being edited\n */\nexport interface IViewPropSheet<TConfig = unknown> {\n /** The entity the configuration applies to. */\n entity: EntityInfo | null; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /** The current configuration being edited. */\n config: TConfig; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /** Emitted when the user changes the configuration. */\n configChange: EventEmitter<TConfig>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n}\n\n/**\n * Abstract base class for all view-type descriptors.\n *\n * Concrete descriptors extend this and register themselves with the ClassFactory:\n *\n * ```typescript\n * @RegisterClass(BaseViewTypeDescriptor, 'GridViewType')\n * export class GridViewType extends BaseViewTypeDescriptor {\n * readonly Name = 'GridViewType';\n * readonly DisplayName = 'Grid';\n * readonly Icon = 'fa-solid fa-table';\n * readonly RendererComponent = EntityDataGridComponent;\n * IsAvailableFor(): boolean { return true; }\n * }\n * ```\n *\n * The {@link ViewTypeEngine} resolves descriptors by `DriverClass` name after\n * probing ClassFactory registrations, then `CreateInstance`. Unregistered keys\n * (e.g. a seeded TagCloud row) are omitted rather than falling back to this base.\n *\n * NOTE: This class is registered with the ClassFactory itself (via subclasses) and is\n * intentionally NOT decorated — only concrete subclasses carry `@RegisterClass`.\n */\nexport abstract class BaseViewTypeDescriptor implements IViewTypeDescriptor {\n abstract readonly Name: string;\n abstract readonly DisplayName: string;\n abstract readonly Icon: string;\n abstract readonly RendererComponent: Type<unknown>;\n readonly PropSheetComponent?: Type<unknown>;\n\n /**\n * Default: this view type uses its own opaque per-view-type config (stored in\n * `DisplayState.viewTypeConfigs`). Override to `true` in a view type that renders the\n * canonical grid columns (see {@link IViewTypeDescriptor.UsesCanonicalGridState}).\n */\n readonly UsesCanonicalGridState: boolean = false;\n\n /**\n * Default: this view type has no built-in export UI, so a host should provide a fallback Export\n * affordance. Override to `true` in a view type that ships its own export (see\n * {@link IViewTypeDescriptor.ProvidesOwnExport}).\n */\n readonly ProvidesOwnExport: boolean = false;\n\n /**\n * Default availability: available for every entity. Override in subclasses that have\n * requirements (e.g. Timeline needs a date field, Map needs geocoding).\n */\n IsAvailableFor(_entity: EntityInfo, _provider?: IMetadataProvider): boolean {\n return true;\n }\n\n /**\n * Default: nothing to preload. Override in subclasses whose availability predicate needs\n * async data (e.g. the Cluster view type loading which entities have Entity Documents).\n */\n async EnsureAvailabilityData(_provider?: IMetadataProvider): Promise<void> {\n // no-op by default\n }\n}\n\n/**\n * Tree-shaking guard. Force-references {@link RegisterClass} so bundlers don't drop the\n * decorator import in builds that only touch this contracts module. Concrete descriptor\n * modules each carry their own `@RegisterClass` and load guard, but this keeps the base\n * module self-consistent.\n */\nexport function LoadViewTypeContracts(): void {\n // no-op; presence prevents tree-shaking of this module's side-effect-free exports\n void RegisterClass;\n}\n"]}