@memberjunction/ng-base-forms 6.1.0-edge.2 → 6.1.0-edge.3
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.
- package/LICENSE +180 -4
- package/README.md +4 -1
- package/dist/lib/base-form-component.d.ts +93 -3
- package/dist/lib/base-form-component.d.ts.map +1 -1
- package/dist/lib/base-form-component.js +240 -9
- package/dist/lib/base-form-component.js.map +1 -1
- package/dist/lib/chrome/base-form-policy.d.ts +26 -0
- package/dist/lib/chrome/base-form-policy.d.ts.map +1 -0
- package/dist/lib/chrome/base-form-policy.js +9 -0
- package/dist/lib/chrome/base-form-policy.js.map +1 -0
- package/dist/lib/chrome/clipped-title.d.ts +8 -0
- package/dist/lib/chrome/clipped-title.d.ts.map +1 -0
- package/dist/lib/chrome/clipped-title.js +18 -0
- package/dist/lib/chrome/clipped-title.js.map +1 -0
- package/dist/lib/chrome/form-chrome-coordinator.service.d.ts +35 -0
- package/dist/lib/chrome/form-chrome-coordinator.service.d.ts.map +1 -0
- package/dist/lib/chrome/form-chrome-coordinator.service.js +96 -0
- package/dist/lib/chrome/form-chrome-coordinator.service.js.map +1 -0
- package/dist/lib/chrome/form-chrome-rail-pref.d.ts +24 -0
- package/dist/lib/chrome/form-chrome-rail-pref.d.ts.map +1 -0
- package/dist/lib/chrome/form-chrome-rail-pref.js +52 -0
- package/dist/lib/chrome/form-chrome-rail-pref.js.map +1 -0
- package/dist/lib/chrome/form-chrome.d.ts +59 -0
- package/dist/lib/chrome/form-chrome.d.ts.map +1 -0
- package/dist/lib/chrome/form-chrome.js +37 -0
- package/dist/lib/chrome/form-chrome.js.map +1 -0
- package/dist/lib/chrome/load-form-chrome-rules.d.ts +8 -0
- package/dist/lib/chrome/load-form-chrome-rules.d.ts.map +1 -0
- package/dist/lib/chrome/load-form-chrome-rules.js +70 -0
- package/dist/lib/chrome/load-form-chrome-rules.js.map +1 -0
- package/dist/lib/chrome/resolve-form-chrome.d.ts +114 -0
- package/dist/lib/chrome/resolve-form-chrome.d.ts.map +1 -0
- package/dist/lib/chrome/resolve-form-chrome.js +713 -0
- package/dist/lib/chrome/resolve-form-chrome.js.map +1 -0
- package/dist/lib/container/record-form-container.component.d.ts +170 -6
- package/dist/lib/container/record-form-container.component.d.ts.map +1 -1
- package/dist/lib/container/record-form-container.component.js +1194 -62
- package/dist/lib/container/record-form-container.component.js.map +1 -1
- package/dist/lib/explorer-entity-data-grid.component.d.ts +54 -1
- package/dist/lib/explorer-entity-data-grid.component.d.ts.map +1 -1
- package/dist/lib/explorer-entity-data-grid.component.js +143 -7
- package/dist/lib/explorer-entity-data-grid.component.js.map +1 -1
- package/dist/lib/form-record-refresh.coordinator.d.ts +27 -0
- package/dist/lib/form-record-refresh.coordinator.d.ts.map +1 -0
- package/dist/lib/form-record-refresh.coordinator.js +33 -0
- package/dist/lib/form-record-refresh.coordinator.js.map +1 -0
- package/dist/lib/form-state.interface.d.ts +4 -0
- package/dist/lib/form-state.interface.d.ts.map +1 -1
- package/dist/lib/form-state.interface.js.map +1 -1
- package/dist/lib/form-state.service.d.ts +5 -0
- package/dist/lib/form-state.service.d.ts.map +1 -1
- package/dist/lib/form-state.service.js +23 -2
- package/dist/lib/form-state.service.js.map +1 -1
- package/dist/lib/host/entity-form-host.component.d.ts +5 -1
- package/dist/lib/host/entity-form-host.component.d.ts.map +1 -1
- package/dist/lib/host/entity-form-host.component.js +16 -2
- package/dist/lib/host/entity-form-host.component.js.map +1 -1
- package/dist/lib/isa-related-panel/isa-related-panel.component.d.ts +6 -2
- package/dist/lib/isa-related-panel/isa-related-panel.component.d.ts.map +1 -1
- package/dist/lib/isa-related-panel/isa-related-panel.component.js +15 -1
- package/dist/lib/isa-related-panel/isa-related-panel.component.js.map +1 -1
- package/dist/lib/panel/collapsible-panel.component.d.ts +24 -2
- package/dist/lib/panel/collapsible-panel.component.d.ts.map +1 -1
- package/dist/lib/panel/collapsible-panel.component.js +104 -10
- package/dist/lib/panel/collapsible-panel.component.js.map +1 -1
- package/dist/lib/panel-slot/base-form-panel.d.ts +85 -1
- package/dist/lib/panel-slot/base-form-panel.d.ts.map +1 -1
- package/dist/lib/panel-slot/base-form-panel.js +72 -3
- package/dist/lib/panel-slot/base-form-panel.js.map +1 -1
- package/dist/lib/panel-slot/collect-form-panel-registrations.d.ts +8 -0
- package/dist/lib/panel-slot/collect-form-panel-registrations.d.ts.map +1 -0
- package/dist/lib/panel-slot/collect-form-panel-registrations.js +19 -0
- package/dist/lib/panel-slot/collect-form-panel-registrations.js.map +1 -0
- package/dist/lib/panel-slot/form-contribution.d.ts +79 -0
- package/dist/lib/panel-slot/form-contribution.d.ts.map +1 -0
- package/dist/lib/panel-slot/form-contribution.js +253 -0
- package/dist/lib/panel-slot/form-contribution.js.map +1 -0
- package/dist/lib/panel-slot/form-contributions.component.d.ts +27 -0
- package/dist/lib/panel-slot/form-contributions.component.d.ts.map +1 -0
- package/dist/lib/panel-slot/form-contributions.component.js +83 -0
- package/dist/lib/panel-slot/form-contributions.component.js.map +1 -0
- package/dist/lib/panel-slot/form-panel-slot.component.d.ts +2 -0
- package/dist/lib/panel-slot/form-panel-slot.component.d.ts.map +1 -1
- package/dist/lib/panel-slot/form-panel-slot.component.js +35 -4
- package/dist/lib/panel-slot/form-panel-slot.component.js.map +1 -1
- package/dist/lib/panel-slot/related-entity-grid-panel.component.d.ts +22 -0
- package/dist/lib/panel-slot/related-entity-grid-panel.component.d.ts.map +1 -0
- package/dist/lib/panel-slot/related-entity-grid-panel.component.js +78 -0
- package/dist/lib/panel-slot/related-entity-grid-panel.component.js.map +1 -0
- package/dist/lib/related-grid-height.d.ts +20 -0
- package/dist/lib/related-grid-height.d.ts.map +1 -0
- package/dist/lib/related-grid-height.js +30 -0
- package/dist/lib/related-grid-height.js.map +1 -0
- package/dist/lib/section-manager/section-manager.component.d.ts +20 -1
- package/dist/lib/section-manager/section-manager.component.d.ts.map +1 -1
- package/dist/lib/section-manager/section-manager.component.js +204 -25
- package/dist/lib/section-manager/section-manager.component.js.map +1 -1
- package/dist/lib/toolbar/form-toolbar.component.d.ts +55 -4
- package/dist/lib/toolbar/form-toolbar.component.d.ts.map +1 -1
- package/dist/lib/toolbar/form-toolbar.component.js +734 -306
- package/dist/lib/toolbar/form-toolbar.component.js.map +1 -1
- package/dist/lib/types/form-events.d.ts +35 -0
- package/dist/lib/types/form-events.d.ts.map +1 -1
- package/dist/lib/types/form-events.js +45 -0
- package/dist/lib/types/form-events.js.map +1 -1
- package/dist/lib/types/form-toolbar-item.d.ts +145 -0
- package/dist/lib/types/form-toolbar-item.d.ts.map +1 -0
- package/dist/lib/types/form-toolbar-item.js +2 -0
- package/dist/lib/types/form-toolbar-item.js.map +1 -0
- package/dist/lib/types/form-types.d.ts +8 -0
- package/dist/lib/types/form-types.d.ts.map +1 -1
- package/dist/lib/types/form-types.js.map +1 -1
- package/dist/lib/types/toolbar-config.d.ts +7 -2
- package/dist/lib/types/toolbar-config.d.ts.map +1 -1
- package/dist/lib/types/toolbar-config.js +6 -0
- package/dist/lib/types/toolbar-config.js.map +1 -1
- package/dist/module.d.ts +17 -14
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +14 -0
- package/dist/module.js.map +1 -1
- package/dist/public-api.d.ts +13 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +14 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +19 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-form-component.js","sourceRoot":"","sources":["../../src/lib/base-form-component.ts"],"names":[],"mappings":"AAAA,OAAO,EAC6B,SAAS,EAC3C,YAAY,EAAa,UAAU,EAAE,iBAAiB,EACtD,MAAM,EAAE,YAAY,EAAE,MAAM,EAC7B,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAgB,YAAY,EAAE,MAAM,MAAM,CAAC;AAC3D,OAAO,EACL,UAAU,EAAgC,oBAAoB,EAErC,QAAQ,EACgB,OAAO,EACzD,MAAM,sB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UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,CAAC;YACpG,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,QAAQ,GAAG,yBAAyB,GAAG,CAAC,CAAC;YAC/C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;YAC7E,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,CAAC;QACpG,CAAC;IACH,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,iBAAiB;QAC5B,MAAM,IAAI,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACjD,CAAC;IAED;;;OAGG;IACI,kBAAkB;QACvB,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACI,yBAAyB;QAC9B,4DAA4D;QAC5D,mEAAmE;IACrE,CAAC;iPA5/BmB,iBAAiB,yBAAjB,iBAAiB;6DAAjB,iBAAiB;2BAuHvB,2BAA2B;;;;;;iFAvHrB,iBAAiB;cADtC,SAAS;;kBAwFP,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAON,MAAM;;kBAON,YAAY;mBAAC,2BAA2B","sourcesContent":["import {\n AfterViewInit, OnInit, OnDestroy, Directive,\n ViewChildren, QueryList, ElementRef, ChangeDetectorRef,\n Output, EventEmitter, inject\n} from '@angular/core';\n\nimport { Subject, Subscription, debounceTime } from 'rxjs';\nimport {\n EntityInfo, ValidationResult, BaseEntity, EntityPermissionType,\n EntityRelationshipInfo, EntityOrganicKeyInfo, EntityOrganicKeyRelatedEntityInfo,\n Metadata, RunViewParams, LogError,\n RecordDependency, BaseEntityEvent, CompositeKey, RunView, RunViewResult\n} from '@memberjunction/core';\nimport { MJEventType, MJGlobal, ValidationErrorInfo } from '@memberjunction/global';\nimport { FormEditingCompleteEvent, PendingRecordItem, BaseFormComponentEventCodes } from '@memberjunction/ng-base-types';\nimport { MJListEntity } from '@memberjunction/core-entities';\n\nimport { BaseRecordComponent } from './base-record-component';\nimport { BaseFormSectionInfo } from './base-form-section-info';\nimport { MjCollapsiblePanelComponent } from './panel/collapsible-panel.component';\nimport { FormNavigationEvent } from './types/navigation-events';\nimport {\n FormContext,\n FormNotificationEvent,\n RecordSavedEvent,\n RecordDeletedEvent,\n RecordSaveFailedEvent,\n RecordDeleteFailedEvent,\n ValidationFailedEvent\n} from './types/form-types';\nimport { FormStateService } from './form-state.service';\nimport { EntityFormConfig } from './types/entity-form-config';\n\n/**\n * Abstract base class for all entity record forms in MemberJunction.\n *\n * Generated forms (via CodeGen) and custom forms extend this class.\n * It provides core form logic — section management, validation, pending records,\n * permissions, favorites, related entity helpers — with ZERO Explorer dependencies.\n *\n * Instead of calling Explorer services directly, events are emitted via @Output:\n * - **Navigate**: Form navigation requests (record links, new records, external links)\n * - **Notification**: User-facing notifications (save success, validation errors, etc.)\n * - **RecordSaved**: Emitted after a successful save\n * - **RecordDeleted**: Emitted after a successful delete\n *\n * The host application (e.g. SingleRecordComponent in Explorer) subscribes to\n * these events and maps them to its own services (NavigationService, SharedService, etc.).\n */\n@Directive()\nexport abstract class BaseFormComponent extends BaseRecordComponent implements AfterViewInit, OnInit, OnDestroy {\n public EditMode: boolean = false;\n public FavoriteInitDone: boolean = false;\n\n /**\n * Per-instance presentation config (toolbar visibility, related-entity\n * sections, collapsibility, width, in-form navigation). Set by the form host\n * (`MjEntityFormHostComponent`) or any consumer that instantiates the form\n * directly. Read back by `MjRecordFormContainerComponent` and the collapsible\n * panels through the `FormComponent` reference, so it takes effect WITHOUT\n * regenerating the CodeGen-produced template. Null means \"use the container's\n * own defaults\" (the classic full-page tab behavior).\n */\n public Config: EntityFormConfig | null = null;\n\n /**\n * Variants applicable to the current (entity, user) tuple, supplied by the\n * Explorer-level form resolver. When more than one entry is present, the\n * record-form-container shows a picker that lets the user switch between\n * variants. Empty / single-entry arrays hide the picker.\n *\n * The container reads this via its `EffectiveVariants` accessor — generated\n * form templates do NOT need to bind it explicitly.\n */\n public Variants: { ID: string; Label: string; Scope: 'User' | 'Role' | 'Global'; Status: 'Active' | 'Pending' | 'Inactive' }[] = [];\n\n /**\n * ID of the currently-rendered variant (null when no override is active and\n * the form is the CodeGen / @RegisterClass default).\n */\n public CurrentVariantID: string | null = null;\n\n /**\n * Hook called when the user picks a different variant from the picker.\n * Default is a no-op; the Explorer-level single-record component replaces\n * this on the form instance to wire `FormResolverService.SetSelectedVariant`\n * and reload the record. Kept as a method (not an EventEmitter) so the host\n * doesn't need to subscribe — assignment is enough.\n */\n public OnVariantChanged: (variantID: string | null) => void = (_id) => {\n // host installs the real handler post-construction\n };\n public isHistoryDialogOpen: boolean = false;\n public IsTagsPanelOpen: boolean = false;\n public TagCount: number = 0;\n public showDeleteDialog: boolean = false;\n public showCreateDialog: boolean = false;\n\n /**\n * Height of the top area when a splitter layout is used.\n * Referenced by CodeGen-generated templates for entities with \"top area\" sections.\n */\n public TopAreaHeight: string = '300px';\n\n /**\n * Size of the top area as a percentage (0-100) for angular-split.\n * Used by CodeGen-generated templates with as-split.\n */\n public TopAreaSize: number = 40;\n\n /**\n * Size of the bottom area as a percentage (0-100) for angular-split.\n * Used by CodeGen-generated templates with as-split.\n */\n public BottomAreaSize: number = 60;\n\n /**\n * Called when the splitter layout changes (for entities with \"top area\" sections).\n * No-op in the generic version; override in host application if splitter resizing is needed.\n */\n public splitterLayoutChange(): void {\n // No-op — host application can override\n }\n\n private _pendingRecords: PendingRecordItem[] = [];\n\n // #region Injected Dependencies (no constructor params)\n\n protected elementRef = inject(ElementRef);\n public cdr = inject(ChangeDetectorRef);\n protected formStateService = inject(FormStateService);\n\n // #endregion\n\n // #region @Output Events\n\n /** Emitted when navigation is requested (record link, external link, email, new record, etc.) */\n @Output() Navigate = new EventEmitter<FormNavigationEvent>();\n\n /** Emitted when a user-facing notification should be shown */\n @Output() Notification = new EventEmitter<FormNotificationEvent>();\n\n /** Emitted after a record is saved successfully */\n @Output() RecordSaved = new EventEmitter<RecordSavedEvent>();\n\n /** Emitted after a record is deleted successfully */\n @Output() RecordDeleted = new EventEmitter<RecordDeletedEvent>();\n\n /** Emitted when a record save fails */\n @Output() RecordSaveFailed = new EventEmitter<RecordSaveFailedEvent>();\n\n /** Emitted when a record delete fails */\n @Output() RecordDeleteFailed = new EventEmitter<RecordDeleteFailedEvent>();\n\n /** Emitted when validation fails before save */\n @Output() ValidationFailed = new EventEmitter<ValidationFailedEvent>();\n\n /**\n * Emitted once after ngOnInit completes and the record is fully initialized\n * (favorites loaded, form state initialized). This is the safe point for\n * the container to start loading badge counts and other record-dependent data.\n */\n @Output() RecordReady = new EventEmitter<BaseEntity>();\n\n // #endregion\n\n /** Subscription to form state changes */\n private formStateSubscription?: Subscription;\n\n @ViewChildren(MjCollapsiblePanelComponent) collapsiblePanels!: QueryList<MjCollapsiblePanelComponent>;\n\n async ngOnInit() {\n if (this.record) {\n if (!this.record.IsSaved) {\n this.StartEditMode();\n }\n const md = this.ProviderToUse;\n // Bind FormStateService to the same provider this form is using.\n this.formStateService.Provider = md;\n this._isFavorite = await md.GetRecordFavoriteStatus(md.CurrentUser.ID, this.record.EntityInfo.Name, this.record.PrimaryKey);\n this.FavoriteInitDone = true;\n\n // Initialize form state from User Settings\n const entityName = this.getEntityName();\n if (entityName) {\n await this.formStateService.initializeState(entityName);\n this.formStateSubscription = this.formStateService.getState$(entityName).subscribe(state => {\n this.showEmptyFields = state.showEmptyFields;\n this.cdr.markForCheck();\n });\n }\n }\n\n // Signal that the record is fully initialized and ready for dependent operations\n if (this.record) {\n this.RecordReady.emit(this.record);\n }\n\n // Set up debounced filter subscription\n this.filterSubscription = this.filterSubject\n .pipe(debounceTime(100))\n .subscribe(searchTerm => {\n this.searchFilter = searchTerm;\n // After change detection propagates FormContext to panels and they update\n // their IsVisible state, expand any visible (matching) sections that are collapsed\n if (searchTerm) {\n Promise.resolve().then(() => this.expandMatchingSections());\n }\n });\n }\n\n ngAfterViewInit(): void {\n // Subclasses can override for post-view-init logic\n }\n\n ngOnDestroy(): void {\n if (this.filterSubscription) {\n this.filterSubscription.unsubscribe();\n }\n if (this.formStateSubscription) {\n this.formStateSubscription.unsubscribe();\n }\n }\n\n // #region Pending Records\n\n protected get PendingRecords(): PendingRecordItem[] {\n return this._pendingRecords;\n }\n\n /**\n * Unsaved changes a form holds OUTSIDE its record's fields and pending records.\n *\n * A form whose sections own editors — a flow canvas, a designer, a grid — accumulates edits that\n * neither `record.Dirty` nor `PendingRecordsDirty()` can see, because nothing on the entity\n * changed. Without this the toolbar reports \"no changes\" while the user is looking at their own\n * work, and the navigate-away guard lets them lose it silently.\n *\n * Default `false`, so no existing form changes behaviour. Override to consult whatever holds the\n * extra state.\n */\n public get HasAdditionalUnsavedChanges(): boolean {\n return false;\n }\n\n protected PendingRecordsDirty(): boolean {\n this.PopulatePendingRecords();\n const pendingRecords = this.PendingRecords;\n if (pendingRecords && pendingRecords.length > 0) {\n for (const p of pendingRecords) {\n if (p.action === 'delete')\n return true;\n else if (p.entityObject.Dirty)\n return true;\n }\n }\n return false;\n }\n\n protected PopulatePendingRecords() {\n this._pendingRecords = [];\n this.RaiseEvent(BaseFormComponentEventCodes.EDITING_COMPLETE);\n const result = this.RaiseEvent(BaseFormComponentEventCodes.POPULATE_PENDING_RECORDS);\n if (result && result.pendingChanges) {\n for (const p of result.pendingChanges)\n this.PendingRecords.push(p);\n }\n }\n\n protected ValidatePendingRecords(): ValidationResult[] {\n const results: ValidationResult[] = [];\n for (let i = 0; i < this._pendingRecords.length; i++) {\n const pendingRecord = this._pendingRecords[i];\n results.push(pendingRecord.entityObject.Validate());\n }\n return results;\n }\n\n // #endregion\n\n // #region Edit Mode\n\n public StartEditMode(): void {\n this.EditMode = true;\n const entityName = this.getEntityName();\n if (entityName) {\n this.formStateService.setEditMode(entityName, true);\n }\n }\n\n public EndEditMode(): void {\n this.EditMode = false;\n this.clearValidationState();\n const entityName = this.getEntityName();\n if (entityName) {\n this.formStateService.setEditMode(entityName, false);\n }\n }\n\n public handleHistoryDialog(): void {\n this.isHistoryDialogOpen = !this.isHistoryDialogOpen;\n }\n\n public HandleTagsPanel(): void {\n this.IsTagsPanelOpen = !this.IsTagsPanelOpen;\n }\n\n // #endregion\n\n // #region Core Form Operations\n\n public Validate(): ValidationResult {\n const valResults = (<BaseEntity>this.record).Validate();\n const pendingValResults = this.ValidatePendingRecords();\n for (let i = 0; i < pendingValResults.length; i++) {\n const pendingValResult = pendingValResults[i];\n if (!pendingValResult.Success) {\n valResults.Success = false;\n valResults.Errors.push(...pendingValResult.Errors);\n }\n }\n return valResults;\n }\n\n protected RaiseEvent(eventCode: BaseFormComponentEventCodes) {\n const event = new FormEditingCompleteEvent();\n event.elementRef = this.elementRef;\n event.subEventCode = eventCode;\n\n MJGlobal.Instance.RaiseEvent({\n event: MJEventType.ComponentEvent,\n component: this,\n eventCode: BaseFormComponentEventCodes.BASE_CODE,\n args: event\n });\n\n return event;\n }\n\n public async SaveRecord(StopEditModeAfterSave: boolean): Promise<boolean> {\n try {\n try {\n (document.activeElement as HTMLElement).blur();\n this.RaiseEvent(BaseFormComponentEventCodes.EDITING_COMPLETE);\n } catch (_e) {\n // ignore blur errors\n }\n\n if (this.record) {\n this.PopulatePendingRecords();\n const valResults = this.Validate();\n if (valResults.Success) {\n const result = await this.InternalSaveRecord();\n if (result) {\n this._pendingRecords = [];\n this.clearValidationState();\n if (StopEditModeAfterSave)\n this.EndEditMode();\n\n this.Notification.emit({ Message: 'Record saved successfully', Type: 'success', Duration: 2500 });\n this.RecordSaved.emit({\n EntityName: this.record.EntityInfo.Name,\n RecordId: this.record.PrimaryKey.ToString(),\n Result: { Success: true }\n });\n return true;\n } else {\n const serverMsg = this.record.LatestResult?.Message || '';\n const errorMsg = serverMsg ? `Save failed: ${serverMsg}` : 'Error saving record';\n this.Notification.emit({ Message: errorMsg, Type: 'error', Duration: 5000 });\n this.RecordSaveFailed.emit({ EntityName: this.record.EntityInfo.Name, ErrorMessage: errorMsg });\n }\n } else {\n // Broadcast validation errors to all fields via FormContext\n this._showValidation = true;\n this._validationErrors = valResults.Errors;\n this.cdr.markForCheck();\n\n const errorMessages = valResults.Errors.map(x => x.Message);\n this.Notification.emit({\n Message: 'Validation Errors\\n' + errorMessages.join('\\n'),\n Type: 'warning',\n Duration: 5000\n });\n this.ValidationFailed.emit({ EntityName: this.record.EntityInfo.Name, Errors: errorMessages });\n }\n }\n\n LogError(\"Could not save record: Record not found\");\n return false;\n } catch (e) {\n const errorMsg = 'Error saving record: ' + e;\n this.Notification.emit({ Message: errorMsg, Type: 'error', Duration: 5000 });\n if (this.record) {\n this.RecordSaveFailed.emit({ EntityName: this.record.EntityInfo.Name, ErrorMessage: errorMsg });\n }\n return false;\n }\n }\n\n public CancelEdit() {\n if (this.record) {\n const r = <BaseEntity>this.record;\n // Capture BEFORE any mutation — Revert() can clear the \"new\" flag on some\n // entities. We need to know whether this record was ever persisted so we\n // can tell the host to dismiss the form (there's nothing to view).\n const wasNeverSaved = !r.IsSaved;\n\n if (r.Dirty || this.PendingRecordsDirty()) {\n // Revert is safe here — the toolbar's discard dialog already confirmed with the user\n r.Revert();\n\n const pendingRecords = this.PendingRecords;\n if (pendingRecords && pendingRecords.length > 0) {\n pendingRecords.forEach(p => {\n if (p.action === 'save')\n p.entityObject.Revert();\n });\n }\n this.RaiseEvent(BaseFormComponentEventCodes.REVERT_PENDING_CHANGES);\n }\n this.EndEditMode();\n\n // For never-saved records, ask the host to dismiss the form — leaving it\n // in view mode shows an empty record (there IS no record) and any\n // subsequent \"Create New\" click for the same entity would silently\n // reuse this abandoned form. Hosts that don't have a meaningful close\n // semantic can ignore this event.\n if (wasNeverSaved) {\n this.Navigate.emit({ Kind: 'dismiss', Reason: 'new-record-discarded' });\n }\n }\n }\n\n protected async InternalSaveRecord(): Promise<boolean> {\n if (this.record) {\n if (this._pendingRecords.length > 0) {\n const md = this.ProviderToUse;\n const tg = await md.CreateTransactionGroup();\n this.record.TransactionGroup = tg;\n await this.record.Save();\n\n for (const x of this._pendingRecords) {\n x.entityObject.TransactionGroup = tg;\n if (x.action === 'save') {\n await x.entityObject.Save();\n } else {\n await x.entityObject.Delete();\n }\n }\n return await tg.Submit();\n } else {\n return await this.record.Save();\n }\n } else {\n return false;\n }\n }\n\n public async Wait(duration: number): Promise<void> {\n return new Promise<void>(resolve => setTimeout(resolve, duration));\n }\n\n // #endregion\n\n // #region Permissions\n\n private _userPermissions: { permission: EntityPermissionType; canDo: boolean }[] = [];\n\n public CheckUserPermission(type: EntityPermissionType): boolean {\n try {\n if (this.record) {\n const perm = this._userPermissions.find(x => x.permission === type);\n if (perm)\n return perm.canDo;\n else {\n const result = this.record.CheckPermissions(type, false);\n this._userPermissions.push({ permission: type, canDo: result });\n return result;\n }\n } else {\n return false;\n }\n } catch (e) {\n LogError(e);\n return false;\n }\n }\n\n public get UserCanEdit(): boolean {\n return this.CheckUserPermission(EntityPermissionType.Update);\n }\n\n public get UserCanRead(): boolean {\n return this.CheckUserPermission(EntityPermissionType.Read);\n }\n\n public get UserCanCreate(): boolean {\n return this.CheckUserPermission(EntityPermissionType.Create);\n }\n\n public get UserCanDelete(): boolean {\n return this.CheckUserPermission(EntityPermissionType.Delete);\n }\n\n // #endregion\n\n // #region Grid Edit Mode\n\n public GridEditMode(): \"None\" | \"Save\" | \"Queue\" {\n return this.EditMode ? \"Queue\" : \"None\";\n }\n\n // #endregion\n\n // #region Favorites\n\n private _isFavorite: boolean = false;\n\n public get IsFavorite(): boolean {\n return this._isFavorite;\n }\n\n public async RemoveFavorite(): Promise<void> {\n return this.SetFavoriteStatus(false);\n }\n\n public async MakeFavorite(): Promise<void> {\n return this.SetFavoriteStatus(true);\n }\n\n public async SetFavoriteStatus(isFavorite: boolean) {\n const md = this.ProviderToUse;\n await md.SetRecordFavoriteStatus(md.CurrentUser.ID, this.record.EntityInfo.Name, this.record.PrimaryKey, isFavorite, md.CurrentUser);\n this._isFavorite = isFavorite;\n }\n\n // #endregion\n\n // #region Related Entity Helpers\n\n public BuildRelationshipViewParams(item: EntityRelationshipInfo): RunViewParams {\n return EntityInfo.BuildRelationshipViewParams(this.record, item);\n }\n\n public BuildRelationshipViewParamsByEntityName(relatedEntityName: string, relatedEntityJoinField?: string): RunViewParams {\n const eri = this.GetEntityRelationshipByRelatedEntityName(relatedEntityName, relatedEntityJoinField);\n if (eri)\n return this.BuildRelationshipViewParams(eri);\n else\n return {};\n }\n\n public GetEntityRelationshipByRelatedEntityName(relatedEntityName: string, relatedEntityJoinField?: string): EntityRelationshipInfo | undefined {\n if (this.record) {\n const r = <BaseEntity>this.record;\n const ret = r.EntityInfo.RelatedEntities.filter(x => x.RelatedEntity.trim().toLowerCase() === relatedEntityName.trim().toLowerCase());\n if (ret.length > 1 && relatedEntityJoinField) {\n const ret2 = ret.find(x => x.RelatedEntityJoinField.trim().toLowerCase() === relatedEntityJoinField.trim().toLowerCase());\n if (ret2)\n return ret2;\n } else if (ret.length === 1) {\n return ret[0];\n } else {\n return undefined;\n }\n }\n return undefined;\n }\n\n public NewRecordValues(relatedEntityName: string): Record<string, unknown> {\n const eri = this.GetEntityRelationshipByRelatedEntityName(relatedEntityName);\n if (eri)\n return this.NewRecordValuesByEntityRelationship(eri);\n else\n return {};\n }\n\n public NewRecordValuesByEntityRelationship(item: EntityRelationshipInfo): Record<string, unknown> {\n return EntityInfo.BuildRelationshipNewRecordValues(this.record, item);\n }\n\n public GetRelatedEntityTabDisplayName(relatedEntityName: string): string {\n if (this.record) {\n const eri = (<BaseEntity>this.record).EntityInfo.RelatedEntities.find(x => x.RelatedEntity === relatedEntityName);\n if (eri)\n return eri.DisplayName;\n }\n return relatedEntityName;\n }\n\n public get HasRelatedEntities(): boolean {\n if (this.record) {\n const relatedEntities = (<BaseEntity>this.record).EntityInfo.RelatedEntities;\n return relatedEntities && relatedEntities.length > 0;\n }\n return false;\n }\n\n // #endregion\n\n // #region Organic Key Helpers\n\n /**\n * Returns all active organic keys for the current entity, or an empty array if none.\n */\n public get OrganicKeys(): EntityOrganicKeyInfo[] {\n if (this.record) {\n return (<BaseEntity>this.record).EntityInfo.OrganicKeys || [];\n }\n return [];\n }\n\n /**\n * Whether the current entity has any active organic keys with related entities configured.\n */\n public get HasOrganicKeys(): boolean {\n return this.OrganicKeys.some(ok => ok.RelatedEntities.length > 0);\n }\n\n /**\n * Returns all organic key related entities across all organic keys, flattened and sorted.\n */\n public get AllOrganicKeyRelatedEntities(): { OrganicKey: EntityOrganicKeyInfo; RelatedEntity: EntityOrganicKeyRelatedEntityInfo }[] {\n const result: { OrganicKey: EntityOrganicKeyInfo; RelatedEntity: EntityOrganicKeyRelatedEntityInfo }[] = [];\n for (const ok of this.OrganicKeys) {\n for (const re of ok.RelatedEntities) {\n result.push({ OrganicKey: ok, RelatedEntity: re });\n }\n }\n return result;\n }\n\n /**\n * Builds RunViewParams for a specific organic key related entity.\n */\n public BuildOrganicKeyViewParams(\n organicKeyRelatedEntity: EntityOrganicKeyRelatedEntityInfo,\n organicKey: EntityOrganicKeyInfo\n ): RunViewParams {\n if (this.record) {\n return EntityInfo.BuildOrganicKeyViewParams(this.record, organicKeyRelatedEntity, organicKey);\n }\n return {};\n }\n\n /**\n * Convenience method to build organic key view params by organic key name and related entity name.\n */\n public BuildOrganicKeyViewParamsByNames(organicKeyName: string, relatedEntityName: string): RunViewParams {\n const ok = this.OrganicKeys.find(k => k.Name.trim().toLowerCase() === organicKeyName.trim().toLowerCase());\n if (ok) {\n const re = ok.RelatedEntities.find(r => r.RelatedEntity.trim().toLowerCase() === relatedEntityName.trim().toLowerCase());\n if (re) {\n return this.BuildOrganicKeyViewParams(re, ok);\n }\n }\n return {};\n }\n\n // #endregion\n\n // #region Entity Info & Dependencies\n\n public get EntityInfo(): EntityInfo | undefined {\n try {\n const r = <BaseEntity>this.record;\n if (r)\n return r.EntityInfo;\n else\n return undefined;\n } catch (e) {\n LogError(e);\n return undefined;\n }\n }\n\n public async ShowDependencies() {\n const md = this.ProviderToUse;\n const dep = await md.GetRecordDependencies(this.record.EntityInfo.Name, this.record.PrimaryKey);\n console.log('Dependencies for: ' + this.record.EntityInfo.Name + ' ' + this.record.PrimaryKey.ToString());\n console.log(dep);\n }\n\n public ShowChanges(): void {\n if (this.record) {\n const changes = this.record.GetAll(false, true);\n const oldValues = this.record.GetAll(true, true);\n const message =\n 'Changes for: ' + this.record.EntityInfo.Name + ' ' + this.record.PrimaryKey.ToString() +\n '\\n\\n' + JSON.stringify(changes, null, 2) +\n '\\n\\nOld Values\\n\\n' + JSON.stringify(oldValues, null, 2);\n console.log(message);\n this.Notification.emit({ Message: message, Type: 'info', Duration: 30000 });\n }\n }\n\n public async GetListsCanAddTo(): Promise<MJListEntity[]> {\n if (!this.record) {\n LogError('Unable to fetch List records: Record not found');\n return [];\n }\n\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const md = this.ProviderToUse;\n\n const rvResult: RunViewResult<MJListEntity> = await rv.RunView({\n EntityName: 'MJ: Lists',\n ExtraFilter: `UserID = '${md.CurrentUser.ID}' AND EntityID = '${this.record.EntityInfo.ID}'`,\n ResultType: 'entity_object'\n });\n\n if (!rvResult.Success) {\n LogError('Error running view to fetch lists', undefined, rvResult.ErrorMessage);\n return [];\n }\n\n return rvResult.Results;\n }\n\n public async GetRecordDependencies(): Promise<RecordDependency[]> {\n const md = this.ProviderToUse;\n const dependencies: RecordDependency[] = await md.GetRecordDependencies(this.record.EntityInfo.Name, this.record.PrimaryKey);\n return dependencies;\n }\n\n // #endregion\n\n // #region Collapsible Section Management\n\n protected sections: BaseFormSectionInfo[] = [];\n private sectionMap: Map<string, BaseFormSectionInfo> = new Map();\n\n public searchFilter: string = '';\n public showEmptyFields: boolean = false;\n\n /** Whether to show all validation errors on fields (set after save failure) */\n private _showValidation = false;\n /** Validation errors from the most recent failed save attempt */\n private _validationErrors: ValidationErrorInfo[] = [];\n\n public get formContext(): FormContext {\n return {\n sectionFilter: this.searchFilter,\n showEmptyFields: this.showEmptyFields,\n showValidation: this._showValidation,\n validationErrors: this._validationErrors,\n collapsibleSections: this.Config?.CollapsibleSections,\n enableRecordLinks: this.Config?.EnableRecordLinks,\n showRelatedEntities: this.Config?.ShowRelatedEntities,\n hiddenSectionKeys: this.Config?.HiddenSectionKeys,\n visibleSectionKeys: this.Config?.VisibleSectionKeys,\n allowSectionReorder: this.resolveAllowSectionReorder()\n };\n }\n\n /**\n * Resolves whether section drag-reorder is allowed for the current Config.\n * When no toolbar is rendered (dialog/slide-in, `Config.Toolbar === null`)\n * reorder is disabled; otherwise we honor the toolbar config's flag, defaulting\n * to allowed when unspecified (classic tab behavior).\n */\n private resolveAllowSectionReorder(): boolean {\n if (!this.Config) return true;\n if (this.Config.Toolbar === null) return false;\n return this.Config.Toolbar?.AllowSectionReorder ?? true;\n }\n\n /** Clears all validation display state (called on save success, cancel, end edit) */\n private clearValidationState(): void {\n this._showValidation = false;\n this._validationErrors = [];\n }\n\n private filterSubject = new Subject<string>();\n private filterSubscription?: Subscription;\n\n protected initSections(sections: (BaseFormSectionInfo | { sectionKey: string; sectionName: string; isExpanded: boolean; rowCount?: number; metadata?: unknown })[]): void {\n this.sections = sections.map(s =>\n s instanceof BaseFormSectionInfo\n ? s\n : new BaseFormSectionInfo(s.sectionKey, s.sectionName, s.isExpanded, s.rowCount, s.metadata)\n );\n this.sectionMap.clear();\n this.sections.forEach(section => {\n this.sectionMap.set(section.sectionKey, section);\n });\n }\n\n protected getSection(sectionKey: string): BaseFormSectionInfo | undefined {\n return this.sectionMap.get(sectionKey);\n }\n\n public IsSectionExpanded(sectionKey: string, defaultExpanded?: boolean): boolean {\n const section = this.sectionMap.get(sectionKey);\n // When the caller doesn't pass an explicit default, fall back to the value seeded by\n // initSections() — related-entity and System Metadata panels are seeded collapsed there.\n // Without this, FormStateService falls back to its global DEFAULT_SECTION_STATE (isExpanded=true),\n // which reports a never-before-visited related-entity panel as expanded and causes its data grid\n // (bound [AllowLoad]=\"IsSectionExpanded(key)\") to fetch on form open even while the panel is collapsed.\n // When the caller passes no explicit default, fall back to the value seeded by initSections().\n // If the section isn't in sectionMap yet — which happens during the window before the form's\n // async ngOnInit calls initSections(), e.g. when a record is opened already-loaded via an\n // in-app double-click so the grids render in the first change-detection pass — coalesce to\n // FALSE rather than letting FormStateService fall through to its global expanded default. A\n // missing section must NOT report as expanded, or its data grid (bound [AllowLoad]=\"IsSectionExpanded(key)\")\n // fires a RunView on open before the seeded collapsed default is applied.\n const resolvedDefault = defaultExpanded !== undefined ? defaultExpanded : (section?.isExpanded ?? false);\n const entityName = this.getEntityName();\n if (entityName) {\n return this.formStateService.isSectionExpanded(entityName, sectionKey, resolvedDefault);\n }\n return section ? section.isExpanded : (defaultExpanded !== undefined ? defaultExpanded : true);\n }\n\n public SetSectionExpanded(sectionKey: string, isExpanded: boolean): void {\n const entityName = this.getEntityName();\n if (entityName) {\n this.formStateService.setSectionExpanded(entityName, sectionKey, isExpanded);\n }\n const section = this.sectionMap.get(sectionKey);\n if (section) {\n section.isExpanded = isExpanded;\n }\n }\n\n public GetSectionRowCount(sectionKey: string): number | undefined {\n const section = this.sectionMap.get(sectionKey);\n return section?.rowCount;\n }\n\n public SetSectionRowCount(sectionKey: string, rowCount: number): void {\n const section = this.sectionMap.get(sectionKey);\n if (section) {\n section.rowCount = rowCount;\n }\n }\n\n public GetSectionPanelHeight(sectionKey: string): number | undefined {\n const entityName = this.getEntityName();\n if (entityName) {\n return this.formStateService.getSectionPanelHeight(entityName, sectionKey);\n }\n return undefined;\n }\n\n public SetSectionPanelHeight(sectionKey: string, height: number): void {\n const entityName = this.getEntityName();\n if (entityName) {\n this.formStateService.setSectionPanelHeight(entityName, sectionKey, height);\n }\n }\n\n public toggleSection(sectionKey: string): void {\n const entityName = this.getEntityName();\n if (entityName) {\n this.formStateService.toggleSection(entityName, sectionKey);\n }\n const section = this.sectionMap.get(sectionKey);\n if (section) {\n section.isExpanded = !section.isExpanded;\n }\n }\n\n /**\n * Expand any sections that are visible (match the current filter) but currently collapsed.\n * Called after filter changes so the user can immediately see matching content.\n */\n private expandMatchingSections(): void {\n if (!this.collapsiblePanels) return;\n this.collapsiblePanels.forEach(panel => {\n if (panel.IsVisible && !panel.Expanded) {\n this.SetSectionExpanded(panel.SectionKey, true);\n }\n });\n }\n\n public expandAllSections(): void {\n const entityName = this.getEntityName();\n const sectionKeys = this.sections.map(s => s.sectionKey);\n if (entityName && sectionKeys.length > 0) {\n this.formStateService.expandAllSections(entityName, sectionKeys);\n }\n this.sections.forEach(section => {\n section.isExpanded = true;\n });\n }\n\n public collapseAllSections(): void {\n const entityName = this.getEntityName();\n const sectionKeys = this.sections.map(s => s.sectionKey);\n if (entityName && sectionKeys.length > 0) {\n this.formStateService.collapseAllSections(entityName, sectionKeys);\n }\n this.sections.forEach(section => {\n section.isExpanded = false;\n });\n }\n\n public getExpandedCount(): number {\n const entityName = this.getEntityName();\n const sectionKeys = this.sections.map(s => s.sectionKey);\n if (entityName && sectionKeys.length > 0) {\n return this.formStateService.getExpandedCount(entityName, sectionKeys);\n }\n return this.sections.filter(section => section.isExpanded).length;\n }\n\n public getVisibleSectionCount(): number {\n if (!this.collapsiblePanels || this.collapsiblePanels.length === 0) {\n return this.sections.length;\n }\n return this.collapsiblePanels.filter(panel => panel.IsVisible).length;\n }\n\n public getTotalSectionCount(): number {\n return this.sections.length;\n }\n\n public onFilterChange(searchTerm: string): void {\n this.filterSubject.next(searchTerm);\n }\n\n public getEntityName(): string {\n return this.record?.EntityInfo?.Name || '';\n }\n\n /**\n * Component-level default width mode, used when the user has NOT\n * explicitly chosen a width for this entity yet (first visit, nothing\n * persisted in User Settings). Subclasses can override this — for\n * example, custom forms with full-bleed layouts should return\n * `'full-width'` here and the container will respect it on first open.\n *\n * Once the user toggles the width via the toolbar, their choice\n * persists via `setFormWidthMode()` and takes priority over this\n * default on subsequent opens.\n */\n public getDefaultFormWidthMode(): 'centered' | 'full-width' {\n return this.Config?.WidthMode ?? 'centered';\n }\n\n public getFormWidthMode(): 'centered' | 'full-width' {\n const entityName = this.getEntityName();\n if (entityName && this.formStateService.hasExplicitWidthMode(entityName)) {\n return this.formStateService.getWidthMode(entityName);\n }\n return this.getDefaultFormWidthMode();\n }\n\n public setFormWidthMode(widthMode: 'centered' | 'full-width'): void {\n const entityName = this.getEntityName();\n if (entityName) {\n this.formStateService.setWidthMode(entityName, widthMode);\n }\n }\n\n public toggleFormWidthMode(): void {\n const entityName = this.getEntityName();\n if (entityName) {\n this.formStateService.toggleWidthMode(entityName);\n }\n }\n\n // #endregion\n\n // #region Section Ordering\n\n public getSectionOrder(): string[] {\n const entityName = this.getEntityName();\n if (entityName) {\n const customOrder = this.formStateService.getSectionOrder(entityName);\n if (customOrder && customOrder.length > 0) {\n return customOrder;\n }\n }\n return this.sections.map(s => s.sectionKey);\n }\n\n public setSectionOrder(sectionOrder: string[]): void {\n const entityName = this.getEntityName();\n if (entityName) {\n this.formStateService.setSectionOrder(entityName, sectionOrder);\n }\n }\n\n public resetSectionOrder(): void {\n const entityName = this.getEntityName();\n if (entityName) {\n this.formStateService.resetSectionOrder(entityName);\n }\n }\n\n public hasCustomSectionOrder(): boolean {\n const entityName = this.getEntityName();\n if (entityName) {\n return this.formStateService.hasCustomSectionOrder(entityName);\n }\n return false;\n }\n\n public getSectionDisplayOrder(sectionKey: string): number {\n const order = this.getSectionOrder();\n const index = order.indexOf(sectionKey);\n return index >= 0 ? index : this.sections.length;\n }\n\n // #endregion\n\n // #region Form Container Event Handlers\n\n /**\n * Handles navigation events from the form container and related entity grids.\n * Relays the event upward via the Navigate @Output for the host application to handle.\n * Generated form templates bind this as: (Navigate)=\"OnFormNavigate($event)\"\n */\n public OnFormNavigate(event: FormNavigationEvent): void {\n this.Navigate.emit(event);\n }\n\n /**\n * Handles delete requests from the form container.\n * Emits RecordDeleted on success, RecordDeleteFailed on failure.\n * Generated form templates bind this as: (DeleteRequested)=\"OnDeleteRequested()\"\n */\n public async OnDeleteRequested(): Promise<void> {\n if (!this.record || !this.record.IsSaved) return;\n try {\n const result = await this.record.Delete();\n if (result) {\n this.Notification.emit({ Message: 'Record deleted successfully', Type: 'success', Duration: 2500 });\n this.RecordDeleted.emit({\n EntityName: this.record.EntityInfo.Name,\n RecordId: this.record.PrimaryKey.ToString()\n });\n } else {\n const errorMsg = 'Error deleting record';\n this.Notification.emit({ Message: errorMsg, Type: 'error', Duration: 5000 });\n this.RecordDeleteFailed.emit({ EntityName: this.record.EntityInfo.Name, ErrorMessage: errorMsg });\n }\n } catch (e) {\n const errorMsg = 'Error deleting record: ' + e;\n this.Notification.emit({ Message: errorMsg, Type: 'error', Duration: 5000 });\n this.RecordDeleteFailed.emit({ EntityName: this.record.EntityInfo.Name, ErrorMessage: errorMsg });\n }\n }\n\n /**\n * Handles favorite toggle from the form container.\n * Generated form templates bind this as: (FavoriteToggled)=\"OnFavoriteToggled()\"\n */\n public async OnFavoriteToggled(): Promise<void> {\n await this.SetFavoriteStatus(!this.IsFavorite);\n }\n\n /**\n * Handles history view requests from the form container.\n * Generated form templates bind this as: (HistoryRequested)=\"OnHistoryRequested()\"\n */\n public OnHistoryRequested(): void {\n this.handleHistoryDialog();\n }\n\n /**\n * Handles list management requests from the form container.\n * Generated form templates bind this as: (ListManagementRequested)=\"OnListManagementRequested()\"\n */\n public OnListManagementRequested(): void {\n // List management dialog is handled by the host application\n // Subclasses can override this to implement custom list management\n }\n\n // #endregion\n}\n"]}
|
|
1
|
+
{"version":3,"file":"base-form-component.js","sourceRoot":"","sources":["../../src/lib/base-form-component.ts"],"names":[],"mappings":"AAAA,OAAO,EAC6B,SAAS,EAC3C,YAAY,EAAa,UAAU,EAAE,iBAAiB,EACtD,MAAM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AAQ,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;YAC7E,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,CAAC;QACpG,CAAC;IACH,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,iBAAiB;QAC5B,MAAM,IAAI,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACjD,CAAC;IAED;;;OAGG;IACI,kBAAkB;QACvB,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACI,yBAAyB;QAC9B,4DAA4D;QAC5D,mEAAmE;IACrE,CAAC;iPA3vCmB,iBAAiB,yBAAjB,iBAAiB;6DAAjB,iBAAiB;2BAmNvB,2BAA2B;;;;;;iFAnNrB,iBAAiB;cADtC,SAAS;;kBAiLP,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAON,MAAM;;kBAON,YAAY;mBAAC,2BAA2B","sourcesContent":["import {\n AfterViewInit, OnInit, OnDestroy, Directive,\n ViewChildren, QueryList, ElementRef, ChangeDetectorRef,\n Output, EventEmitter, inject\n} from '@angular/core';\n\nimport { Subject, Subscription, debounceTime } from 'rxjs';\nimport {\n EntityInfo, ValidationResult, BaseEntity, EntityPermissionType,\n EntityRelationshipInfo, EntityOrganicKeyInfo, EntityOrganicKeyRelatedEntityInfo,\n Metadata, RunViewParams, LogError,\n RecordDependency, BaseEntityEvent, CompositeKey, RunView, RunViewResult\n} from '@memberjunction/core';\nimport { MJEventType, MJGlobal, ValidationErrorInfo } from '@memberjunction/global';\nimport { FormEditingCompleteEvent, PendingRecordItem, BaseFormComponentEventCodes } from '@memberjunction/ng-base-types';\nimport { MJListEntity } from '@memberjunction/core-entities';\n\nimport { BaseRecordComponent } from './base-record-component';\nimport { BaseFormSectionInfo } from './base-form-section-info';\nimport { MjCollapsiblePanelComponent } from './panel/collapsible-panel.component';\nimport { FormNavigationEvent } from './types/navigation-events';\nimport {\n FormContext,\n FormNotificationEvent,\n RecordSavedEvent,\n RecordRefreshedEvent,\n RecordDeletedEvent,\n RecordSaveFailedEvent,\n RecordDeleteFailedEvent,\n ValidationFailedEvent\n} from './types/form-types';\nimport { FormStateService } from './form-state.service';\nimport { EntityFormConfig } from './types/entity-form-config';\nimport { FormToolbarItemConfig, FormToolbarItemKey, FormToolbarItemClickEventArgs } from './types/form-toolbar-item';\nimport { CollectFormPanelRegistrations } from './panel-slot/collect-form-panel-registrations';\nimport { ContributionHiddenSectionKeys } from './panel-slot/form-contribution';\n\n/**\n * Abstract base class for all entity record forms in MemberJunction.\n *\n * Generated forms (via CodeGen) and custom forms extend this class.\n * It provides core form logic — section management, validation, pending records,\n * permissions, favorites, related entity helpers — with ZERO Explorer dependencies.\n *\n * Instead of calling Explorer services directly, events are emitted via @Output:\n * - **Navigate**: Form navigation requests (record links, new records, external links)\n * - **Notification**: User-facing notifications (save success, validation errors, etc.)\n * - **RecordSaved**: Emitted after a successful save\n * - **RecordDeleted**: Emitted after a successful delete\n *\n * The host application (e.g. SingleRecordComponent in Explorer) subscribes to\n * these events and maps them to its own services (NavigationService, SharedService, etc.).\n */\n@Directive()\nexport abstract class BaseFormComponent extends BaseRecordComponent implements AfterViewInit, OnInit, OnDestroy {\n public EditMode: boolean = false;\n public IsRefreshing: boolean = false;\n public FavoriteInitDone: boolean = false;\n\n /**\n * Per-instance presentation config (toolbar visibility, related-entity\n * sections, collapsibility, width, in-form navigation). Set by the form host\n * (`MjEntityFormHostComponent`) or any consumer that instantiates the form\n * directly. Read back by `MjRecordFormContainerComponent` and the collapsible\n * panels through the `FormComponent` reference, so it takes effect WITHOUT\n * regenerating the CodeGen-produced template. Null means \"use the container's\n * own defaults\" (the classic full-page tab behavior).\n */\n public Config: EntityFormConfig | null = null;\n\n /**\n * Variants applicable to the current (entity, user) tuple, supplied by the\n * Explorer-level form resolver. When more than one entry is present, the\n * record-form-container shows a picker that lets the user switch between\n * variants. Empty / single-entry arrays hide the picker.\n *\n * The container reads this via its `EffectiveVariants` accessor — generated\n * form templates do NOT need to bind it explicitly.\n */\n public Variants: { ID: string; Label: string; Scope: 'User' | 'Role' | 'Global'; Status: 'Active' | 'Pending' | 'Inactive' }[] = [];\n\n /**\n * ID of the currently-rendered variant (null when no override is active and\n * the form is the CodeGen / @RegisterClass default).\n */\n public CurrentVariantID: string | null = null;\n\n /**\n * Hook called when the user picks a different variant from the picker.\n * Default is a no-op; the Explorer-level single-record component replaces\n * this on the form instance to wire `FormResolverService.SetSelectedVariant`\n * and reload the record. Kept as a method (not an EventEmitter) so the host\n * doesn't need to subscribe — assignment is enough.\n */\n public OnVariantChanged: (variantID: string | null) => void = (_id) => {\n // host installs the real handler post-construction\n };\n public isHistoryDialogOpen: boolean = false;\n public IsTagsPanelOpen: boolean = false;\n public TagCount: number = 0;\n public showDeleteDialog: boolean = false;\n public showCreateDialog: boolean = false;\n\n /**\n * Height of the top area when a splitter layout is used.\n * Referenced by CodeGen-generated templates for entities with \"top area\" sections.\n */\n public TopAreaHeight: string = '300px';\n\n /**\n * Size of the top area as a percentage (0-100) for angular-split.\n * Used by CodeGen-generated templates with as-split.\n */\n public TopAreaSize: number = 40;\n\n /**\n * Size of the bottom area as a percentage (0-100) for angular-split.\n * Used by CodeGen-generated templates with as-split.\n */\n public BottomAreaSize: number = 60;\n\n /**\n * Called when the splitter layout changes (for entities with \"top area\" sections).\n * No-op in the generic version; override in host application if splitter resizing is needed.\n */\n public splitterLayoutChange(): void {\n // No-op — host application can override\n }\n\n private _pendingRecords: PendingRecordItem[] = [];\n private _registeredToolbarItems = new Map<string, FormToolbarItemConfig>();\n private _toolbarItemOverrides = new Map<string, Partial<FormToolbarItemConfig>>();\n\n /**\n * Registers a dynamic toolbar action item / button.\n * Can be called during ngOnInit or at runtime.\n */\n public RegisterToolbarItem(item: FormToolbarItemConfig): void {\n this._registeredToolbarItems.set(item.Key, { ...item });\n this.cdr?.markForCheck();\n }\n\n /**\n * Unregisters a previously registered dynamic toolbar item by key.\n */\n public UnregisterToolbarItem(key: string): void {\n if (this._registeredToolbarItems.delete(key)) {\n this.cdr?.markForCheck();\n }\n }\n\n /**\n * Configures overrides for any toolbar item (standard built-in items like 'edit',\n * 'delete', 'favorite', 'history', etc., or custom items).\n * Allows dynamically changing visibility, disabled state, tooltips, order, icon, etc.\n */\n public ConfigureToolbarItem(key: FormToolbarItemKey, overrides: Partial<FormToolbarItemConfig>): void {\n const existing = this._toolbarItemOverrides.get(key) || {};\n this._toolbarItemOverrides.set(key, { ...existing, ...overrides });\n this.cdr?.markForCheck();\n }\n\n /**\n * Dynamically hides a toolbar item by key.\n */\n public HideToolbarItem(key: FormToolbarItemKey): void {\n this.ConfigureToolbarItem(key, { Visible: false });\n }\n\n /**\n * Dynamically shows a toolbar item by key.\n */\n public ShowToolbarItem(key: FormToolbarItemKey): void {\n this.ConfigureToolbarItem(key, { Visible: true });\n }\n\n /**\n * Dynamically disables a toolbar item by key, with an optional reason string for the tooltip.\n */\n public DisableToolbarItem(key: FormToolbarItemKey, reason?: string): void {\n this.ConfigureToolbarItem(key, { Disabled: reason ?? true });\n }\n\n /**\n * Dynamically enables a toolbar item by key.\n */\n public EnableToolbarItem(key: FormToolbarItemKey): void {\n this.ConfigureToolbarItem(key, { Disabled: false });\n }\n\n /**\n * Sets the numeric display order for a toolbar item (lower numbers appear earlier).\n */\n public SetToolbarItemOrder(key: FormToolbarItemKey, order: number): void {\n this.ConfigureToolbarItem(key, { Order: order });\n }\n\n /**\n * Returns all dynamically registered toolbar items.\n */\n public get RegisteredToolbarItems(): FormToolbarItemConfig[] {\n return Array.from(this._registeredToolbarItems.values());\n }\n\n /**\n * Returns the map of toolbar item overrides.\n */\n public get ToolbarItemOverrides(): ReadonlyMap<string, Partial<FormToolbarItemConfig>> {\n return this._toolbarItemOverrides;\n }\n\n /**\n * Hook invoked when a custom or dynamic toolbar item is clicked.\n * Subclasses can override this method to handle custom button clicks.\n */\n public OnCustomToolbarButtonClick(event: FormToolbarItemClickEventArgs): void {\n // Subclasses can override\n }\n\n // #region Injected Dependencies (no constructor params)\n\n protected elementRef = inject(ElementRef);\n public cdr = inject(ChangeDetectorRef);\n protected formStateService = inject(FormStateService);\n\n // #endregion\n\n // #region @Output Events\n\n /** Emitted when navigation is requested (record link, external link, email, new record, etc.) */\n @Output() Navigate = new EventEmitter<FormNavigationEvent>();\n\n /** Emitted when a user-facing notification should be shown */\n @Output() Notification = new EventEmitter<FormNotificationEvent>();\n\n /** Emitted after a record is saved successfully */\n @Output() RecordSaved = new EventEmitter<RecordSavedEvent>();\n\n /** Emitted after a record is refreshed from the database successfully */\n @Output() RecordRefreshed = new EventEmitter<RecordRefreshedEvent>();\n\n /** Emitted after a record is deleted successfully */\n @Output() RecordDeleted = new EventEmitter<RecordDeletedEvent>();\n\n /** Emitted when a record save fails */\n @Output() RecordSaveFailed = new EventEmitter<RecordSaveFailedEvent>();\n\n /** Emitted when a record delete fails */\n @Output() RecordDeleteFailed = new EventEmitter<RecordDeleteFailedEvent>();\n\n /** Emitted when validation fails before save */\n @Output() ValidationFailed = new EventEmitter<ValidationFailedEvent>();\n\n /**\n * Emitted once after ngOnInit completes and the record is fully initialized\n * (favorites loaded, form state initialized). This is the safe point for\n * the container to start loading badge counts and other record-dependent data.\n */\n @Output() RecordReady = new EventEmitter<BaseEntity>();\n\n // #endregion\n\n /** Subscription to form state changes */\n private formStateSubscription?: Subscription;\n\n @ViewChildren(MjCollapsiblePanelComponent)\n collapsiblePanels!: QueryList<MjCollapsiblePanelComponent>;\n\n async ngOnInit() {\n if (this.record) {\n if (!this.record.IsSaved) {\n this.StartEditMode();\n }\n const md = this.ProviderToUse;\n // Bind FormStateService to the same provider this form is using.\n this.formStateService.Provider = md;\n this._isFavorite = await md.GetRecordFavoriteStatus(md.CurrentUser.ID, this.record.EntityInfo.Name, this.record.PrimaryKey);\n this.FavoriteInitDone = true;\n\n // Initialize form state from User Settings\n const entityName = this.getEntityName();\n if (entityName) {\n await this.formStateService.initializeState(entityName);\n this.formStateSubscription = this.formStateService.getState$(entityName).subscribe(state => {\n this.showEmptyFields = state.showEmptyFields;\n this.cdr.markForCheck();\n });\n }\n }\n\n // Signal that the record is fully initialized and ready for dependent operations\n if (this.record) {\n this.RecordReady.emit(this.record);\n }\n\n // Set up debounced filter subscription\n this.filterSubscription = this.filterSubject\n .pipe(debounceTime(100))\n .subscribe(searchTerm => {\n this.searchFilter = searchTerm;\n // After change detection propagates FormContext to panels and they update\n // their IsVisible state, expand any visible (matching) sections that are collapsed\n if (searchTerm) {\n Promise.resolve().then(() => this.expandMatchingSections());\n }\n });\n }\n\n ngAfterViewInit(): void {\n // Subclasses can override for post-view-init logic\n }\n\n ngOnDestroy(): void {\n if (this.filterSubscription) {\n this.filterSubscription.unsubscribe();\n }\n if (this.formStateSubscription) {\n this.formStateSubscription.unsubscribe();\n }\n }\n\n // #region Pending Records\n\n protected get PendingRecords(): PendingRecordItem[] {\n return this._pendingRecords;\n }\n\n /**\n * Unsaved changes a form holds OUTSIDE its record's fields and pending records.\n *\n * A form whose sections own editors — a flow canvas, a designer, a grid — accumulates edits that\n * neither `record.Dirty` nor `PendingRecordsDirty()` can see, because nothing on the entity\n * changed. Without this the toolbar reports \"no changes\" while the user is looking at their own\n * work, and the navigate-away guard lets them lose it silently.\n *\n * Default `false`, so no existing form changes behaviour. Override to consult whatever holds the\n * extra state.\n */\n public get HasAdditionalUnsavedChanges(): boolean {\n return false;\n }\n\n protected PendingRecordsDirty(): boolean {\n this.PopulatePendingRecords();\n const pendingRecords = this.PendingRecords;\n if (pendingRecords && pendingRecords.length > 0) {\n for (const p of pendingRecords) {\n if (p.action === 'delete')\n return true;\n else if (p.entityObject.Dirty)\n return true;\n }\n }\n return false;\n }\n\n protected PopulatePendingRecords() {\n this._pendingRecords = [];\n this.RaiseEvent(BaseFormComponentEventCodes.EDITING_COMPLETE);\n const result = this.RaiseEvent(BaseFormComponentEventCodes.POPULATE_PENDING_RECORDS);\n if (result && result.pendingChanges) {\n for (const p of result.pendingChanges)\n this.PendingRecords.push(p);\n }\n }\n\n protected ValidatePendingRecords(): ValidationResult[] {\n const results: ValidationResult[] = [];\n for (let i = 0; i < this._pendingRecords.length; i++) {\n const pendingRecord = this._pendingRecords[i];\n results.push(pendingRecord.entityObject.Validate());\n }\n return results;\n }\n\n // #endregion\n\n // #region Edit Mode\n\n public StartEditMode(): void {\n this.EditMode = true;\n const entityName = this.getEntityName();\n if (entityName) {\n this.formStateService.setEditMode(entityName, true);\n }\n }\n\n public EndEditMode(): void {\n this.EditMode = false;\n this.clearValidationState();\n const entityName = this.getEntityName();\n if (entityName) {\n this.formStateService.setEditMode(entityName, false);\n }\n }\n\n public handleHistoryDialog(): void {\n this.isHistoryDialogOpen = !this.isHistoryDialogOpen;\n }\n\n public HandleTagsPanel(): void {\n this.IsTagsPanelOpen = !this.IsTagsPanelOpen;\n }\n\n // #endregion\n\n // #region Core Form Operations\n\n public Validate(): ValidationResult {\n const valResults = (<BaseEntity>this.record).Validate();\n const pendingValResults = this.ValidatePendingRecords();\n for (let i = 0; i < pendingValResults.length; i++) {\n const pendingValResult = pendingValResults[i];\n if (!pendingValResult.Success) {\n valResults.Success = false;\n valResults.Errors.push(...pendingValResult.Errors);\n }\n }\n return valResults;\n }\n\n protected RaiseEvent(eventCode: BaseFormComponentEventCodes) {\n const event = new FormEditingCompleteEvent();\n event.elementRef = this.elementRef;\n event.subEventCode = eventCode;\n\n MJGlobal.Instance.RaiseEvent({\n event: MJEventType.ComponentEvent,\n component: this,\n eventCode: BaseFormComponentEventCodes.BASE_CODE,\n args: event\n });\n\n return event;\n }\n\n public async SaveRecord(StopEditModeAfterSave: boolean): Promise<boolean> {\n try {\n try {\n (document.activeElement as HTMLElement).blur();\n this.RaiseEvent(BaseFormComponentEventCodes.EDITING_COMPLETE);\n } catch (_e) {\n // ignore blur errors\n }\n\n if (this.record) {\n this.PopulatePendingRecords();\n const valResults = this.Validate();\n if (valResults.Success) {\n const result = await this.InternalSaveRecord();\n if (result) {\n this._pendingRecords = [];\n this.clearValidationState();\n if (StopEditModeAfterSave)\n this.EndEditMode();\n\n this.Notification.emit({ Message: 'Record saved successfully', Type: 'success', Duration: 2500 });\n this.RecordSaved.emit({\n EntityName: this.record.EntityInfo.Name,\n RecordId: this.record.PrimaryKey.ToString(),\n Result: { Success: true }\n });\n return true;\n } else {\n const serverMsg = this.record.LatestResult?.Message || '';\n const errorMsg = serverMsg ? `Save failed: ${serverMsg}` : 'Error saving record';\n this.Notification.emit({ Message: errorMsg, Type: 'error', Duration: 5000 });\n this.RecordSaveFailed.emit({ EntityName: this.record.EntityInfo.Name, ErrorMessage: errorMsg });\n }\n } else {\n // Broadcast validation errors to all fields via FormContext\n this._showValidation = true;\n this._validationErrors = valResults.Errors;\n this.cdr.markForCheck();\n\n const errorMessages = valResults.Errors.map(x => x.Message);\n this.Notification.emit({\n Message: 'Validation Errors\\n' + errorMessages.join('\\n'),\n Type: 'warning',\n Duration: 5000\n });\n this.ValidationFailed.emit({ EntityName: this.record.EntityInfo.Name, Errors: errorMessages });\n }\n }\n\n LogError(\"Could not save record: Record not found\");\n return false;\n } catch (e) {\n const errorMsg = 'Error saving record: ' + e;\n this.Notification.emit({ Message: errorMsg, Type: 'error', Duration: 5000 });\n if (this.record) {\n this.RecordSaveFailed.emit({ EntityName: this.record.EntityInfo.Name, ErrorMessage: errorMsg });\n }\n return false;\n }\n }\n\n public CancelEdit() {\n if (this.record) {\n const r = <BaseEntity>this.record;\n // Capture BEFORE any mutation — Revert() can clear the \"new\" flag on some\n // entities. We need to know whether this record was ever persisted so we\n // can tell the host to dismiss the form (there's nothing to view).\n const wasNeverSaved = !r.IsSaved;\n\n if (r.Dirty || this.PendingRecordsDirty()) {\n // Revert is safe here — the toolbar's discard dialog already confirmed with the user\n r.Revert();\n\n const pendingRecords = this.PendingRecords;\n if (pendingRecords && pendingRecords.length > 0) {\n pendingRecords.forEach(p => {\n if (p.action === 'save')\n p.entityObject.Revert();\n });\n }\n this.RaiseEvent(BaseFormComponentEventCodes.REVERT_PENDING_CHANGES);\n }\n this.EndEditMode();\n\n // For never-saved records, ask the host to dismiss the form — leaving it\n // in view mode shows an empty record (there IS no record) and any\n // subsequent \"Create New\" click for the same entity would silently\n // reuse this abandoned form. Hosts that don't have a meaningful close\n // semantic can ignore this event.\n if (wasNeverSaved) {\n this.Navigate.emit({ Kind: 'dismiss', Reason: 'new-record-discarded' });\n }\n }\n }\n\n /**\n * Re-fetches the current record from the database, updating field values\n * in-place and resetting dirty flags. No-op in edit mode or on an unsaved\n * record. Related-entity grids are notified via the form container's\n * {@link FormRecordRefreshCoordinator} after this emits {@link RecordRefreshed}.\n *\n * @returns true if the record was reloaded from the database.\n */\n public async RefreshRecord(): Promise<boolean> {\n if (!this.canRefreshRecord()) {\n return false;\n }\n\n this.IsRefreshing = true;\n this.cdr.markForCheck();\n\n try {\n return await this.executeRecordRefresh();\n } finally {\n this.IsRefreshing = false;\n this.cdr.markForCheck();\n }\n }\n\n private canRefreshRecord(): boolean {\n return !!this.record && this.record.IsSaved && !this.EditMode;\n }\n\n private async executeRecordRefresh(): Promise<boolean> {\n const record = this.record;\n if (!record) {\n return false;\n }\n\n try {\n const ok = await record.Refresh();\n if (!ok) {\n this.Notification.emit({\n Message: 'Failed to refresh record from database',\n Type: 'error',\n Duration: 5000,\n });\n return false;\n }\n\n await this.reloadFavoriteStatusAfterRefresh(record);\n this.Notification.emit({\n Message: 'Record refreshed from database',\n Type: 'info',\n Duration: 2000,\n });\n this.RecordRefreshed.emit({\n EntityName: record.EntityInfo.Name,\n Record: record,\n });\n return true;\n } catch (e) {\n const detail = e instanceof Error ? e.message : String(e);\n this.Notification.emit({\n Message: 'Error refreshing record: ' + detail,\n Type: 'error',\n Duration: 5000,\n });\n return false;\n }\n }\n\n private async reloadFavoriteStatusAfterRefresh(record: BaseEntity): Promise<void> {\n const md = this.ProviderToUse;\n try {\n this._isFavorite = await md.GetRecordFavoriteStatus(\n md.CurrentUser.ID,\n record.EntityInfo.Name,\n record.PrimaryKey,\n );\n } catch {\n // Non-critical — favorite status remains as is\n }\n }\n\n protected async InternalSaveRecord(): Promise<boolean> {\n if (this.record) {\n if (this._pendingRecords.length > 0) {\n const md = this.ProviderToUse;\n const tg = await md.CreateTransactionGroup();\n this.record.TransactionGroup = tg;\n await this.record.Save();\n\n for (const x of this._pendingRecords) {\n x.entityObject.TransactionGroup = tg;\n if (x.action === 'save') {\n await x.entityObject.Save();\n } else {\n await x.entityObject.Delete();\n }\n }\n return await tg.Submit();\n } else {\n return await this.record.Save();\n }\n } else {\n return false;\n }\n }\n\n public async Wait(duration: number): Promise<void> {\n return new Promise<void>(resolve => setTimeout(resolve, duration));\n }\n\n // #endregion\n\n // #region Permissions\n\n private _userPermissions: { permission: EntityPermissionType; canDo: boolean }[] = [];\n\n public CheckUserPermission(type: EntityPermissionType): boolean {\n try {\n if (this.record) {\n const perm = this._userPermissions.find(x => x.permission === type);\n if (perm)\n return perm.canDo;\n else {\n const result = this.record.CheckPermissions(type, false);\n this._userPermissions.push({ permission: type, canDo: result });\n return result;\n }\n } else {\n return false;\n }\n } catch (e) {\n LogError(e);\n return false;\n }\n }\n\n public get UserCanEdit(): boolean {\n return this.CheckUserPermission(EntityPermissionType.Update);\n }\n\n public get UserCanRead(): boolean {\n return this.CheckUserPermission(EntityPermissionType.Read);\n }\n\n public get UserCanCreate(): boolean {\n return this.CheckUserPermission(EntityPermissionType.Create);\n }\n\n public get UserCanDelete(): boolean {\n return this.CheckUserPermission(EntityPermissionType.Delete);\n }\n\n // #endregion\n\n // #region Grid Edit Mode\n\n public GridEditMode(): \"None\" | \"Save\" | \"Queue\" {\n return this.EditMode ? \"Queue\" : \"None\";\n }\n\n // #endregion\n\n // #region Favorites\n\n private _isFavorite: boolean = false;\n\n public get IsFavorite(): boolean {\n return this._isFavorite;\n }\n\n public async RemoveFavorite(): Promise<void> {\n return this.SetFavoriteStatus(false);\n }\n\n public async MakeFavorite(): Promise<void> {\n return this.SetFavoriteStatus(true);\n }\n\n public async SetFavoriteStatus(isFavorite: boolean) {\n const md = this.ProviderToUse;\n await md.SetRecordFavoriteStatus(md.CurrentUser.ID, this.record.EntityInfo.Name, this.record.PrimaryKey, isFavorite, md.CurrentUser);\n this._isFavorite = isFavorite;\n }\n\n // #endregion\n\n // #region Related Entity Helpers\n\n public BuildRelationshipViewParams(item: EntityRelationshipInfo): RunViewParams {\n return EntityInfo.BuildRelationshipViewParams(this.record, item);\n }\n\n public BuildRelationshipViewParamsByEntityName(relatedEntityName: string, relatedEntityJoinField?: string): RunViewParams {\n const eri = this.GetEntityRelationshipByRelatedEntityName(relatedEntityName, relatedEntityJoinField);\n if (eri)\n return this.BuildRelationshipViewParams(eri);\n else\n return {};\n }\n\n /**\n * One grid over several FKs to the same related entity (Bill-To OR Ship-To).\n */\n public BuildRelationshipViewParamsForJoinFields(relatedEntityName: string, joinFields: readonly string[]): RunViewParams {\n if (!this.record) return {};\n return EntityInfo.BuildRelationshipViewParamsForJoinFields(this.record, relatedEntityName, joinFields);\n }\n\n public GetEntityRelationshipByRelatedEntityName(relatedEntityName: string, relatedEntityJoinField?: string): EntityRelationshipInfo | undefined {\n if (this.record) {\n const r = <BaseEntity>this.record;\n const ret = r.EntityInfo.RelatedEntities.filter(x => x.RelatedEntity.trim().toLowerCase() === relatedEntityName.trim().toLowerCase());\n if (ret.length > 1 && relatedEntityJoinField) {\n const ret2 = ret.find(x => x.RelatedEntityJoinField.trim().toLowerCase() === relatedEntityJoinField.trim().toLowerCase());\n if (ret2)\n return ret2;\n } else if (ret.length === 1) {\n return ret[0];\n } else {\n return undefined;\n }\n }\n return undefined;\n }\n\n /**\n * Default values for a new related-entity record so it links back here.\n * Pass `relatedEntityJoinField` when more than one relationship targets the\n * same entity (Bill-To vs Ship-To). When omitted and several matches exist,\n * every matching FK is set — same fields the related grid is filtering on.\n */\n public NewRecordValues(relatedEntityName: string, relatedEntityJoinField?: string): Record<string, unknown> {\n if (!this.record) return {};\n if (relatedEntityJoinField) {\n const eri = this.GetEntityRelationshipByRelatedEntityName(relatedEntityName, relatedEntityJoinField);\n if (eri) return this.NewRecordValuesByEntityRelationship(eri);\n return EntityInfo.BuildRelationshipNewRecordValuesForJoinFields(this.record, [relatedEntityJoinField]);\n }\n const matches = this.record.EntityInfo.RelatedEntities.filter(\n (x) => x.RelatedEntity.trim().toLowerCase() === relatedEntityName.trim().toLowerCase(),\n );\n if (matches.length === 0) return {};\n if (matches.length === 1) return this.NewRecordValuesByEntityRelationship(matches[0]);\n return EntityInfo.BuildRelationshipNewRecordValuesForJoinFields(\n this.record,\n matches.map((m) => m.RelatedEntityJoinField),\n );\n }\n\n /**\n * Default values for a new related record, setting every listed join field\n * to this record's key. Pair with {@link BuildRelationshipViewParamsForJoinFields}.\n */\n public NewRecordValuesForJoinFields(relatedEntityName: string, joinFields: readonly string[]): Record<string, unknown> {\n if (!this.record || !relatedEntityName) return {};\n return EntityInfo.BuildRelationshipNewRecordValuesForJoinFields(this.record, joinFields);\n }\n\n public NewRecordValuesByEntityRelationship(item: EntityRelationshipInfo): Record<string, unknown> {\n return EntityInfo.BuildRelationshipNewRecordValues(this.record, item);\n }\n\n public GetRelatedEntityTabDisplayName(relatedEntityName: string): string {\n if (this.record) {\n const eri = (<BaseEntity>this.record).EntityInfo.RelatedEntities.find(x => x.RelatedEntity === relatedEntityName);\n if (eri)\n return eri.DisplayName;\n }\n return relatedEntityName;\n }\n\n public get HasRelatedEntities(): boolean {\n if (this.record) {\n const relatedEntities = (<BaseEntity>this.record).EntityInfo.RelatedEntities;\n return relatedEntities && relatedEntities.length > 0;\n }\n return false;\n }\n\n // #endregion\n\n // #region Organic Key Helpers\n\n /**\n * Returns all active organic keys for the current entity, or an empty array if none.\n */\n public get OrganicKeys(): EntityOrganicKeyInfo[] {\n if (this.record) {\n return (<BaseEntity>this.record).EntityInfo.OrganicKeys || [];\n }\n return [];\n }\n\n /**\n * Whether the current entity has any active organic keys with related entities configured.\n */\n public get HasOrganicKeys(): boolean {\n return this.OrganicKeys.some(ok => ok.RelatedEntities.length > 0);\n }\n\n /**\n * Returns all organic key related entities across all organic keys, flattened and sorted.\n */\n public get AllOrganicKeyRelatedEntities(): { OrganicKey: EntityOrganicKeyInfo; RelatedEntity: EntityOrganicKeyRelatedEntityInfo }[] {\n const result: { OrganicKey: EntityOrganicKeyInfo; RelatedEntity: EntityOrganicKeyRelatedEntityInfo }[] = [];\n for (const ok of this.OrganicKeys) {\n for (const re of ok.RelatedEntities) {\n result.push({ OrganicKey: ok, RelatedEntity: re });\n }\n }\n return result;\n }\n\n /**\n * Builds RunViewParams for a specific organic key related entity.\n */\n public BuildOrganicKeyViewParams(\n organicKeyRelatedEntity: EntityOrganicKeyRelatedEntityInfo,\n organicKey: EntityOrganicKeyInfo\n ): RunViewParams {\n if (this.record) {\n return EntityInfo.BuildOrganicKeyViewParams(this.record, organicKeyRelatedEntity, organicKey);\n }\n return {};\n }\n\n /**\n * Convenience method to build organic key view params by organic key name and related entity name.\n */\n public BuildOrganicKeyViewParamsByNames(organicKeyName: string, relatedEntityName: string): RunViewParams {\n const ok = this.OrganicKeys.find(k => k.Name.trim().toLowerCase() === organicKeyName.trim().toLowerCase());\n if (ok) {\n const re = ok.RelatedEntities.find(r => r.RelatedEntity.trim().toLowerCase() === relatedEntityName.trim().toLowerCase());\n if (re) {\n return this.BuildOrganicKeyViewParams(re, ok);\n }\n }\n return {};\n }\n\n // #endregion\n\n // #region Entity Info & Dependencies\n\n public get EntityInfo(): EntityInfo | undefined {\n try {\n const r = <BaseEntity>this.record;\n if (r)\n return r.EntityInfo;\n else\n return undefined;\n } catch (e) {\n LogError(e);\n return undefined;\n }\n }\n\n public async ShowDependencies() {\n const md = this.ProviderToUse;\n const dep = await md.GetRecordDependencies(this.record.EntityInfo.Name, this.record.PrimaryKey);\n console.log('Dependencies for: ' + this.record.EntityInfo.Name + ' ' + this.record.PrimaryKey.ToString());\n console.log(dep);\n }\n\n public ShowChanges(): void {\n if (this.record) {\n const changes = this.record.GetAll(false, true);\n const oldValues = this.record.GetAll(true, true);\n const message =\n 'Changes for: ' + this.record.EntityInfo.Name + ' ' + this.record.PrimaryKey.ToString() +\n '\\n\\n' + JSON.stringify(changes, null, 2) +\n '\\n\\nOld Values\\n\\n' + JSON.stringify(oldValues, null, 2);\n console.log(message);\n this.Notification.emit({ Message: message, Type: 'info', Duration: 30000 });\n }\n }\n\n public async GetListsCanAddTo(): Promise<MJListEntity[]> {\n if (!this.record) {\n LogError('Unable to fetch List records: Record not found');\n return [];\n }\n\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const md = this.ProviderToUse;\n\n const rvResult: RunViewResult<MJListEntity> = await rv.RunView({\n EntityName: 'MJ: Lists',\n ExtraFilter: `UserID = '${md.CurrentUser.ID}' AND EntityID = '${this.record.EntityInfo.ID}'`,\n ResultType: 'entity_object'\n });\n\n if (!rvResult.Success) {\n LogError('Error running view to fetch lists', undefined, rvResult.ErrorMessage);\n return [];\n }\n\n return rvResult.Results;\n }\n\n public async GetRecordDependencies(): Promise<RecordDependency[]> {\n const md = this.ProviderToUse;\n const dependencies: RecordDependency[] = await md.GetRecordDependencies(this.record.EntityInfo.Name, this.record.PrimaryKey);\n return dependencies;\n }\n\n // #endregion\n\n // #region Collapsible Section Management\n\n protected sections: BaseFormSectionInfo[] = [];\n private sectionMap: Map<string, BaseFormSectionInfo> = new Map();\n\n public searchFilter: string = '';\n public showEmptyFields: boolean = false;\n\n /** Whether to show all validation errors on fields (set after save failure) */\n private _showValidation = false;\n /** Validation errors from the most recent failed save attempt */\n private _validationErrors: ValidationErrorInfo[] = [];\n\n public get formContext(): FormContext {\n return {\n sectionFilter: this.searchFilter,\n showEmptyFields: this.showEmptyFields,\n showValidation: this._showValidation,\n validationErrors: this._validationErrors,\n collapsibleSections: this.Config?.CollapsibleSections,\n enableRecordLinks: this.Config?.EnableRecordLinks,\n showRelatedEntities: this.Config?.ShowRelatedEntities,\n hiddenSectionKeys: this.resolveHiddenSectionKeys(),\n visibleSectionKeys: this.Config?.VisibleSectionKeys,\n allowSectionReorder: this.resolveAllowSectionReorder()\n };\n }\n\n /**\n * Config HiddenSectionKeys plus section keys winning contributions asked\n * to hide (related-entity claims and `replacesSectionKey` field panels).\n */\n private resolveHiddenSectionKeys(): string[] | undefined {\n const claimed = this.contributionHiddenSectionKeys();\n const configured = this.Config?.HiddenSectionKeys;\n if (claimed.length === 0) return configured;\n return [...(configured ?? []), ...claimed];\n }\n\n private contributionHiddenSectionKeys(): string[] {\n const entity = this.record?.EntityInfo;\n if (!entity) return [];\n return ContributionHiddenSectionKeys(\n entity.Name,\n entity.RelatedEntities,\n entity.ChildEntities.map((child) => child.ID),\n CollectFormPanelRegistrations(),\n );\n }\n\n /**\n * Resolves whether section drag-reorder is allowed for the current Config.\n * When no toolbar is rendered (dialog/slide-in, `Config.Toolbar === null`)\n * reorder is disabled; otherwise we honor the toolbar config's flag, defaulting\n * to allowed when unspecified (classic tab behavior).\n */\n private resolveAllowSectionReorder(): boolean {\n if (!this.Config) return true;\n if (this.Config.Toolbar === null) return false;\n return this.Config.Toolbar?.AllowSectionReorder ?? true;\n }\n\n /** Clears all validation display state (called on save success, cancel, end edit) */\n private clearValidationState(): void {\n this._showValidation = false;\n this._validationErrors = [];\n }\n\n private filterSubject = new Subject<string>();\n private filterSubscription?: Subscription;\n\n protected initSections(sections: (BaseFormSectionInfo | { sectionKey: string; sectionName: string; isExpanded: boolean; rowCount?: number; metadata?: unknown })[]): void {\n this.sections = sections.map(s =>\n s instanceof BaseFormSectionInfo\n ? s\n : new BaseFormSectionInfo(s.sectionKey, s.sectionName, s.isExpanded, s.rowCount, s.metadata)\n );\n this.sectionMap.clear();\n this.sections.forEach(section => {\n this.sectionMap.set(section.sectionKey, section);\n });\n }\n\n protected getSection(sectionKey: string): BaseFormSectionInfo | undefined {\n return this.sectionMap.get(sectionKey);\n }\n\n public IsSectionExpanded(sectionKey: string, defaultExpanded?: boolean): boolean {\n const section = this.sectionMap.get(sectionKey);\n // When the caller doesn't pass an explicit default, fall back to the value seeded by\n // initSections() — related-entity and System Metadata panels are seeded collapsed there.\n // Without this, FormStateService falls back to its global DEFAULT_SECTION_STATE (isExpanded=true),\n // which reports a never-before-visited related-entity panel as expanded and causes its data grid\n // (bound [AllowLoad]=\"IsSectionExpanded(key)\") to fetch on form open even while the panel is collapsed.\n // When the caller passes no explicit default, fall back to the value seeded by initSections().\n // If the section isn't in sectionMap yet — which happens during the window before the form's\n // async ngOnInit calls initSections(), e.g. when a record is opened already-loaded via an\n // in-app double-click so the grids render in the first change-detection pass — coalesce to\n // FALSE rather than letting FormStateService fall through to its global expanded default. A\n // missing section must NOT report as expanded, or its data grid (bound [AllowLoad]=\"IsSectionExpanded(key)\")\n // fires a RunView on open before the seeded collapsed default is applied.\n const resolvedDefault = defaultExpanded !== undefined ? defaultExpanded : (section?.isExpanded ?? false);\n const entityName = this.getEntityName();\n if (entityName) {\n return this.formStateService.isSectionExpanded(entityName, sectionKey, resolvedDefault);\n }\n return section ? section.isExpanded : (defaultExpanded !== undefined ? defaultExpanded : true);\n }\n\n public SetSectionExpanded(sectionKey: string, isExpanded: boolean): void {\n const entityName = this.getEntityName();\n if (entityName) {\n this.formStateService.setSectionExpanded(entityName, sectionKey, isExpanded);\n }\n const section = this.sectionMap.get(sectionKey);\n if (section) {\n section.isExpanded = isExpanded;\n }\n }\n\n public GetSectionRowCount(sectionKey: string): number | undefined {\n const section = this.sectionMap.get(sectionKey);\n return section?.rowCount;\n }\n\n public SetSectionRowCount(sectionKey: string, rowCount: number): void {\n let section = this.sectionMap.get(sectionKey);\n if (!section) {\n // Contribution panels use their own SectionKey (e.g. 'orders') which\n // is never seeded by generated initSections(). Upsert so the left-nav\n // rail badge can read the count the same way baked grids do.\n section = new BaseFormSectionInfo(sectionKey, sectionKey, false, rowCount);\n this.sections.push(section);\n this.sectionMap.set(sectionKey, section);\n } else {\n section.rowCount = rowCount;\n }\n this.cdr.markForCheck();\n }\n\n public GetSectionPanelHeight(sectionKey: string): number | undefined {\n const entityName = this.getEntityName();\n if (entityName) {\n return this.formStateService.getSectionPanelHeight(entityName, sectionKey);\n }\n return undefined;\n }\n\n public SetSectionPanelHeight(sectionKey: string, height: number): void {\n const entityName = this.getEntityName();\n if (entityName) {\n this.formStateService.setSectionPanelHeight(entityName, sectionKey, height);\n }\n }\n\n public toggleSection(sectionKey: string): void {\n const entityName = this.getEntityName();\n if (entityName) {\n this.formStateService.toggleSection(entityName, sectionKey);\n }\n const section = this.sectionMap.get(sectionKey);\n if (section) {\n section.isExpanded = !section.isExpanded;\n }\n }\n\n /**\n * Expand any sections that are visible (match the current filter) but currently collapsed.\n * Called after filter changes so the user can immediately see matching content.\n */\n private expandMatchingSections(): void {\n if (!this.collapsiblePanels) return;\n this.collapsiblePanels.forEach(panel => {\n if (panel.IsVisible && !panel.Expanded) {\n this.SetSectionExpanded(panel.SectionKey, true);\n }\n });\n }\n\n public expandAllSections(): void {\n const entityName = this.getEntityName();\n const sectionKeys = this.sections.map(s => s.sectionKey);\n if (entityName && sectionKeys.length > 0) {\n this.formStateService.expandAllSections(entityName, sectionKeys);\n }\n this.sections.forEach(section => {\n section.isExpanded = true;\n });\n }\n\n public collapseAllSections(): void {\n const entityName = this.getEntityName();\n const sectionKeys = this.sections.map(s => s.sectionKey);\n if (entityName && sectionKeys.length > 0) {\n this.formStateService.collapseAllSections(entityName, sectionKeys);\n }\n this.sections.forEach(section => {\n section.isExpanded = false;\n });\n }\n\n public getExpandedCount(): number {\n const entityName = this.getEntityName();\n const sectionKeys = this.sections.map(s => s.sectionKey);\n if (entityName && sectionKeys.length > 0) {\n return this.formStateService.getExpandedCount(entityName, sectionKeys);\n }\n return this.sections.filter(section => section.isExpanded).length;\n }\n\n public getVisibleSectionCount(): number {\n if (!this.collapsiblePanels || this.collapsiblePanels.length === 0) {\n return this.sections.length;\n }\n return this.collapsiblePanels.filter(panel => panel.IsVisible).length;\n }\n\n public getTotalSectionCount(): number {\n return this.sections.length;\n }\n\n public onFilterChange(searchTerm: string): void {\n this.filterSubject.next(searchTerm);\n }\n\n public getEntityName(): string {\n return this.record?.EntityInfo?.Name || '';\n }\n\n /**\n * Component-level default width mode, used when the user has NOT\n * explicitly chosen a width for this entity yet (first visit, nothing\n * persisted in User Settings). Subclasses can override this — for\n * example, custom forms with full-bleed layouts should return\n * `'full-width'` here and the container will respect it on first open.\n *\n * Once the user toggles the width via the toolbar, their choice\n * persists via `setFormWidthMode()` and takes priority over this\n * default on subsequent opens.\n */\n public getDefaultFormWidthMode(): 'centered' | 'full-width' {\n return this.Config?.WidthMode ?? 'centered';\n }\n\n public getFormWidthMode(): 'centered' | 'full-width' {\n const entityName = this.getEntityName();\n if (entityName && this.formStateService.hasExplicitWidthMode(entityName)) {\n return this.formStateService.getWidthMode(entityName);\n }\n return this.getDefaultFormWidthMode();\n }\n\n public setFormWidthMode(widthMode: 'centered' | 'full-width'): void {\n const entityName = this.getEntityName();\n if (entityName) {\n this.formStateService.setWidthMode(entityName, widthMode);\n }\n }\n\n public toggleFormWidthMode(): void {\n const entityName = this.getEntityName();\n if (entityName) {\n this.formStateService.toggleWidthMode(entityName);\n }\n }\n\n // #endregion\n\n // #region Section Ordering\n\n public getSectionOrder(): string[] {\n const entityName = this.getEntityName();\n if (entityName) {\n const customOrder = this.formStateService.getSectionOrder(entityName);\n if (customOrder && customOrder.length > 0) {\n return customOrder;\n }\n }\n return this.sections.map(s => s.sectionKey);\n }\n\n public setSectionOrder(sectionOrder: string[]): void {\n const entityName = this.getEntityName();\n if (entityName) {\n this.formStateService.setSectionOrder(entityName, sectionOrder);\n }\n }\n\n public resetSectionOrder(): void {\n const entityName = this.getEntityName();\n if (entityName) {\n this.formStateService.resetSectionOrder(entityName);\n }\n }\n\n public hasCustomSectionOrder(): boolean {\n const entityName = this.getEntityName();\n if (entityName) {\n return this.formStateService.hasCustomSectionOrder(entityName);\n }\n return false;\n }\n\n public getMoreSectionKeys(): string[] {\n const entityName = this.getEntityName();\n if (!entityName) return [];\n return this.formStateService.getMoreSectionKeys(entityName) ?? [];\n }\n\n public getFirstClassSectionKeys(): string[] {\n const entityName = this.getEntityName();\n if (!entityName) return [];\n return this.formStateService.getFirstClassSectionKeys(entityName) ?? [];\n }\n\n public setChromeMembership(moreSectionKeys: string[], firstClassSectionKeys: string[]): void {\n const entityName = this.getEntityName();\n if (entityName) {\n this.formStateService.setChromeMembership(entityName, moreSectionKeys, firstClassSectionKeys);\n }\n }\n\n public getSectionDisplayOrder(sectionKey: string): number {\n const order = this.getSectionOrder();\n const index = order.indexOf(sectionKey);\n return index >= 0 ? index : this.sections.length;\n }\n\n // #endregion\n\n // #region Form Container Event Handlers\n\n /**\n * Handles navigation events from the form container and related entity grids.\n * Relays the event upward via the Navigate @Output for the host application to handle.\n * Generated form templates bind this as: (Navigate)=\"OnFormNavigate($event)\"\n */\n public OnFormNavigate(event: FormNavigationEvent): void {\n this.Navigate.emit(event);\n }\n\n /**\n * Handles delete requests from the form container.\n * Emits RecordDeleted on success, RecordDeleteFailed on failure.\n * Generated form templates bind this as: (DeleteRequested)=\"OnDeleteRequested()\"\n */\n public async OnDeleteRequested(): Promise<void> {\n if (!this.record || !this.record.IsSaved) return;\n try {\n const result = await this.record.Delete();\n if (result) {\n this.Notification.emit({ Message: 'Record deleted successfully', Type: 'success', Duration: 2500 });\n this.RecordDeleted.emit({\n EntityName: this.record.EntityInfo.Name,\n RecordId: this.record.PrimaryKey.ToString()\n });\n } else {\n const errorMsg = 'Error deleting record';\n this.Notification.emit({ Message: errorMsg, Type: 'error', Duration: 5000 });\n this.RecordDeleteFailed.emit({ EntityName: this.record.EntityInfo.Name, ErrorMessage: errorMsg });\n }\n } catch (e) {\n const errorMsg = 'Error deleting record: ' + e;\n this.Notification.emit({ Message: errorMsg, Type: 'error', Duration: 5000 });\n this.RecordDeleteFailed.emit({ EntityName: this.record.EntityInfo.Name, ErrorMessage: errorMsg });\n }\n }\n\n /**\n * Handles favorite toggle from the form container.\n * Generated form templates bind this as: (FavoriteToggled)=\"OnFavoriteToggled()\"\n */\n public async OnFavoriteToggled(): Promise<void> {\n await this.SetFavoriteStatus(!this.IsFavorite);\n }\n\n /**\n * Handles history view requests from the form container.\n * Generated form templates bind this as: (HistoryRequested)=\"OnHistoryRequested()\"\n */\n public OnHistoryRequested(): void {\n this.handleHistoryDialog();\n }\n\n /**\n * Handles list management requests from the form container.\n * Generated form templates bind this as: (ListManagementRequested)=\"OnListManagementRequested()\"\n */\n public OnListManagementRequested(): void {\n // List management dialog is handled by the host application\n // Subclasses can override this to implement custom list management\n }\n\n // #endregion\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optional last-wins chrome decorator. Apps register a subclass with
|
|
3
|
+
* `@RegisterClassEx(BaseFormPolicy, { metadata: { entity } })`.
|
|
4
|
+
*
|
|
5
|
+
* Downstream subclasses the upstream policy (`OrdersPersonFormPolicy extends
|
|
6
|
+
* CommonPersonFormPolicy`). The policy may rename groups, swap icons, or wrap
|
|
7
|
+
* labels. It MUST NOT add, remove, or re-bucket sections — inclusion is data
|
|
8
|
+
* (L1 / L3). See `plans/form-chrome-layering.md`.
|
|
9
|
+
*/
|
|
10
|
+
import type { EntityInfo } from '@memberjunction/core';
|
|
11
|
+
import type { RelatedFormRoleResolution } from '@memberjunction/core';
|
|
12
|
+
import type { FormChromePanelSnapshot, FormChromeSpec } from './form-chrome';
|
|
13
|
+
export interface FormChromeContext {
|
|
14
|
+
Entity: EntityInfo;
|
|
15
|
+
RelatedRoles: RelatedFormRoleResolution;
|
|
16
|
+
Panels: FormChromePanelSnapshot[];
|
|
17
|
+
/** First-class section count the default resolver would use for Layout auto. */
|
|
18
|
+
PrimarySectionCount: number;
|
|
19
|
+
}
|
|
20
|
+
export declare class BaseFormPolicy {
|
|
21
|
+
/**
|
|
22
|
+
* Cosmetics on an already-resolved spec. Return the same groups/membership.
|
|
23
|
+
*/
|
|
24
|
+
DecorateChrome(spec: FormChromeSpec, _ctx: FormChromeContext): FormChromeSpec;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=base-form-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-form-policy.d.ts","sourceRoot":"","sources":["../../../src/lib/chrome/base-form-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE7E,MAAM,WAAW,iBAAiB;IAC9B,MAAM,EAAE,UAAU,CAAC;IACnB,YAAY,EAAE,yBAAyB,CAAC;IACxC,MAAM,EAAE,uBAAuB,EAAE,CAAC;IAClC,gFAAgF;IAChF,mBAAmB,EAAE,MAAM,CAAC;CAC/B;AAED,qBAAa,cAAc;IACvB;;OAEG;IACI,cAAc,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,iBAAiB,GAAG,cAAc;CAGvF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-form-policy.js","sourceRoot":"","sources":["../../../src/lib/chrome/base-form-policy.ts"],"names":[],"mappings":"AAqBA,MAAM,OAAO,cAAc;IACvB;;OAEG;IACI,cAAc,CAAC,IAAoB,EAAE,IAAuB;QAC/D,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["/**\n * Optional last-wins chrome decorator. Apps register a subclass with\n * `@RegisterClassEx(BaseFormPolicy, { metadata: { entity } })`.\n *\n * Downstream subclasses the upstream policy (`OrdersPersonFormPolicy extends\n * CommonPersonFormPolicy`). The policy may rename groups, swap icons, or wrap\n * labels. It MUST NOT add, remove, or re-bucket sections — inclusion is data\n * (L1 / L3). See `plans/form-chrome-layering.md`.\n */\nimport type { EntityInfo } from '@memberjunction/core';\nimport type { RelatedFormRoleResolution } from '@memberjunction/core';\nimport type { FormChromePanelSnapshot, FormChromeSpec } from './form-chrome';\n\nexport interface FormChromeContext {\n Entity: EntityInfo;\n RelatedRoles: RelatedFormRoleResolution;\n Panels: FormChromePanelSnapshot[];\n /** First-class section count the default resolver would use for Layout auto. */\n PrimarySectionCount: number;\n}\n\nexport class BaseFormPolicy {\n /**\n * Cosmetics on an already-resolved spec. Return the same groups/membership.\n */\n public DecorateChrome(spec: FormChromeSpec, _ctx: FormChromeContext): FormChromeSpec {\n return spec;\n }\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** True when the element's text is ellipsized (horizontal or vertical). */
|
|
2
|
+
export declare function IsTextClipped(el: HTMLElement | null | undefined): boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Native tooltip only when the visible text is clipped. Clears `title`
|
|
5
|
+
* when the full string already fits so hover is not noisy.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ApplyClippedTitle(el: HTMLElement | null | undefined, text: string): void;
|
|
8
|
+
//# sourceMappingURL=clipped-title.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clipped-title.d.ts","sourceRoot":"","sources":["../../../src/lib/chrome/clipped-title.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,wBAAgB,aAAa,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAIzE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAIxF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** True when the element's text is ellipsized (horizontal or vertical). */
|
|
2
|
+
export function IsTextClipped(el) {
|
|
3
|
+
if (!el)
|
|
4
|
+
return false;
|
|
5
|
+
return el.scrollWidth - el.clientWidth > 1
|
|
6
|
+
|| el.scrollHeight - el.clientHeight > 1;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Native tooltip only when the visible text is clipped. Clears `title`
|
|
10
|
+
* when the full string already fits so hover is not noisy.
|
|
11
|
+
*/
|
|
12
|
+
export function ApplyClippedTitle(el, text) {
|
|
13
|
+
if (!el)
|
|
14
|
+
return;
|
|
15
|
+
const title = (text ?? '').trim();
|
|
16
|
+
el.title = title && IsTextClipped(el) ? title : '';
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=clipped-title.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clipped-title.js","sourceRoot":"","sources":["../../../src/lib/chrome/clipped-title.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,MAAM,UAAU,aAAa,CAAC,EAAkC;IAC5D,IAAI,CAAC,EAAE;QAAE,OAAO,KAAK,CAAC;IACtB,OAAO,EAAE,CAAC,WAAW,GAAG,EAAE,CAAC,WAAW,GAAG,CAAC;WACnC,EAAE,CAAC,YAAY,GAAG,EAAE,CAAC,YAAY,GAAG,CAAC,CAAC;AACjD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAAkC,EAAE,IAAY;IAC9E,IAAI,CAAC,EAAE;QAAE,OAAO;IAChB,MAAM,KAAK,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAClC,EAAE,CAAC,KAAK,GAAG,KAAK,IAAI,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACvD,CAAC","sourcesContent":["/** True when the element's text is ellipsized (horizontal or vertical). */\nexport function IsTextClipped(el: HTMLElement | null | undefined): boolean {\n if (!el) return false;\n return el.scrollWidth - el.clientWidth > 1\n || el.scrollHeight - el.clientHeight > 1;\n}\n\n/**\n * Native tooltip only when the visible text is clipped. Clears `title`\n * when the full string already fits so hover is not noisy.\n */\nexport function ApplyClippedTitle(el: HTMLElement | null | undefined, text: string): void {\n if (!el) return;\n const title = (text ?? '').trim();\n el.title = title && IsTextClipped(el) ? title : '';\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Subject } from 'rxjs';
|
|
2
|
+
import { type FormChromeSpec } from './form-chrome';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Per-container chrome state. Provided by `<mj-record-form-container>` so
|
|
6
|
+
* projected panels and fill-in stock grids share one spec.
|
|
7
|
+
*/
|
|
8
|
+
export declare class FormChromeCoordinator {
|
|
9
|
+
Spec: FormChromeSpec;
|
|
10
|
+
MoreExpanded: boolean;
|
|
11
|
+
ActiveGroupKey: string | null;
|
|
12
|
+
readonly Changes: Subject<void>;
|
|
13
|
+
Apply(spec: FormChromeSpec): void;
|
|
14
|
+
IsRelatedSectionVisible(sectionKey: string): boolean;
|
|
15
|
+
IsFirstClassSectionVisible(sectionKey: string): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Accordion hides every More member — field panels included — until
|
|
18
|
+
* the overflow footer is expanded. Left-nav does not use this.
|
|
19
|
+
*/
|
|
20
|
+
IsAccordionSectionVisible(sectionKey: string): boolean;
|
|
21
|
+
SetActiveGroup(groupKey: string): void;
|
|
22
|
+
ToggleMoreFolder(): void;
|
|
23
|
+
ToggleMore(expanded: boolean): void;
|
|
24
|
+
get IsMoreActive(): boolean;
|
|
25
|
+
HidesAccordionChrome(sectionKey: string): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Left-nav shows only the selected rail item — including a More child.
|
|
28
|
+
* Clicking the More folder does not dump every leftover panel.
|
|
29
|
+
*/
|
|
30
|
+
private isLeftNavVisible;
|
|
31
|
+
private isMoreChild;
|
|
32
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormChromeCoordinator, never>;
|
|
33
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FormChromeCoordinator>;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=form-chrome-coordinator.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-chrome-coordinator.service.d.ts","sourceRoot":"","sources":["../../../src/lib/chrome/form-chrome-coordinator.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAA8C,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;;AAGhG;;;GAGG;AACH,qBACa,qBAAqB;IACvB,IAAI,EAAE,cAAc,CAA4B;IAChD,YAAY,UAAS;IACrB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC5C,SAAgB,OAAO,gBAAuB;IAEvC,KAAK,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI;IAWjC,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAOpD,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAO9D;;;OAGG;IACI,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAMtD,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAQtC,gBAAgB,IAAI,IAAI;IAKxB,UAAU,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI;IAK1C,IAAW,YAAY,IAAI,OAAO,CAEjC;IAEM,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAKxD;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAQxB,OAAO,CAAC,WAAW;yCAhFV,qBAAqB;6CAArB,qBAAqB;CAoFjC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { Subject } from 'rxjs';
|
|
3
|
+
import { DEFAULT_FORM_CHROME_SPEC, MORE_SECTION_KEY } from './form-chrome';
|
|
4
|
+
import { StabilizeFirstClassGroupOrder } from './resolve-form-chrome';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Per-container chrome state. Provided by `<mj-record-form-container>` so
|
|
8
|
+
* projected panels and fill-in stock grids share one spec.
|
|
9
|
+
*/
|
|
10
|
+
export class FormChromeCoordinator {
|
|
11
|
+
Spec = DEFAULT_FORM_CHROME_SPEC;
|
|
12
|
+
MoreExpanded = false;
|
|
13
|
+
ActiveGroupKey = null;
|
|
14
|
+
Changes = new Subject();
|
|
15
|
+
Apply(spec) {
|
|
16
|
+
this.Spec = StabilizeFirstClassGroupOrder(this.Spec, spec);
|
|
17
|
+
if (spec.Layout === 'left-nav') {
|
|
18
|
+
const stillValid = spec.Groups.some((g) => g.Key === this.ActiveGroupKey);
|
|
19
|
+
if (!stillValid) {
|
|
20
|
+
this.ActiveGroupKey = spec.Groups[0]?.Key ?? null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
this.Changes.next();
|
|
24
|
+
}
|
|
25
|
+
IsRelatedSectionVisible(sectionKey) {
|
|
26
|
+
if (this.Spec.Layout === 'accordion') {
|
|
27
|
+
return this.IsAccordionSectionVisible(sectionKey);
|
|
28
|
+
}
|
|
29
|
+
return this.isLeftNavVisible(sectionKey);
|
|
30
|
+
}
|
|
31
|
+
IsFirstClassSectionVisible(sectionKey) {
|
|
32
|
+
if (this.Spec.Layout === 'accordion') {
|
|
33
|
+
return this.IsAccordionSectionVisible(sectionKey);
|
|
34
|
+
}
|
|
35
|
+
return this.isLeftNavVisible(sectionKey);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Accordion hides every More member — field panels included — until
|
|
39
|
+
* the overflow footer is expanded. Left-nav does not use this.
|
|
40
|
+
*/
|
|
41
|
+
IsAccordionSectionVisible(sectionKey) {
|
|
42
|
+
if (this.Spec.Layout !== 'accordion')
|
|
43
|
+
return true;
|
|
44
|
+
if (this.Spec.MoreSectionKeys.includes(sectionKey))
|
|
45
|
+
return this.MoreExpanded;
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
SetActiveGroup(groupKey) {
|
|
49
|
+
this.ActiveGroupKey = groupKey;
|
|
50
|
+
if (this.isMoreChild(groupKey)) {
|
|
51
|
+
this.MoreExpanded = true;
|
|
52
|
+
}
|
|
53
|
+
this.Changes.next();
|
|
54
|
+
}
|
|
55
|
+
ToggleMoreFolder() {
|
|
56
|
+
this.MoreExpanded = !this.MoreExpanded;
|
|
57
|
+
this.Changes.next();
|
|
58
|
+
}
|
|
59
|
+
ToggleMore(expanded) {
|
|
60
|
+
this.MoreExpanded = expanded;
|
|
61
|
+
this.Changes.next();
|
|
62
|
+
}
|
|
63
|
+
get IsMoreActive() {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
HidesAccordionChrome(sectionKey) {
|
|
67
|
+
if (this.Spec.Layout !== 'left-nav')
|
|
68
|
+
return false;
|
|
69
|
+
return this.isLeftNavVisible(sectionKey);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Left-nav shows only the selected rail item — including a More child.
|
|
73
|
+
* Clicking the More folder does not dump every leftover panel.
|
|
74
|
+
*/
|
|
75
|
+
isLeftNavVisible(sectionKey) {
|
|
76
|
+
if (this.Spec.Layout !== 'left-nav')
|
|
77
|
+
return true;
|
|
78
|
+
if (this.ActiveGroupKey === sectionKey)
|
|
79
|
+
return true;
|
|
80
|
+
const group = this.Spec.Groups.find((g) => g.SectionKeys.includes(sectionKey));
|
|
81
|
+
if (!group || group.IsMore)
|
|
82
|
+
return false;
|
|
83
|
+
return group.Key === this.ActiveGroupKey;
|
|
84
|
+
}
|
|
85
|
+
isMoreChild(groupKey) {
|
|
86
|
+
if (groupKey === MORE_SECTION_KEY)
|
|
87
|
+
return false;
|
|
88
|
+
return this.Spec.MoreSectionKeys.includes(groupKey);
|
|
89
|
+
}
|
|
90
|
+
static ɵfac = function FormChromeCoordinator_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FormChromeCoordinator)(); };
|
|
91
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: FormChromeCoordinator, factory: FormChromeCoordinator.ɵfac });
|
|
92
|
+
}
|
|
93
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FormChromeCoordinator, [{
|
|
94
|
+
type: Injectable
|
|
95
|
+
}], null, null); })();
|
|
96
|
+
//# sourceMappingURL=form-chrome-coordinator.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-chrome-coordinator.service.js","sourceRoot":"","sources":["../../../src/lib/chrome/form-chrome-coordinator.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAuB,MAAM,eAAe,CAAC;AAChG,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;;AAEtE;;;GAGG;AAEH,MAAM,OAAO,qBAAqB;IACvB,IAAI,GAAmB,wBAAwB,CAAC;IAChD,YAAY,GAAG,KAAK,CAAC;IACrB,cAAc,GAAkB,IAAI,CAAC;IAC5B,OAAO,GAAG,IAAI,OAAO,EAAQ,CAAC;IAEvC,KAAK,CAAC,IAAoB;QAC7B,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC3D,IAAI,IAAI,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;YAC7B,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,cAAc,CAAC,CAAC;YAC1E,IAAI,CAAC,UAAU,EAAE,CAA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M_CHROME_SPEC, MORE_SECTION_KEY, type FormChromeSpec } from './form-chrome';\nimport { StabilizeFirstClassGroupOrder } from './resolve-form-chrome';\n\n/**\n * Per-container chrome state. Provided by `<mj-record-form-container>` so\n * projected panels and fill-in stock grids share one spec.\n */\n@Injectable()\nexport class FormChromeCoordinator {\n public Spec: FormChromeSpec = DEFAULT_FORM_CHROME_SPEC;\n public MoreExpanded = false;\n public ActiveGroupKey: string | null = null;\n public readonly Changes = new Subject<void>();\n\n public Apply(spec: FormChromeSpec): void {\n this.Spec = StabilizeFirstClassGroupOrder(this.Spec, spec);\n if (spec.Layout === 'left-nav') {\n const stillValid = spec.Groups.some((g) => g.Key === this.ActiveGroupKey);\n if (!stillValid) {\n this.ActiveGroupKey = spec.Groups[0]?.Key ?? null;\n }\n }\n this.Changes.next();\n }\n\n public IsRelatedSectionVisible(sectionKey: string): boolean {\n if (this.Spec.Layout === 'accordion') {\n return this.IsAccordionSectionVisible(sectionKey);\n }\n return this.isLeftNavVisible(sectionKey);\n }\n\n public IsFirstClassSectionVisible(sectionKey: string): boolean {\n if (this.Spec.Layout === 'accordion') {\n return this.IsAccordionSectionVisible(sectionKey);\n }\n return this.isLeftNavVisible(sectionKey);\n }\n\n /**\n * Accordion hides every More member — field panels included — until\n * the overflow footer is expanded. Left-nav does not use this.\n */\n public IsAccordionSectionVisible(sectionKey: string): boolean {\n if (this.Spec.Layout !== 'accordion') return true;\n if (this.Spec.MoreSectionKeys.includes(sectionKey)) return this.MoreExpanded;\n return true;\n }\n\n public SetActiveGroup(groupKey: string): void {\n this.ActiveGroupKey = groupKey;\n if (this.isMoreChild(groupKey)) {\n this.MoreExpanded = true;\n }\n this.Changes.next();\n }\n\n public ToggleMoreFolder(): void {\n this.MoreExpanded = !this.MoreExpanded;\n this.Changes.next();\n }\n\n public ToggleMore(expanded: boolean): void {\n this.MoreExpanded = expanded;\n this.Changes.next();\n }\n\n public get IsMoreActive(): boolean {\n return false;\n }\n\n public HidesAccordionChrome(sectionKey: string): boolean {\n if (this.Spec.Layout !== 'left-nav') return false;\n return this.isLeftNavVisible(sectionKey);\n }\n\n /**\n * Left-nav shows only the selected rail item — including a More child.\n * Clicking the More folder does not dump every leftover panel.\n */\n private isLeftNavVisible(sectionKey: string): boolean {\n if (this.Spec.Layout !== 'left-nav') return true;\n if (this.ActiveGroupKey === sectionKey) return true;\n const group = this.Spec.Groups.find((g) => g.SectionKeys.includes(sectionKey));\n if (!group || group.IsMore) return false;\n return group.Key === this.ActiveGroupKey;\n }\n\n private isMoreChild(groupKey: string): boolean {\n if (groupKey === MORE_SECTION_KEY) return false;\n return this.Spec.MoreSectionKeys.includes(groupKey);\n }\n}\n"]}
|