PlanTempusApp/PlanTempus.Application/wwwroot/ts/app.ts
Janus C. H. Knudsen 51f3b92d69 Enhances application menu and adds calendar feature
Adds new calendar page and module with comprehensive initialization

Introduces quick actions group in side menu with create booking and sale options
Updates menu service to include new menu groups and rearrange sort order
Configures custom npm registry and esbuild configuration
Adds localization for new menu items and calendar section

Implements calendar controller with dependency injection and settings seeding
2026-02-02 22:42:18 +01:00

85 lines
2.6 KiB
TypeScript

/**
* Salon OS App
*
* Main application class that orchestrates all UI controllers
*/
import { SidebarController } from './modules/sidebar';
import { DrawerController } from './modules/drawers';
import { ThemeController } from './modules/theme';
import { SearchController } from './modules/search';
import { LockScreenController } from './modules/lockscreen';
import { CashController } from './modules/cash';
import { EmployeesController } from './modules/employees';
import { ControlsController } from './modules/controls';
import { ServicesController } from './modules/services';
import { CustomersController } from './modules/customers';
import { SuppliersController } from './modules/suppliers';
import { TrackingController } from './modules/tracking';
import { ReportsController } from './modules/reports';
import { CalendarController } from './modules/calendar';
/**
* Main application class
*/
export class App {
readonly sidebar: SidebarController;
readonly drawers: DrawerController;
readonly theme: ThemeController;
readonly search: SearchController;
readonly lockScreen: LockScreenController;
readonly cash: CashController;
readonly employees: EmployeesController;
readonly controls: ControlsController;
readonly services: ServicesController;
readonly customers: CustomersController;
readonly suppliers: SuppliersController;
readonly tracking: TrackingController;
readonly reports: ReportsController;
readonly calendar: CalendarController;
constructor() {
// Initialize controllers
this.sidebar = new SidebarController();
this.drawers = new DrawerController();
this.theme = new ThemeController();
this.search = new SearchController();
this.lockScreen = new LockScreenController(this.drawers);
this.cash = new CashController();
this.employees = new EmployeesController();
this.controls = new ControlsController();
this.services = new ServicesController();
this.customers = new CustomersController();
this.suppliers = new SuppliersController();
this.tracking = new TrackingController();
this.reports = new ReportsController();
this.calendar = new CalendarController();
}
}
/**
* Global app instance
*/
let app: App;
/**
* Initialize the application
*/
function init(): void {
app = new App();
// Expose app to window for debugging
if (typeof window !== 'undefined') {
(window as unknown as { app: App }).app = app;
}
}
// Wait for DOM ready
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init);
} else {
init();
}
export { app };
export default App;