armisa-models
Version:
models of armisa!
367 lines (366 loc) • 12.4 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ToolStripButtonFactory = void 0;
const ToolStripItemFactory_1 = require("./ToolStripItemFactory");
class ToolStripButtonFactory extends ToolStripItemFactory_1.ToolStripItemFactory {
constructor(toolStripFactory, _fieldName, tabIndex, icon, onClick, fieldNameOfData, disabled, visible, useAsEsc, useAsAccept, useAsSpaceKey, useAsShiftKey, size, color, caption) {
super(toolStripFactory.mainStateFactory, toolStripFactory, _fieldName, tabIndex);
this.icon = icon;
this.onClick = onClick;
this.fieldNameOfData = fieldNameOfData;
this.useAsEsc = useAsEsc;
this.useAsAccept = useAsAccept;
this.useAsSpaceKey = useAsSpaceKey;
this.useAsShiftKey = useAsShiftKey;
this.size = size;
this.caption = caption;
this.iconName = 'New';
this.iconComany = 'fontAwsome';
this.accessDenied = false;
this.focusToElement = () => {
this.toolStripFactory.focusToThisToolStripItem(this);
};
this.disabled = disabled;
this.visible = visible;
this.setNameOfIcon(icon);
if (typeof color === 'string') {
this.iconColor = color;
}
else {
this.setColorOfIcon(icon);
}
}
setNameOfIcon(icon) {
switch (icon) {
case 'new':
this.iconName = 'New';
break;
case 'edit':
this.iconName = 'Edit';
break;
case 'delete':
this.iconName = 'Delete';
break;
case 'cut':
this.iconName = 'Cut';
break;
case 'copy':
this.iconName = 'Copy';
break;
case 'past':
this.iconName = 'Past';
break;
case 'view':
this.iconName = 'FolderOpen';
break;
case 'close':
this.iconName = 'Close';
break;
case 'open':
this.iconName = 'Open';
break;
case 'columns':
this.iconName = 'Columns';
break;
case 'ok':
this.iconComany = 'flatIcon';
break;
case 'home':
this.iconName = 'Home';
break;
case 'save':
this.iconName = 'Save';
break;
case 'print':
this.iconName = 'Print';
break;
case 'printCrystal':
this.iconName = 'PrintPro';
break;
case 'sortNumber':
this.iconName = 'SortNumericDown';
break;
case 'exportToExcel':
this.iconName = 'FileExcel';
break;
case 'importFromExcel':
this.iconName = 'FileExcel';
break;
case 'goPreviousRow':
this.iconName = 'ArrowAltCircleUpPro';
break;
case 'toggleSelect':
this.iconName = 'CheckSquare';
break;
case 'goNextRow':
this.iconName = 'ArrowAltCircleDownPro';
break;
case 'insertRowTop':
this.iconName = 'InsertRowTop';
break;
case 'insertRowBottom':
this.iconName = 'InsertRowBottom';
break;
case 'refresh':
this.iconName = 'SyncAlt';
break;
case 'drillDown':
this.iconName = 'ArrowAltToBottom';
break;
case 'contextMenu':
this.iconName = 'Sitemap';
break;
case 'removeRow':
this.iconName = 'AlignSlash';
break;
case 'previousPage':
this.iconName = 'ChevronCircleRight';
break;
case 'nextPage':
this.iconName = 'ChevronCircleLeft';
break;
case 'next':
this.iconName = 'StepForward';
break;
case 'back':
this.iconName = 'StepBackward';
break;
case 'nextSameLevel':
this.iconName = 'FastForward';
break;
case 'backSameLevel':
this.iconName = 'FastBackward';
break;
case 'function':
this.iconName = 'Function';
break;
case 'sum':
this.iconName = 'Sigma';
break;
case 'up2Down':
this.iconName = 'Share';
break;
case 'send':
this.iconName = 'PaperPlaneTop';
break;
case 'acceptForm':
this.iconName = 'FileSignaturePro';
break;
case 'declineForm':
this.iconName = 'FileSlashPro';
break;
case 'cleanForm':
this.iconName = 'Eraser';
break;
case 'reply':
this.iconName = 'Reply';
break;
case 'forward':
this.iconName = 'Share';
break;
case 'attach':
this.iconName = 'PaperClipVertical';
break;
case 'BOMPro':
this.iconName = 'ConveyorBeltAltPro';
break;
case 'BOMThin':
this.iconName = 'ConveyorBeltThin';
break;
case 'lock':
this.iconName = 'Lock';
break;
case 'unLock':
this.iconName = 'UnLock';
break;
case 'shop':
this.iconName = 'BagsShopping';
break;
case 'productOrder':
this.iconName = 'TransformerBolt';
break;
case 'sale':
this.iconName = 'BasketShopping';
break;
case 'product':
this.iconName = 'PuzzlePieceSimple';
break;
case 'purchaseOrder':
this.iconName = 'BagsShopping';
break;
case 'purchase':
this.iconName = 'FileInvoice';
break;
case 'receipt':
this.iconName = 'Forklift';
break;
case 'remittance':
this.iconName = 'BoxesStacked';
break;
}
}
setColorOfIcon(icon) {
switch (icon) {
case 'new':
this.iconColor = '#ff922b';
break;
case 'edit':
this.iconColor = '#94d82d';
break;
case 'delete':
this.iconColor = '#f06595';
break;
case 'cut':
this.iconColor = '#721c24';
break;
case 'copy':
this.iconColor = '#004085';
break;
case 'past':
this.iconColor = '#155724';
break;
case 'view':
this.iconColor = undefined;
break;
case 'close':
this.iconColor = '#c82333';
break;
case 'open':
this.iconColor = '#b50e4b';
break;
case 'columns':
this.iconColor = undefined;
break;
case 'ok':
this.iconColor = undefined;
break;
case 'home':
this.iconColor = '#001c40';
break;
case 'save':
this.iconColor = '#7691febf';
break;
case 'print':
this.iconColor = '#f06595';
break;
case 'printCrystal':
this.iconColor = undefined;
break;
case 'sortNumber':
this.iconColor = '#15aabf';
break;
case 'exportToExcel':
this.iconColor = '#199819';
break;
case 'importFromExcel':
this.iconColor = '#001e96d9';
break;
case 'toggleSelect':
this.iconColor = undefined;
break;
case 'goPreviousRow':
this.iconColor = '#001e96d9';
break;
case 'goNextRow':
this.iconColor = '#001e96d9';
break;
case 'insertRowTop':
this.iconColor = '#183153';
break;
case 'insertRowBottom':
this.iconColor = '#001c3d';
break;
case 'refresh':
this.iconColor = undefined;
break;
case 'drillDown':
this.iconColor = '#fd7e14';
break;
case 'contextMenu':
this.iconColor = '#15aabf';
break;
case 'removeRow':
this.iconColor = '#e03131';
break;
case 'previousPage':
this.iconColor = '#7691febf';
break;
case 'nextPage':
this.iconColor = '#7691febf';
break;
case 'next':
this.iconColor = '#7691febf';
break;
case 'back':
this.iconColor = '#7691febf';
break;
case 'nextSameLevel':
this.iconColor = '#7691febf';
break;
case 'backSameLevel':
this.iconColor = '#7691febf';
break;
case 'function':
this.iconColor = '#15aabf';
break;
case 'sum':
this.iconColor = '#15aabf';
break;
case 'up2Down':
this.iconColor = '#15aabf';
break;
case 'acceptForm':
this.iconColor = '#199819';
break;
case 'reply':
this.iconColor = 'navy';
break;
case 'forward':
this.iconColor = 'green';
break;
case 'cleanForm':
this.iconColor = 'red';
break;
case 'attach':
this.iconColor = '#14A085';
break;
case 'BOMPro':
this.iconColor = '#3b8eff';
break;
case 'BOMThin':
this.iconColor = '#3B8F02';
break;
case 'lock':
this.iconColor = '#095709';
break;
case 'unLock':
this.iconColor = '#ff7c07';
break;
case 'shop':
this.iconColor = '#f06595';
break;
case 'productOrder':
this.iconColor = '#7691febf';
break;
case 'sale':
this.iconColor = '#fd7e14';
break;
case 'product':
this.iconColor = '#199819';
break;
case 'purchaseOrder':
this.iconColor = '#f06595';
break;
case 'purchase':
this.iconColor = '#fd7e14';
break;
case 'receipt':
this.iconColor = '#e03131';
break;
case 'remittance':
this.iconColor = '#7691febf';
break;
}
}
}
exports.ToolStripButtonFactory = ToolStripButtonFactory;