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,CAEQ4H,WAAW5H,GAClB,OAAOA,EAAKwF,mBAAqB,wBAClC,CAEQ8B,WAAWtH,EAAqBiH,GAEvC,OADmBjH,EAAK0H,aAAapD,aAAe,wBAC7B2C,EAAiBY,YACzC,CAEQN,SAASvH,EAAqBiH,GAErC,OADiBjH,EAAK0H,aAAapD,aAAe,sBAC7B2C,EAAiBa,UACvC,E","sources":["webpack://client-app/./src/app/components/object/object-grid/object-grid.ts","webpack://client-app/./src/app/components/object/object-grid/row-to-cells.ts"],"sourcesContent":["import { EventAggregator, Subscription } from 'aurelia-event-aggregator';\r\nimport { Router } from 'aurelia-router';\r\nimport { ObjectDetails } from 'app/models/object-details';\r\nimport { ObjectListManager, ShownColumnHeaderIF } from 'app/services/object-list/object-list-manager';\r\nimport {bindable, autoinject, computedFrom} from \"aurelia-framework\";\r\nimport { ModalService } from 'app/services/modal-service';\r\nimport { ObjectPresentation } from 'showroom/object-presentation/object-presentation';\r\nimport * as settings from 'app-settings.json';\r\nimport { DnDService } from 'app/services/d-n-d-service';\r\nimport { ContextMenuService } from 'app/services/context-menu-service';\r\nimport { ObjectRowCell, ObjectRow, ObjectCell } from 'app/services/object-list/object-list-row';\r\nimport { CellEditService } from 'app/services/cell-edit-service';\r\nimport Color from \"color\";\r\nimport {signalBindings} from \"aurelia-binding\";\r\nimport { ParameterDefinitionDto } from 'app/models/parameter-definition-dto';\r\nimport { UrlFormatter } from 'app/services/url-formatter';\r\n\r\n@autoinject\r\nexport class ObjectGrid {\r\n\t@bindable public objects: ObjectListManager | undefined;\r\n\t@bindable public multilineEnabled: boolean | undefined;\r\n\t@bindable public appliedNumberOfLines: number | undefined;\r\n\r\n public staticNameColumn: any;\r\n\tpublic isShowroom: boolean = false;\r\n\tpublic isWorkArea: boolean = false;\r\n private listId: string = \"\";\r\n private tableContainerBody: any;\r\n\t\r\n\tprivate subscriptions: Subscription[] = [];\r\n get signUpUrl(): string { return settings.externalUrls.signUp; }\r\n constructor(\r\n private dndService: DnDService,\r\n private modal: ModalService,\r\n private contextMenuService: ContextMenuService,\r\n private element: Element,\r\n\t\tprivate router: Router,\r\n\t\tprivate events: EventAggregator,\r\n\t\tprivate cellEditService: CellEditService) {\r\n }\r\n\r\n bind() {\r\n\t\tlet self = this;\r\n\t\tthis.subscriptions = [\r\n\t\tthis.events.subscribe('object-grid:sendMgr', async function() {\r\n\t\t\tif (self.objects?.selectedItems[0]) {\r\n\t\t\t\tself.events.publish('object-properties:objListMgr', self.objects);\r\n\t\t\t\tself.events.publish('object-properties:show', self.objects?.selectedItems[0]);\r\n\t\t\t\tself.events.publish('object-properties-material:show', self.objects?.selectedItems[0].value?.typeId);\r\n\t\t\t}\r\n\t\t}),\r\n\t\tthis.events.subscribe('object-grid:resetAllLockedColumns', async () => self.unlockAllStickyColumns()),\r\n\t\t]\r\n\t\t\r\n\t\tthis.staticNameColumn = { width: 400, defaultWidth: 400, value: null };\r\n\t\tthis.isShowroom = this.router.currentInstruction.config.route === 'manufacturer';\r\n\t\tthis.isWorkArea = this.router.currentInstruction.config.route.includes('work-area');\r\n\t}\r\n\r\n\tobjectsChanged() {\r\n\t\tthis.events.publish('object-properties:objListMgr', this.objects);\r\n\t}\r\n\r\n attached() {\r\n\t\twindow.addEventListener('keydown', e => {\r\n\t\t\tif (this.objects?.pressedKey != undefined) {\r\n\t\t\t\tthis.objects.pressedKey = e.key;\r\n\t\t\t}\r\n\t\t});\r\n\t\twindow.addEventListener('keyup', () => {\r\n\t\t\tif (this.objects?.pressedKey != undefined) {\r\n\t\t\t\tthis.objects.pressedKey = \"\"\r\n\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\r\n let swappedIndex: number = -1;\r\n this.listId = \"tableColumnList-\" + this.objects?.mode;\r\n this.dndService.attachListInteraction(this.listId, {\r\n animation: 150,\r\n forceFallback: true,\r\n handle: \".drag-handle\",\r\n draggable: \".draggable-item\",\r\n dragClass: \"draggable-item--dragged\",\r\n chosenClass: \"draggable-item--chosen\",\r\n ghostClass: \"draggable-item--ghost\",\r\n onStart: (event: any) => swappedIndex = event.oldDraggableIndex,\r\n onChange: (event: any) => {\r\n // swap row columns to match dragging of header columns\r\n\t\t\t\tif (this.objects?.shownColumns) {\r\n\t\t\t\t\tDnDService.swapListItems(this.objects.shownColumns, event.newDraggableIndex, swappedIndex);\r\n\t\t\t\t\tswappedIndex = event.newDraggableIndex;\r\n\t\t\t\t}\r\n },\r\n onEnd: (event: any) => {\r\n // set that header columns to row columns\r\n this.objects?.reorder_HeaderColumns(); // syncHeaderColumns();\r\n swappedIndex = -1;\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthis.events.publish('grid-items:setLeftPos');\r\n\t\t\t\t}, 50);\r\n }\r\n });\r\n this.tableContainerBody = document.querySelector('.table-container__body');\r\n\t}\r\n\r\n detached() {\r\n this.dndService.detachListInteraction(this.listId);\r\n\t\twindow.removeEventListener('keydown', e => {\r\n\t\t\tif (this.objects?.pressedKey != undefined) {\r\n\t\t\t\tthis.objects.pressedKey = e.key;\r\n\t\t\t}\r\n\t\t});\r\n\t\twindow.removeEventListener('keyup', () => {\r\n\t\t\tif (this.objects?.pressedKey != undefined) {\r\n\t\t\t\tthis.objects.pressedKey = \"\"\r\n\t\t\t}\r\n\t\t});\r\n\t\tthis.subscriptions.forEach(subscription => subscription.dispose());\r\n }\r\n\r\n async getMore() { // kaldes af html-view-TR: infinite-scroll-next=\"getMore\".\r\n\t\tconsole.log('OG-getMore');\r\n let rect = this.element.getBoundingClientRect();\r\n if (rect.bottom - 500 < window.innerHeight) {\r\n await this.objects?.tryShowMoreObjects();\r\n }\r\n\t\tthis.events.publish('grid-items:setLeftPos');\r\n }\r\n\r\n\topenContextMenu(event: Event, item: ObjectRow) {\r\n\t\tconsole.log(\"Event context menu\" , event);\r\n\t\tlet actions: {}[] = [];\r\n\r\n\t\tif (this.isShowroom) {\r\n\t\t\t// Type context\r\n\t\t\tif ((item.showCells || !item.isGroup)) {\r\n\t\t\t\tactions = [\r\n\t\t\t\t\t{ viewKey: \"button\", setup: { textKey: \"showInfo\", actionKey: \"showInfo\", service: {showInfo: () => { this.showInfo(item.value) }}}},\r\n\t\t\t\t\t{ viewKey: \"button\", setup: { textKey: \"copyLink\", actionKey: \"copyLink\", service: {copyLink: () => { this.copyLink(item.value) }}}}\r\n\t\t\t\t];\r\n\t\t\t} else {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// AOC\r\n\t\tif (!this.isShowroom) {\r\n\t\t\tif (item.showCells || !item.isGroup) {\r\n\t\t\t\tif(!this.isWorkArea) {\r\n\r\n\t\t\t\t\tactions = [\r\n\t\t\t\t\t\t{ viewKey: \"button\", setup: { textKey: \"Properties\", actionKey: \"showProperties\", service: {showProperties: () => { this.showProperties(item) }}}},\r\n\t\t\t\t\t\t{ viewKey: \"button\", setup: { textKey: \"Select\", actionKey: \"showProperties2\", service:{showProperties2: () => { this.showProperties2(item) }}}}\r\n\t\t\t\t\t];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tactions = [\r\n\t\t\t\t\t\t{ viewKey: \"button\", setup: { textKey: \"Properties\", actionKey: \"showProperties\", service: {showProperties: () => { this.showProperties(item) }}}},\r\n\t\t\t\t\t\t{ viewKey: \"button\", setup: { textKey: \"Select\", actionKey: \"showProperties2\", service:{showProperties2: () => { this.showProperties2(item) }}}},\r\n\t\t\t\t\t\t{ viewKey: \"button\", setup: { textKey: \"Highlight selected\", actionKey: \"highlightSelected\", service:{highlightSelected: () => { this.highlightSelected() }}}},\r\n\t\t\t\t\t\t{ viewKey: \"button\", setup: { textKey: \"Focus selected\", actionKey: \"focusSelected\", service:{focusSelected: () => { this.focusSelected() }}}},\r\n\t\t\t\t\t\t{ viewKey: \"button\", setup: { textKey: \"Isolate selected\", actionKey: \"isolateSelected\", service:{isolateSelected: () => { this.isolateSelected() }}}},\r\n\t\t\t\t\t\t{ viewKey: \"button\", setup: { textKey: \"Hide others\", actionKey: \"hideOthers\", service:{hideOthers: () => { this.hideOthers() }}}},\r\n\t\t\t\t\t\t{ viewKey: \"button\", setup: { textKey: \"Select all instances\", actionKey: \"selectAllInstances\", service:{selectAllInstances: () => { this.selectAllInstances() }}}}\r\n\t\t\t\t\t];\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.contextMenuService.open(event, actions);\r\n\t}\r\n\r\n enableCellEdit(cell: ObjectRowCell, row: ObjectRow, event: Event) {\r\n\t\tconsole.log(\"EDIT\");\r\n\t\tif (this.objects) {\r\n\t\t\tthis.cellEditService.enableCellEdit(this.objects, cell.objectCell, row, event);\r\n\t\t}\r\n\t}\r\n\t\r\n\tpublic saveCell(item: ObjectRow, objectCell: ObjectCell) {\r\n\t\tthis.objects?.source.saveCell(item, this.objects.selectedItems, objectCell).finally(() => {\r\n\t\t\tthis.events.publish('object-properties:update', item);\r\n\t\t\tsignalBindings('colors-changed');\t// Re-renders the view model\r\n\t\t});\r\n\t}\r\n\r\n\tprivate isStillExpanding: boolean = false;\r\n\r\n\tasync toggleChildren(item: any, event: Event | undefined = undefined): Promise {\r\n\t\tevent?.stopPropagation();\r\n\t\tif (this.isStillExpanding) { return; }\r\n\r\n\t\ttry {\r\n\t\t\tthis.isStillExpanding = true;\r\n\t\t\tif (item.group.isExpanded) {\r\n\t\t\t\tthis.objects?.collapse(item);\r\n\t\t\t} else {\r\n\t\t\t\tawait this.objects?.expand(item);\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tthis.isStillExpanding = false;\r\n\t\t\tthis.events.publish('grid-items:setLeftPos');\r\n\t\t} \r\n }\r\n\r\n showInfo(type: ObjectDetails | null) {\r\n\t\tconsole.log('object-grid presents type:', type);\r\n this.modal.OpenModal(ObjectPresentation, { type, filters: this.objects?.columns.applied, apiTarget: (this.objects)[\"apiTarget\"], apiInput: (this.objects)[\"apiInput\"] });\r\n\t}\r\n\r\n copyLink(item: ObjectDetails | null) {\r\n const selBox = document.createElement('textarea');\r\n selBox.style.visibility = 'fixed';\r\n selBox.style.left = '0';\r\n selBox.style.top = '0';\r\n selBox.style.opacity = '0';\r\n selBox.value = window.origin + \"/#/manufacturer/\" + item?.typeName.replace(/\\s/g, \"-\").replace(/[/,.;!@$%^&*()\\u9999]/g, \"\") + \"/\" + item?.typeId;\r\n selBox.value = encodeURI(selBox.value);\r\n document.body.appendChild(selBox);\r\n selBox.focus();\r\n selBox.select();\r\n document.execCommand('copy');\r\n document.body.removeChild(selBox);\r\n\t}\r\n\t\r\n\tshowProperties(item: ObjectRow): void {\r\n\t\tthis.events.publish('object-properties:show', item);\r\n\t\tconsole.log(\"publishing now: 'object-properties-material:show'\")\r\n\t\tthis.events.publish('object-properties-material:show', item.value?.typeId);\r\n\t\tif (!Boolean(item.isSelected))\r\n\t\t\tthis.objects?.toggleSelect(item);\r\n\t}\r\n\r\n\tshowProperties2(item: ObjectRow): void {\r\n\t\t//console.log('showProperties2:', item);\r\n\t\t//console.table(item);\r\n\t\tconsole.table(item.value);\r\n\t\t//this.events.publish('object-properties:show2', item);\r\n\t\tif (!Boolean(item.isSelected)) { this.objects?.toggleSelect(item); }\r\n\t}\r\n\r\n\tprivate highlightSelected(): void {\r\n\t\tthis.events.publish('3dViewer:highlight-selected-items', this.objects);\r\n\t}\r\n\r\n\tprivate focusSelected(): void {\r\n\t\tthis.events.publish('3dViewer:focus-selected-items', this.objects);\r\n\t}\r\n\r\n\tisolateSelected(): void {\r\n\t\tthis.events.publish('3dViewer:isolate-selected-items', this.objects);\r\n\t}\r\n\r\n\thideOthers(): void {\r\n\t\tthis.events.publish('3dViewer:hide-other-items', this.objects);\r\n\t}\r\n\r\n\tselectAllInstances(): void {\r\n\t\tthis.events.publish('3dViewer:select-all-instances', this.objects);\r\n\t}\r\n\t\r\n\tpublic isTooBright(color : Color) : boolean {\r\n\t\tif (color == null) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn color.isLight();\r\n\t}\r\n\r\n\tpublic async lockColumn(col: ShownColumnHeaderIF): Promise {\r\n\t\tif (this.objects) {\r\n\t\t\tcol.isFixedColumn = !col.isFixedColumn;\r\n\t\t\tcol.value.isFixedColumn = !col.value.isFixedColumn;\r\n\t\t\tthis.objects.isNameColumnFixed = this.objects.shownColumns.some(x => x.isFixedColumn);\r\n\t\t}\r\n\r\n\t\tsetTimeout(() => { //Making sure data-sticky is set before setCSS_LeftOnStickyColumns is called.\r\n\t\t\tthis.events.publish('grid-items:setLeftPos');\r\n\t\t}, 0);\r\n\t}\r\n\r\n\tpublic async lockNameColumn(): Promise {\r\n\t\tif (this.objects) {\r\n\t\t\tconst anyFixedColumns = this.objects.shownColumns.some(x => x.isFixedColumn);\r\n\t\t\tif (!anyFixedColumns) {\r\n\t\t\t\tthis.objects.isNameColumnFixed = !this.objects.isNameColumnFixed\r\n\t\t\t\tsetTimeout(() => { //Making sure data-sticky is set before setCSS_LeftOnStickyColumns is called.\r\n\t\t\t\t\tthis.events.publish('grid-items:setLeftPos');\r\n\t\t\t\t}, 0);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tpublic async unlockAllStickyColumns(): Promise {\r\n\t\t// Disables them all\r\n\t\tif (this.objects) {\r\n\t\t\tthis.objects.shownColumns.forEach(value => value.isFixedColumn = false);\r\n\t\t\tthis.objects.isNameColumnFixed = false;\r\n\t\t}\r\n\r\n\t\tsetTimeout(() => { //Making sure data-sticky is set before setCSS_LeftOnStickyColumns is called.\r\n\t\t\tthis.events.publish('grid-items:setLeftPos');\r\n\t\t}, 0);\r\n\t}\r\n\r\n\tpublic isUrl(cell: ObjectRowCell): boolean {\r\n\t\tlet parameterDefinition: ParameterDefinitionDto[] | undefined = this.objects?.columns.columnParameterDefinitionMetadata.filter(x => x.id == cell.objectCell.definitionId);\r\n\t\tif (parameterDefinition && parameterDefinition.length > 0) {\r\n\t\t\treturn parameterDefinition[0].parameterType == 8; //URL Type\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tgoToUrl(url: string, event: Event): void {\r\n\t\twindow.open(this.formatUrl(url), '_blank');\r\n\t\tevent.stopPropagation();\r\n\t}\r\n\r\n\tformatUrl(url:string): string {\r\n\t\treturn UrlFormatter.formatUrl(url);\r\n\t}\r\n}\r\n","import {CellEditService} from 'app/services/cell-edit-service';\r\nimport {ObjectValues} from '../../../models/object-values';\r\nimport {ObjectFilter} from 'app/models/object-filter';\r\nimport {ObjectRow, ObjectRowCell} from 'app/services/object-list/object-list-row';\r\nimport {ObjectListColumnManager} from \"../../../services/object-list/object-list-column-manager\";\r\nimport { ParameterDefinitionDto } from '../../../models/parameter-definition-dto';\r\nimport { ObjectDisplayUnits } from '../../../models/object-display-units';\r\nimport { ObjectParameter } from 'app/models/object-parameter';\r\nimport { ObjectListManager } from \"../../../services/object-list/object-list-manager\";\r\nimport Color from \"color\";\r\nimport { ColorLegendData } from \"../../../services/color-legend/color-legend-data\";\r\n\r\nexport class RowToCellsValueConverter {\r\n\ttoView(columns: ObjectFilter[], objRow: ObjectRow, columnListManager:ObjectListColumnManager, cellUpdateTrigger:number, cellEditService: CellEditService) : ObjectRowCell[] {\r\n\t\t// JG: jeg slukker lige for denne, fordi den logger saa meget.\r\n\t\t//console.log('RowToCellsValueConverter.toView, columnParameterDefinitionMetadata:', columnListManager.columnParameterDefinitionMetadata); \r\n \t\t\r\n\t\tlet cells:ObjectRowCell[] = [];\r\n\t\tif(!Boolean(objRow) || !Boolean(objRow.value)) return cells;\r\n\t\tcolumns.forEach( (column:ObjectFilter) => {\r\n\t\t\tif (column.isStatic) {//in-RowToCellsValueConverter.toView\r\n\t\t\t\tlet targetTypeNAME_value:string = (objRow.value)[column.targetType+'Name'];\r\n\t\t\t\tcells.push(\r\n new ObjectRowCell({ \r\n elementId: objRow.id,\r\n definitionId: (objRow.value)[column.targetType+'Id'],\r\n valueId: undefined,\r\n value: targetTypeNAME_value,\r\n\t\t\t\t\t\tdvalue: targetTypeNAME_value\r\n }, column, false));\r\n\t\t\t} else {\r\n\t\t\t\t// (Husk mig selv på, vi kan finde type-ancestor,\r\n\t\t\t\t// og vi kan tjekke om vi har brug for den..)\r\n\t\t\t\t// Men desvaerre har vi vist ikke disse ting, nede i ParameterDefinitionIdToShortValueConverter :-( ?\r\n\r\n\t\t\t\tlet isInst_targetType:boolean = (objRow.targetType == ObjectValues.targetTypes.instance);\r\n\t\t\t\tlet typRow:ObjectRow | null = (isInst_targetType ? this.typeAncestor(objRow) : null);\r\n\t\t\t\tlet instanceWithTypeColumn: boolean = (\r\n\t\t\t\t\t isInst_targetType\t \t \r\n\t\t\t\t\t&& typRow?.targetType == ObjectValues.targetTypes.type \r\n\t\t\t\t\t&& column?.targetType == ObjectValues.targetTypes.typeParameter \r\n\t\t\t\t);\r\n\r\n let property:ObjectParameter | undefined = \r\n\t\t\t\t\tinstanceWithTypeColumn\r\n ? typRow?.value?.properties.find(x => x.definitionId === column.targetId) // Ensure type parameters for instances\r\n : objRow.value?.properties.find(x => x.definitionId === column.targetId)\r\n\t\t\t\t;\r\n\t\t\t\t/* En ObjectRow har en ObjectDetails, der har paramvalues for entiteten.\r\n\t\t\t\tDetails har mange ting, også typeId!\r\n\t\t\t\tObjectDetails har paramValues i ObjectParameter[] (kaldet 'value'.)\r\n\t\t\t\t*/\r\n\t\t\t\t\r\n\t\t\t\tlet parameterDefinition:ParameterDefinitionDto | undefined = this.findColumn(property, column, columnListManager);\r\n cells.push(property \r\n ? new ObjectRowCell(\r\n\t\t\t\t\t\tproperty, // ObjectParameter\r\n\t\t\t\t\t\t column, // (ObjectFilter)\r\n\t\t\t\t\t\t cellEditService.canEdit(objRow, column.targetType, parameterDefinition) // canEdit-bool\r\n\t\t\t\t\t\t) \r\n : new ObjectRowCell({ \r\n elementId: objRow.id,\r\n definitionId: column.targetId ? column.targetId : \"\", \r\n valueId: undefined,\r\n value: \"\", \r\n\t\t\t\t\t\tdvalue: \"\"\r\n }, column, cellEditService.canEdit(objRow, column.targetType, parameterDefinition)));\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn cells;\r\n }\r\n\r\n\tfindColumn(property:ObjectParameter | undefined, column:ObjectFilter, columnListManager:ObjectListColumnManager):ParameterDefinitionDto | undefined {\r\n\t\tlet hasProp:boolean = Boolean(property);\r\n\t\tlet idToFind:string | null | undefined = (hasProp ? property?.definitionId : column.targetId);\r\n\t\tif (!idToFind) { return undefined;}\r\n\t\tlet columnDefs = columnListManager.columnParameterDefinitionMetadata; \r\n\t\tlet parameterDefinition:ParameterDefinitionDto | undefined = \r\n\t\t columnDefs.find(\r\n\t\t\t x => x.id == idToFind\r\n\t\t );\r\n\t\treturn parameterDefinition;\r\n\t}\r\n \r\n private typeAncestor(row: ObjectRow | null | undefined): ObjectRow{\r\n if (row?.group?.parent?.targetType == ObjectValues.targetTypes.type)\r\n return row.group.parent;\r\n return this.typeAncestor(row?.group?.parent);\r\n }\r\n}\r\n\r\nexport class RowCellEditorValueConverter {\r\n\ttoView(cells:ObjectRowCell[], columnListManager:ObjectListColumnManager){\r\n\r\n\t\tfor (let i = 0; i < cells.length; i++)\r\n\t\t{\r\n\t\t\tif(cells[i].columnTargetType.indexOf(\"Parameter\") > -1)\r\n\t\t\t{\r\n\t\t\t\tlet parameterDefinitionDto = columnListManager.columnParameterDefinitionMetadata.find(x => x.id == cells[i].par.definitionId);\r\n\r\n\t\t\t\tif (!Boolean(parameterDefinitionDto)) {\r\n\t\t\t\t\tcells[i].objectCell.isSimpleValue = true;\r\n\t\t\t\t\tcells[i].objectCell.isMultiline = false;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\t\t\t\t\t\r\n\r\n\t\t\t\tcells[i].objectCell.isSimpleValue = parameterDefinitionDto?.valueList_Id == \"00000000-0000-0000-0000-000000000000\" && !parameterDefinitionDto.isClassificationKey && parameterDefinitionDto.parameterType !== 20;\r\n\t\t\t\tcells[i].objectCell.isMultiline = parameterDefinitionDto?.parameterType == 20;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn cells;\r\n\t\t\r\n\t}\r\n}\r\n\r\nexport class ParameterDefinitionIdToShortValueConverter {\r\n // DENNE bruges - parameterDefinitionToShort i object-grid.html\r\n\r\n\tiQty_SharedParam:string = 'fe21c71b-51c2-492e-9bcc-42599ff8153f';\r\n\tiQUnit_SharedParam:string = '1fdd1d69-efe3-4c97-9777-e6388c8b473e';\r\n\r\n\tisParamDefCell(cell:ObjectRowCell, columnListManager:ObjectListColumnManager):ParameterDefinitionDto | undefined {\r\n\t\tif (!Boolean(cell.par.definitionId)) { // console.log('toV:no def id for ', cell.par.value);\t\t\t\r\n\t\t\treturn undefined; //''; // If there is no parameterDefinition here, don't deliver anything.\r\n\t\t} // \"I don't know what this cell/column is about (ie one missing its ObjectParameter), but let's ignore it.\"\r\n\r\n\t\t// Don't do units for cat,fam,type fixed columns:\r\n\t\tlet isOther = ['category','family','type'].includes(cell.objectCell.columnTargetType);\r\n\t\tif (isOther) { return undefined; } //''; }\r\n\r\n\t\t// JG: It saddens me we do so much work for each single cell??\r\n\t\tlet parameterDefinitionDto: ParameterDefinitionDto | undefined = columnListManager.columnParameterDefinitionMetadata.find(x => x.id == cell.par.definitionId);\r\n\t\tif (!Boolean(parameterDefinitionDto)) { //console.log('no def DTO', cell.par.definitionId);\t\t\t\r\n\t\t\t// Der er ikke noget at sige til, at den kan mangle, for det kan også være en categoryId, en familyId, eller en typeId!\r\n\t\t\t// Jeg ville saette stor pris på, vi havde et mærke for dette.\r\n\t\t\t// console.log('toV:no PD for', cell.par.definitionId, 'for value:', cell.objectCell.columnTargetType); //parameter.value);\t\t\t\r\n\t\t\treturn undefined; // If we can't find the parameterDefinition that was supposed to be here, don't deliver anything.\r\n\t\t}\r\n\t\treturn parameterDefinitionDto;\r\n\t}\r\n\r\n\ttoView(cell: ObjectRowCell, columnListManager:ObjectListColumnManager) {\t\t\r\n\t\tlet parameterDefinitionDto = this.isParamDefCell(cell,columnListManager);\r\n\t\tif (!parameterDefinitionDto) { // Don't show anything if it's not a cell with a paramDef column.\r\n\t\t\treturn ''; \r\n\t\t} \r\n\r\n\t\t/* JG: The peculiar idea here is, that we actually display the unit label\r\n\t\t * both in the Quantity column and in the QuantityUnit column.\r\n\t\t * The reason for this is, that it is actually for the TYPE row,\r\n\t\t * not the instance row (which will display the VALUES.)\r\n\t\t * Because the type-row is empty for both of these, \r\n\t\t * we can repurpose it to show the unit label.\r\n\t\t * This also means, you can leave out the 'QuantityUnit' column entirely,\r\n\t\t * because the Quantity column can fit both pieces/values.\r\n\t\t * \r\n\t\t * Note that there is currently a bug in this.\r\n\t\t * It appears as if either the typeQuantityUnit is only retrieved AFTER it is needed,\r\n\t\t * or possibly it is only applied in some partial later case\r\n\t\t * (in other words, the type-quantity label seems to be rendered empty the first times/initially.)\r\n\t\t */\r\n\r\n\t\tif ( parameterDefinitionDto.sharedParamId === this.iQty_SharedParam\r\n\t\t\t// || parameterDefinitionDto.sharedParamId === this.iQUnit_SharedParam // \"1fdd1d69-efe3-4c97-9777-e6388c8b473e\"\r\n\t\t) { // Quantity and/or quantityUnit parameters\r\n\r\n\t\t\t/* This maybe-stuff is at the bottom of the issue.\r\n\t\t\tmost of the time it refers to an INSTANCE, so we can't look up units with it!\r\n\t\t\tSecondly, the rows we click and want to update,\r\n\t\t\tare not the ones that are expanded like this.\r\n\t\t\tThe header you click is assumed to be OK(?), instead other rows further below\r\n\t\t\tare assumed to need re-calculating. At least, so it behaves.\r\n\r\n\t\t\tøv og dobbelt-øv - ObjectRow ved om vi er type eller inst, og kan faa fat i parent/type for en inst.\r\n\t\t\tMen ObjectRowCELL, som vi er her, ved ingenting :-/.\r\n\t\t\t*/\r\n\r\n\t\t\tlet maybeTypeId = cell.objectCell.elementId;\r\n\t\t\tlet displayUnit: ObjectDisplayUnits | undefined = columnListManager.columnTypeDisplayUnits.find(x => x.revitTypeId === maybeTypeId);\t\t\t\r\n\t\t\tif (displayUnit) {\r\n\t\t\t\treturn this.tag ? `[${displayUnit.unitShort}]` : `${displayUnit.unitShort}`; // ${cell.objectCell.columnTargetType}\r\n\t\t\t} else {\r\n\t\t\t\treturn '';\r\n\t\t\t}\r\n\t\t} else { \r\n\t\t\treturn this.tag ? `(${parameterDefinitionDto.unitShort})` : parameterDefinitionDto.unitShort; \r\n\t\t}\r\n\t}\r\n\ttag:boolean = false;\r\n}\r\n\r\n\r\n\r\n\r\nexport class ValueListColorAdderValueConverter {\r\n\t\r\n\tsignals = ['colors-changed'];\r\n\t\r\n\t// Colors can only be added here as the cells are only created in the first converter...\r\n\t\r\n\ttoView(cells:ObjectRowCell[], objectListManager:ObjectListManager){\r\n\t\t\r\n\t\tif (!objectListManager.useValueListColors)\t// Skip colors aren't enabled\r\n\t\t\treturn cells;\r\n\r\n\t\tif (!objectListManager.colorLegendService.isDataReady) {\r\n\t\t\treturn cells;\r\n\t\t}\r\n\t\t\r\n\t\tcells.forEach((cell: ObjectRowCell) => {\r\n\t\t\tlet currentColorData = objectListManager.colorLegendService.currentColorData;\r\n\t\t\t\r\n\t\t\tif (this.shouldBeColored(currentColorData, cell)) {\r\n\t\t\t\t\r\n\t\t\t\tlet itemColor:Color | undefined = currentColorData?.colorMap.get(cell.objectCell.value);//in-ValueListColorAdderValueConverter.toView\r\n\t\t\t\tif (!itemColor) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tcell.itemColor = itemColor;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tprivate shouldBeColored(currentColorData: ColorLegendData | undefined, cell: ObjectRowCell): boolean {\r\n\t\tif (!currentColorData) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tlet bothFamily = this.bothFamily(cell, currentColorData);\r\n\t\tlet bothType = this.bothType(cell, currentColorData);\r\n\r\n\t\tlet matchesActiveDefinition = this.matchesActiveDefinition(cell, currentColorData);\r\n\t\t\r\n\t\treturn (this.bothCategories(currentColorData, cell)\r\n\t\t\t|| bothFamily \r\n\t\t\t|| bothType\r\n\t\t\t|| matchesActiveDefinition) == true ;\r\n\t}\r\n\r\n\tprivate matchesActiveDefinition(cell: ObjectRowCell, currentColorData: ColorLegendData) {\r\n\t\tif (cell.columnFilter.name)\r\n\t\t\r\n\t\treturn currentColorData.definitionId != null && cell.objectCell.definitionId == currentColorData.definitionId;\r\n\t}\r\n\r\n\tprivate bothCategories(currentColorData: ColorLegendData, cell: ObjectRowCell) {\r\n\t\treturn currentColorData.isCategory && this.isCategory(cell);\r\n\t}\r\n\r\n\tprivate isCategory(cell: ObjectRowCell) {\r\n\t\treturn cell.columnTargetType === ObjectValues.targetTypes.category;\r\n\t}\r\n\r\n\tprivate bothFamily(cell: ObjectRowCell, currentColorData: ColorLegendData) {\r\n\t\tlet nameIsFamily = cell.columnFilter.targetType === ObjectValues.targetTypes.family;\r\n\t\treturn nameIsFamily && currentColorData.isFamilyName;\r\n\t}\r\n\r\n\tprivate bothType(cell: ObjectRowCell, currentColorData: ColorLegendData) {\r\n\t\tlet nameIsType = cell.columnFilter.targetType === ObjectValues.targetTypes.type;\r\n\t\treturn nameIsType && currentColorData.isTypeName;\r\n\t}\r\n}\r\n\r\n// class NOT_USED_ValueToDisplayValueConverter { // was: export \r\n\t\r\n// \ttoView(value:string, columnListManager:ObjectListColumnManager, parameterDefinitionId:string) {\r\n// \t\t/* JG: I don't believe this is currently used; it was an earlier attempt.\r\n// \t\t\tInstead Hans opted to pre-convert server-side.\r\n// \t\t (is this used at all, if the server sends us pre-converted values from ObjectElementParameter?)\r\n// \t\t*/\r\n// \t\tconsole.log('ValueToDisplayValueConverter, is this ever used', value);\r\n\t\t\r\n// \t\tthrow \"ValueToDisplayValueConverter IS NEVER USED\";\r\n\r\n// \t\t// Issue with this code: It does not know how to deal with Quantity column (if it were to be used.)\t\t\r\n// \t\tlet parameterDefinitionDto:ParameterDefinitionDto = columnListManager.columnParameterDefinitionMetadata.find(x => x.id == parameterDefinitionId);\r\n// \t\tif (!parameterDefinitionDto) { return value; }// Units are only relevant when parameters are involved. \r\n\t\t\r\n// \t\tif (parameterDefinitionDto.convertionRate == 0 || parameterDefinitionDto.convertionRate == 1 || parameterDefinitionDto.convertionRate == 1.0) {\r\n// \t\t return value; // Only perform conversions for parameters that have a unit conversion.\r\n// \t\t}\r\n\t\t\r\n// \t\tif (value.length == 0) { return value; } // Don't try to convert empty fields.\r\n\t\t\r\n// \t\tlet rawValue:number = Number.parseFloat(value); // Get hold of the original value - not the best way.\r\n// \t\tif (Number.isNaN(rawValue)) { return '!!' + value; }// If we/client fails at this, warn us\r\n\r\n// \t\tlet outValue = rawValue * parameterDefinitionDto.convertionRate + parameterDefinitionDto.offset;\r\n// \t\tlet sOutValue = outValue.toString();\r\n// \t\treturn sOutValue;\r\n// \t}\r\n// }"],"names":["ObjectGrid","signUpUrl","constructor","dndService","modal","contextMenuService","element","router","events","cellEditService","isShowroom","isWorkArea","listId","subscriptions","isStillExpanding","bind","self","this","subscribe","async","objects","selectedItems","publish","value","typeId","unlockAllStickyColumns","staticNameColumn","width","defaultWidth","currentInstruction","config","route","includes","objectsChanged","attached","window","addEventListener","e","undefined","pressedKey","key","swappedIndex","mode","attachListInteraction","animation","forceFallback","handle","draggable","dragClass","chosenClass","ghostClass","onStart","event","oldDraggableIndex","onChange","shownColumns","newDraggableIndex","onEnd","reorder_HeaderColumns","setTimeout","tableContainerBody","document","querySelector","detached","detachListInteraction","removeEventListener","forEach","subscription","dispose","console","log","getBoundingClientRect","bottom","innerHeight","tryShowMoreObjects","openContextMenu","item","actions","showCells","isGroup","viewKey","setup","textKey","actionKey","service","showInfo","copyLink","showProperties","showProperties2","highlightSelected","focusSelected","isolateSelected","hideOthers","selectAllInstances","open","enableCellEdit","cell","row","objectCell","saveCell","source","finally","stopPropagation","group","isExpanded","collapse","expand","type","OpenModal","filters","columns","applied","apiTarget","apiInput","selBox","createElement","style","visibility","left","top","opacity","origin","typeName","replace","encodeURI","body","appendChild","focus","select","execCommand","removeChild","Boolean","isSelected","toggleSelect","table","isTooBright","color","isLight","col","isFixedColumn","isNameColumnFixed","some","x","isUrl","parameterDefinition","columnParameterDefinitionMetadata","filter","id","definitionId","length","parameterType","goToUrl","url","formatUrl","bindable","autoinject","Element","RowToCellsValueConverter","toView","objRow","columnListManager","cellUpdateTrigger","cells","column","isStatic","targetTypeNAME_value","targetType","push","elementId","valueId","dvalue","isInst_targetType","typRow","typeAncestor","property","properties","find","targetId","findColumn","canEdit","idToFind","parent","RowCellEditorValueConverter","i","columnTargetType","indexOf","parameterDefinitionDto","par","isSimpleValue","isMultiline","valueList_Id","isClassificationKey","ParameterDefinitionIdToShortValueConverter","iQty_SharedParam","iQUnit_SharedParam","tag","isParamDefCell","sharedParamId","maybeTypeId","displayUnit","columnTypeDisplayUnits","revitTypeId","unitShort","ValueListColorAdderValueConverter","signals","objectListManager","useValueListColors","colorLegendService","isDataReady","currentColorData","shouldBeColored","itemColor","colorMap","get","bothFamily","bothType","matchesActiveDefinition","bothCategories","columnFilter","name","isCategory","isFamilyName","isTypeName"],"sourceRoot":""}