import LocalControlsNavigation from "./LocalControlsNavigation"; import LocalFooterSection from "./LocalControlsFooterSection"; import LocalFormSelector from "./LocalControlsFormSelector"; import LocalHeaderSection from "./LocalControlsHeaderSection"; import LocalItemCollection from "./LocalItemCollection"; import LocalProcessControl from "./LocalControlsProcessControl"; function getWindowDimensions() { const { innerWidth: width, innerHeight: height } = window; return { width, height }; } export default class LocalPageUi implements Xrm.Ui { footerSection: Xrm.Controls.FooterSection; headerSection: Xrm.Controls.HeaderSection; process: Xrm.Controls.ProcessControl; controls: Xrm.Collection.ItemCollection; formSelector: Xrm.Controls.FormSelector; navigation: Xrm.Controls.Navigation; tabs: Xrm.Collection.ItemCollection; quickForms: Xrm.Collection.ItemCollection; constructor() { this.footerSection = new LocalFooterSection(); this.headerSection = new LocalHeaderSection(); this.process = new LocalProcessControl(); this.controls = new LocalItemCollection(); this.formSelector = new LocalFormSelector(); this.navigation = new LocalControlsNavigation(); this.tabs = new LocalItemCollection(); this.quickForms = new LocalItemCollection(); } addOnLoad(handler: Xrm.Events.LoadEventHandler | Xrm.Events.LoadEventHandlerAsync): void { } setFormNotification(message: string, level: Xrm.FormNotificationLevel, uniqueId: string): boolean { return true; } clearFormNotification(uniqueId: string): boolean { return true; } close(): void { } getFormType(): XrmEnum.FormType { return 1; // Create } getViewPortHeight(): number { const { height } = getWindowDimensions(); return height; } getViewPortWidth(): number { const { width } = getWindowDimensions(); return width; } refreshRibbon(refreshAll?: boolean | undefined): void { } removeOnLoad(handler: Xrm.Events.LoadEventHandler | Xrm.Events.LoadEventHandlerAsync): void { } setFormEntityName(name: string): void { throw new Error("Method not implemented."); } }