UNPKG

armisa-models

Version:
107 lines (106 loc) 4.61 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MenuSubItemFactory = void 0; const _4_MenuChilOfSubMenuItemFactory_1 = require("./4-MenuChilOfSubMenuItemFactory"); class MenuSubItemFactory { constructor(menuItemFactory, caption, accounting, purchase, sale, treasury, warehouse, produce, pms, costOfGoods, payment, asset, warranty, automation, dailyDistribution, preventindMaintainance, workflow, path, Page, exact, onClick, typeOfForm) { this.menuItemFactory = menuItemFactory; this.caption = caption; this.accounting = accounting; this.purchase = purchase; this.sale = sale; this.treasury = treasury; this.warehouse = warehouse; this.produce = produce; this.pms = pms; this.costOfGoods = costOfGoods; this.payment = payment; this.asset = asset; this.warranty = warranty; this.automation = automation; this.dailyDistribution = dailyDistribution; this.preventindMaintainance = preventindMaintainance; this.workflow = workflow; this.path = path; this.Page = Page; this.exact = exact; this.onClick = onClick; this.typeOfForm = typeOfForm; this.visible = true; this.childOfSubMenuItems = []; this.keyOfSubItem = this.menuItemFactory.subMenuItems.length + 'subMenu'; } addNewSubMenuItem(caption) { let captionFinal = ''; if (caption) { if (typeof caption === 'string') { captionFinal = caption; } else if (caption) { captionFinal = this.menuItemFactory.menuFactory.mainStateManager.getCaptionNaming(caption); } } const childOfSubMenuItems = new _4_MenuChilOfSubMenuItemFactory_1.ChildOfSubMenuItemFactory(this, captionFinal); this.childOfSubMenuItems.push(childOfSubMenuItems); return childOfSubMenuItems; } get isAllSystems() { return (this.accounting && this.asset && this.automation && this.costOfGoods && this.dailyDistribution && this.payment && this.pms && this.preventindMaintainance && this.pms && this.produce && this.purchase && this.sale && this.treasury && this.warehouse && this.warranty && this.workflow) || (!this.accounting && !this.asset && !this.automation && !this.costOfGoods && !this.dailyDistribution && !this.payment && !this.pms && !this.preventindMaintainance && !this.pms && !this.produce && !this.purchase && !this.sale && !this.treasury && !this.warehouse && !this.warranty && !this.workflow); } get isSystemSelected() { // return this.visible && // ( // this.isAllSystems || // this.currentSelected.accounting && this.accounting || // this.currentSelected.asset && this.asset || // this.currentSelected.automation && this.automation || // this.currentSelected.costOfGoods && this.costOfGoods || // this.currentSelected.dailyDistribution && this.dailyDistribution || // this.currentSelected.payment && this.payment || // this.currentSelected.pms && this.pms || // this.currentSelected.preventindMaintainance && this.preventindMaintainance || // this.currentSelected.produce && this.produce || // this.currentSelected.purchase && this.purchase || // this.currentSelected.sale && this.sale || // this.currentSelected.treasury && this.treasury || // this.currentSelected.warehouse && this.warehouse || // this.currentSelected.warranty && this.warranty || // this.currentSelected.workflow && this.workflow || // this.childOfSubMenuItems.some(i => i.isSystemSelected()) // ); // } return true; } } exports.MenuSubItemFactory = MenuSubItemFactory;