import { BomColumnId } from '../bom/bomColumn.enum'; import { BomColumn, BomColumnType } from '../bom/bom.interfaces'; import { ItemSelection } from '../item.service'; export class BomListColumn implements BomColumn { id?: string; key: string; name: string; nameId?: string; type?: BomColumnType; position?: number; public static keyByColId : Map = new Map([ [1, 'part number'], [31, 'user uploaded data'], [2, 'manufacturer'], [6, 'price'], [19, 'stock'], [24, 'lead time'], [4, 'description'], [45, 'svhc'], [46, 'svhc exceeds threshold'] ]); public static getRightColumnHeaders(): BomListColumn[] { return [ { key: 'price', name: 'Price', type: BomColumnType.SCROLLABLE }, { key: 'stock', name: 'Stock', type: BomColumnType.SCROLLABLE }, { key: 'alternates', name: 'Alternates', type: BomColumnType.SCROLLABLE }, { key: 'lead time', name: 'Lead Time', type: BomColumnType.SCROLLABLE }, { key: 'description', name: 'Description', type: BomColumnType.SCROLLABLE }, { key: 'svhc', name: 'SVHC', type: BomColumnType.SCROLLABLE }, { key: 'svhc exceeds threshold', name: 'SVHC Exceeds Threshold', type: BomColumnType.SCROLLABLE }, { key: 'referenceDesignators', name: 'Reference Designator(s)', type: BomColumnType.SCROLLABLE }, { key: 'targetPrice', name: 'Target Price', type: BomColumnType.SCROLLABLE }, { key: 'note', name: 'Note', type: BomColumnType.SCROLLABLE } ]; } public static getLeftStickyColumnHeaders(): BomListColumn[] { return [ { key: 'select', name: 'Select', type: BomColumnType.STICKY }, { key: 'partNumber', name: 'Part Number', type: BomColumnType.STICKY }, { key: 'userUploadedData', name: 'User Uploaded Data', type: BomColumnType.STICKY } ]; } public static getFixedColumnIds(): BomColumnId[] { return [ BomColumnId.NOTE, BomColumnId.REFERENCE_DESIGNATOR, BomColumnId.TARGET_PRICE ]; } public static getAlternatesRightColumnsMyArrowHeaders(): BomListColumn[] { return [ { position: 0, key: 'part number no cpn', name: 'Part Number', nameId: 'part-number' }, { position: 1, key: 'manufacturer', name: 'Manufacturer', nameId: 'manufacturer' }, { position: 2, key: 'price right', name: 'Price', nameId : 'price' }, { position: 3, key: 'total', name: 'Total', nameId: 'total' }, { position: 4, key: 'tariff', name: 'Tariff', nameId: 'tariff' }, { position: 5, key: 'stock right', name: 'Stock', nameId: 'stock' }, { position: 6, key: 'lead Time', name: 'Lead Time', nameId: 'lead-time' }, { position: 7, key: 'grade', name: 'Grade', nameId: 'grade' }, { position: 8, key: 'match-type', name: 'Match Type', nameId: 'match-type' } ]; } public static getAlternatesRightColumnsArrowHeaders(): BomListColumn[] { return [ { position: 0, key: 'part number no cpn', name: 'Part Number', nameId: 'part-number' }, { position: 1, key: 'manufacturer', name: 'Manufacturer', nameId: 'manufacturer' }, { position: 2, key: 'price right', name: 'Price', nameId : 'price' }, { position: 3, key: 'total', name: 'Total', nameId: 'total' }, { position: 4, key: 'tariff', name: 'Tariff', nameId: 'tariff' }, { position: 5, key: 'stock right', name: 'Stock', nameId: 'stock' }, { position: 6, key: 'lead Time', name: 'Lead Time', nameId: 'lead-time' }, { position: 7, key: 'lifecycle', name: 'Lifecycle', nameId: 'lifecycle' }, { position: 8, key: 'difference', name: 'Difference', nameId: 'description' }, { position: 9, key: 'grade', name: 'Grade', nameId: 'grade' }, { position: 10, key: 'match-type', name: 'Match Type', nameId: 'match-type' } ]; } } export class BomListConfig { stickyHeader?: boolean; stickyTopPx?: number; wrapperEl?: any; } export class BomListDataSource { parts: number; selection: ItemSelection; columns?: BomListColumn[]; rows: any; scrollableColumns?: BomListColumn[]; customColumns?: any[]; maxFixedColumns?: number; config?: BomListConfig; } export class BomCustomColum { mapId: number; key: string; name?: string; value?: string; nameId?: string; }