UNPKG

armisa-models

Version:
108 lines (107 loc) 4.88 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StackFontPrintName = exports.StackSeparatorPrintState = exports.StackSeparator = exports.StackSubMenuItemChildClass = exports.StackSubMenuItemClass = exports.StackMenuItemClass = exports.StackIcon = void 0; class StackIcon { constructor(pageData, id, type, size, tabIndex, naming, role, subRole, disabled) { this.pageData = pageData; this.id = id; this.type = type; this.size = size; this.tabIndex = tabIndex; this.naming = naming; this.role = role; this.subRole = subRole; this.disabled = disabled; this.name = `${type}_${id}`; if (naming) { this.caption = this.pageData.mainStateManager.getCaptionNaming(naming); } } static buildNewIcon(pageData, id, type, onClick, size, tabIndex, popup, naming, role, subRole, disabled) { const newItem = new StackMenuItemClass(pageData, id, type, false, popup, naming, size || 2, tabIndex, role, subRole, disabled); newItem.onClick = onClick; return newItem; } static buildNewSubIcon(parent, pageData, id, type, naming, onClick, size, tabIndex, role, subRole, disabled) { const newItem = new StackSubMenuItemClass(parent, pageData, id, type, naming, size || 2, tabIndex, role, subRole, disabled); newItem.onClick = onClick; return newItem; } static buildNewSubChildIcon(parent, pageData, id, type, naming, onClick, size, tabIndex, role, subRole, disabled) { const newItem = new StackSubMenuItemChildClass(parent, pageData, id, type, naming, size || 2, tabIndex, role, subRole, disabled); newItem.onClick = onClick; return newItem; } static buildNewSeparator(pageData, id) { const newItem = new StackSeparator(pageData, id, undefined, 2, undefined, undefined, undefined, undefined); return newItem; } static buildNewSeparatorPrintReportState(parent, pageData, id, action, size, tabIndex) { const newItem = new StackSeparatorPrintState(parent, pageData, id, action, tabIndex, size); return newItem; } static buildNewFontPrintName(parent, pageData, id, action, size, tabIndex) { const newItem = new StackFontPrintName(parent, pageData, id, action, tabIndex, size); return newItem; } } exports.StackIcon = StackIcon; class StackMenuItemClass extends StackIcon { constructor(pageData, id, type, toolTip, popup, naming, size, tabIndex, role, subRole, disabled) { super(pageData, id, type, size || 2, tabIndex, naming, role, subRole, disabled); this.toolTip = toolTip; this.popup = popup; this.subMenuItems = []; if (!pageData.stackIcons) { pageData.stackIcons = []; } pageData.stackIcons.push(this); } } exports.StackMenuItemClass = StackMenuItemClass; class StackSubMenuItemClass extends StackIcon { constructor(parent, pageData, id, type, naming, size, tabIndex, role, subRole, disabled) { super(pageData, id, type, size || 2, tabIndex, naming, role, subRole, disabled); this.parent = parent; this.subMenuItemsChildItem = []; if (!parent.subMenuItems.find(i => i === this)) { parent.subMenuItems.push(this); } } } exports.StackSubMenuItemClass = StackSubMenuItemClass; class StackSubMenuItemChildClass extends StackIcon { constructor(parent, pageData, id, type, naming, size, tabIndex, role, subRole, disabled) { super(pageData, id, type, size || 2, tabIndex, naming, role, subRole, disabled); this.parent = parent; if (!parent.subMenuItemsChildItem.find(i => i === this)) { parent.subMenuItemsChildItem.push(this); } } } exports.StackSubMenuItemChildClass = StackSubMenuItemChildClass; class StackSeparator extends StackIcon { } exports.StackSeparator = StackSeparator; class StackSeparatorPrintState extends StackIcon { constructor(parent, pageData, id, action, size, tabIndex) { super(pageData, id, 'none', size || 2, tabIndex); this.parent = parent; this.action = action; if (!parent.subMenuItems.find(i => i === this)) { parent.subMenuItems.push(this); } } } exports.StackSeparatorPrintState = StackSeparatorPrintState; class StackFontPrintName extends StackIcon { constructor(parent, pageData, id, action, size, tabIndex) { super(pageData, id, 'none', size || 2, tabIndex); this.parent = parent; this.action = action; if (!parent.subMenuItems.find(i => i === this)) { parent.subMenuItems.push(this); } } } exports.StackFontPrintName = StackFontPrintName;