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AAAA,S,wDACD,GAAC,EAAAA,S,yDACD,GAAC,EAAAA,S,wDAJQ3E,EAAc,GAD1B,EAAAF,W,uBAWkC,IAAqC,IAC9C,IAA0C,IAC5C,EAAAC,gBAAgC,OAZ3CC,E","sources":["webpack://client-app/./src/app/project/quantity-takeoff/source-selector/source-selector.scss","webpack://client-app/./src/app/project/quantity-takeoff/source-selector/source-selector.html","webpack://client-app/./src/app/project/quantity-takeoff/source-mediator.ts","webpack://client-app/./src/app/project/quantity-takeoff/source-selector/source-selector.ts"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.source-selector-top-view{min-width:350px;height:50px;padding:10px;margin-bottom:10px;overflow:hidden}.source-selector-top-view .add-btn{float:right}.table-holder{position:relative;width:100%;display:block;overflow:auto;height:calc(100% - 60px)}.table-holder .source-table{width:100%}.table-holder .source-table thead{position:sticky;top:0;z-index:10;background-color:#fff}.table-holder .source-table .selected-type{background-color:#348fe2;color:#fff}.table-holder .source-table th{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;position:relative;max-width:0;border:1px #d3d3d3 solid;border-top:0px;height:4em;padding-left:5px}.table-holder .source-table th .header-input{width:calc(100% - 5px);margin-top:3px;border-width:1px;border-color:#d3d3d3;border-style:solid}.table-holder .source-table th .header-input:focus-visible{outline:none}.table-holder .source-table td:hover{cursor:pointer}.table-holder .source-table label input{left:50%;transform:translateX(-50%)}.table-holder .source-table td{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-width:0;border:1px #d3d3d3 solid;height:1.5em;line-height:1.5em;padding-left:5px}.table-holder .source-table th:first-child{vertical-align:bottom;padding-bottom:7px;border-left:0px;width:2em;max-width:2em;padding-left:2px}.table-holder .source-table td:first-child{border-left:0px;width:2em;max-width:2em;padding-left:2px}.table-holder .source-table th:last-child,.table-holder .source-table td:last-child{border-right:0px}.resizer{position:absolute;top:0;right:0;width:5px;cursor:col-resize;user-select:none}`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/app/project/quantity-takeoff/source-selector/source-selector.scss\",\"webpack://./src/resources/styling-admin.scss\"],\"names\":[],\"mappings\":\"AAEA,0BACI,eAAA,CACA,WAAA,CACA,YAAA,CACA,kBAAA,CACA,eAAA,CACA,mCACI,WAAA,CAIR,cACI,iBAAA,CACA,UAAA,CACA,aAAA,CACA,aAAA,CACA,wBAAA,CACA,4BACI,UAAA,CACA,kCACI,eAAA,CACA,KAAA,CACA,UAAA,CACA,qBAAA,CAEJ,2CACI,wBC3BE,CD4BF,UAAA,CAEJ,+BACI,eAAA,CACA,kBAAA,CACA,sBAAA,CACA,iBAAA,CACA,WAAA,CACA,wBAAA,CACA,cAAA,CACA,UAAA,CACA,gBAAA,CAEA,6CACI,sBAAA,CACZ,cAAA,CACA,gBAAA,CACA,oBAAA,CACA,kBAAA,CAED,2DACC,YAAA,CAGI,qCACI,cAAA,CAGA,wCACI,QAAA,CACA,0BAAA,CAGR,+BACI,eAAA,CACA,kBAAA,CACA,sBAAA,CACA,WAAA,CACA,wBAAA,CACA,YAAA,CACA,iBAAA,CACA,gBAAA,CAEJ,2CACL,qBAAA,CACA,kBAAA,CACA,eAAA,CACA,SAAA,CACA,aAAA,CACA,gBAAA,CAEK,2CACI,eAAA,CACA,SAAA,CACA,aAAA,CACA,gBAAA,CAEJ,oFAEI,gBAAA,CAIZ,SACI,iBAAA,CACA,KAAA,CACA,OAAA,CACA,SAAA,CACA,iBAAA,CACA,gBAAA\",\"sourcesContent\":[\"@import \\\"src/resources/styling-admin\\\";\\r\\n\\r\\n.source-selector-top-view {\\r\\n min-width: 350px;\\r\\n height: 50px;\\r\\n padding: 10px;\\r\\n margin-bottom: 10px;\\r\\n overflow: hidden;\\r\\n .add-btn {\\r\\n float:right;\\r\\n }\\r\\n}\\r\\n\\r\\n.table-holder {\\r\\n position: relative;\\r\\n width: 100%;\\r\\n display: block;\\r\\n overflow: auto;\\r\\n height: calc(100% - 60px);// 60px is top-view height including padding.\\r\\n .source-table {\\r\\n width:100%;\\r\\n thead {\\r\\n position: sticky;\\r\\n top:0;\\r\\n z-index: 10;\\r\\n background-color: white;\\r\\n }\\r\\n .selected-type {\\r\\n background-color: $blue;\\r\\n color: white;\\r\\n }\\r\\n th {\\r\\n overflow: hidden;\\r\\n white-space: nowrap;\\r\\n text-overflow: ellipsis;\\r\\n position: relative;\\r\\n max-width: 0;\\r\\n border:1px lightgray solid;\\r\\n border-top: 0px;\\r\\n height: 4.0em;//50px;//header also needs space for an input field so it should not match in this case.\\r\\n padding-left: 5px;\\r\\n\\r\\n .header-input {\\r\\n width: calc(100% - 5px);\\r\\n\\t\\t\\t\\tmargin-top: 3px;\\r\\n\\t\\t\\t\\tborder-width: 1px;\\r\\n\\t\\t\\t\\tborder-color: lightgray;\\r\\n\\t\\t\\t\\tborder-style: solid;\\r\\n }\\r\\n\\t\\t\\t.header-input:focus-visible {\\r\\n\\t\\t\\t\\toutline: none;\\r\\n\\t\\t\\t}\\r\\n }\\r\\n td:hover {\\r\\n cursor: pointer;\\r\\n }\\r\\n label {\\r\\n input {\\r\\n left:50%; \\r\\n transform: translateX(-50%); \\r\\n }\\r\\n }\\r\\n td {\\r\\n overflow: hidden;\\r\\n white-space: nowrap;\\r\\n text-overflow: ellipsis;\\r\\n max-width: 0;\\r\\n border:1px lightgray solid;\\r\\n height: 1.5em;//22px;//Must match;\\r\\n line-height: 1.5em;//22px; //Must match;\\r\\n padding-left: 5px;\\r\\n } \\r\\n th:first-child {\\r\\n\\t\\t\\tvertical-align: bottom;\\r\\n\\t\\t\\tpadding-bottom: 7px;\\r\\n\\t\\t\\tborder-left:0px;\\r\\n\\t\\t\\twidth: 2em;\\r\\n\\t\\t\\tmax-width: 2em;\\r\\n\\t\\t\\tpadding-left: 2px;\\r\\n\\t\\t}\\r\\n td:first-child {\\r\\n border-left:0px;\\r\\n width: 2em;\\r\\n max-width: 2em;\\r\\n padding-left: 2px;\\r\\n }\\r\\n th:last-child,\\r\\n td:last-child {\\r\\n border-right: 0px;\\r\\n }\\r\\n }\\r\\n}\\r\\n.resizer {\\r\\n position: absolute;\\r\\n top: 0;\\r\\n right: 0;\\r\\n width: 5px;\\r\\n cursor: col-resize;\\r\\n user-select: none;\\r\\n}\\r\\n\\r\\n\\r\\n//Old implementation using a grid.\\r\\n// .source-selector {\\r\\n// height: calc(100% - 60px);\\r\\n// min-width: 300px;\\r\\n// padding: 10px;\\r\\n// padding-top: 0;\\r\\n// overflow: auto;\\r\\n// &--type-grid {\\r\\n// .fixed-header {\\r\\n// position: sticky;\\r\\n// top:0;\\r\\n// background-color: white;\\r\\n// z-index: 10;\\r\\n// }\\r\\n// &--row {\\r\\n// &.selected-type {\\r\\n// background-color: $blue;\\r\\n// color: white;\\r\\n// }\\r\\n// cursor: pointer;\\r\\n// display: grid;\\r\\n// grid-template-columns: 2em repeat(3, calc(33.3% - (0.6667em))); //checkbox Equally dividing the rest of the space 0.6667em is 2em divided by 3.\\r\\n// &--column {\\r\\n// height: 2em;//22px;//Must match;\\r\\n// line-height: 2em;//22px; //Must match;\\r\\n// overflow: hidden;\\r\\n// text-overflow: ellipsis;\\r\\n// border-bottom: 1px solid lightgray;\\r\\n// border-left: 1px solid lightgray;\\r\\n// padding: 0px 4px;\\r\\n// label {\\r\\n// display: inline-block;\\r\\n// vertical-align: middle;\\r\\n// }\\r\\n// &.grid-header {\\r\\n// height: 4.5em;//50px;//header also needs space for an input field so it should not match in this case.\\r\\n// line-height: 2em;\\r\\n// label { //Input checkbox\\r\\n// line-height: 4.5em;\\r\\n// }\\r\\n// .header-input {//Input text box\\r\\n// height: 2em;\\r\\n// width: 100%;\\r\\n// }\\r\\n// }\\r\\n// }\\r\\n// .remove-border {\\r\\n// border-left: 0px;\\r\\n// } \\r\\n// }\\r\\n// }\\r\\n// }\\r\\n\",\"$black: #000000 !default;\\r\\n$blue: #348fe2 !default;\\r\\n$cyan: #49b6d6 !default;\\r\\n$dark: #2d353c !default;\\r\\n$dark-darker: #1a2229 !default;\\r\\n$green: #32a932 !default;\\r\\n$indigo: #8753de !default;\\r\\n$lime: #90ca4b !default;\\r\\n$light: #f2f3f4 !default;\\r\\n$orange: #f59c1a !default;\\r\\n$purple: #727cb6 !default;\\r\\n$pink: #fb5597 !default;\\r\\n$red: #ff5b57 !default;\\r\\n$silver: #b6c2c9 !default;\\r\\n$teal: #00acac !default;\\r\\n$white: #FFFFFF !default;\\r\\n$yellow: #ffd900 !default;\\r\\n$inverse: $dark !default;\\r\\n$link-color: $blue !default;\\r\\n$btn-eg-theme-color: #517770 !default;\\r\\n$btn-ajour-theme-color:\\trgb(29, 30, 90) !default; \\t\\r\\n$colors: (\\r\\n\\t'black': $black,\\r\\n\\t'cyan': $cyan,\\r\\n\\t'dark': $dark,\\r\\n\\t'dark-darker': $dark-darker,\\r\\n\\t'green': $green,\\r\\n\\t'indigo': $indigo,\\r\\n\\t'lime': $lime,\\r\\n\\t'light': $light,\\r\\n\\t'orange': $orange,\\r\\n\\t'purple': $purple,\\r\\n\\t'pink': $pink,\\r\\n\\t'red': $red,\\r\\n\\t'silver': $silver,\\r\\n\\t'teal': $teal,\\r\\n\\t'white': $white,\\r\\n\\t'yellow': $yellow,\\r\\n\\t'muted': darken($silver, 30%),\\r\\n\\t'aqua': $cyan,\\r\\n\\t'btn-eg-theme-color': $btn-eg-theme-color,\\r\\n\\t'btn-ajour-theme-color': $btn-ajour-theme-color,\\r\\n\\r\\n);\\r\\n\\r\\n$border-radius: 4px !default;\\r\\n$border-radius-lg: 6px !default;\\r\\n$border-radius-sm: 3px !default;\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","module.exports = \"\\r\\n\";","import { TypeDto, TypeDtoWCategory } from \"app/components/quantity-filter-sources/quantity-filter-sources\";\r\nimport { QuantityFilterDto, QuantityFilters } from \"../quantity-views/quantity-filters\";\r\nimport { autoinject } from \"aurelia-framework\";\r\nimport { QuantitySourcesService, SearchInputDto } from \"app/services/quantity-sources-service\";\r\nimport { EventAggregator } from 'aurelia-event-aggregator';\r\n\r\n/**\r\n * \r\n */\r\n@autoinject\r\nexport class SourceMediator {\r\n selectedQF: QuantityFilterDto | undefined;\r\n loadedTypes: TypeDtoWCategory[] = []; //Types displayed based on the search\r\n originalSources: Set = new Set();//was: TypeDto[] //The original sources from the selectedFilter\r\n filterTypesBasket: Set = new Set();//was: TypeDto[] //The sources currently selected, but not saved\r\n isBasketAndOriginalDifferent: boolean = false; //We cannot trigger bindableChanged on an array, therefore we have an extra bool.\r\n isAllSelected: boolean = false;\r\n selectedType: TypeDtoWCategory | undefined;\r\n\r\n constructor(public qsService: QuantitySourcesService, private events: EventAggregator) {}\r\n\r\n handleToggledItem(type: TypeDtoWCategory): void {\r\n if (type.selected == true) {\r\n this.filterTypesBasket.add(type.id);\r\n } else {\r\n this.filterTypesBasket.delete(type.id);\r\n }\r\n this.hasSourcesBeenChanged();\r\n this.setIsAllSelected();\r\n }\r\n\r\n async handleAllToggle() {\r\n if (this.loadedTypes.length == this.loadedTypes.filter(type => type.selected).length) { //All selected, meaning the basket should be emptied.\r\n this.loadedTypes.forEach(type => type.selected = false);\r\n let idsToRemove: string[] = this.loadedTypes.map(type => type.id);\r\n for (let id of idsToRemove) {\r\n this.filterTypesBasket.delete(id);\r\n }\r\n } else { //Not all selected, meaning the basket should be filled with remaining sources.\r\n this.loadedTypes.forEach(type => type.selected = true);\r\n let itemsToAdd: TypeDto[] = this.loadedTypes.filter(type => !this.filterTypesBasket.has(type.id));\r\n for (let type of itemsToAdd) {\r\n this.filterTypesBasket.add(type.id)\r\n }\r\n }\r\n\r\n this.loadedTypes = this.setSelectedForTypes(this.loadedTypes);\r\n //Update isBasketAndOriginalDifferent if changes has been made to the basket.\r\n this.hasSourcesBeenChanged();\r\n //Check if all sources are now selected (By all it is meant all loaded sources, based on the user input from the 3 input fields.)\r\n this.setIsAllSelected(); \r\n }\r\n\r\n hasSourcesBeenChanged(): void {\r\n if (this.originalSources.size != this.filterTypesBasket.size) {\r\n this.isBasketAndOriginalDifferent = true;\r\n return;\r\n } else {\r\n let isChanged: boolean = false;\r\n this.filterTypesBasket.forEach(t => {\r\n if (!this.originalSources.has(t)) {\r\n isChanged = true;\r\n return;\r\n }\r\n });\r\n this.isBasketAndOriginalDifferent = isChanged;\r\n }\r\n }\r\n\r\n async setSelectedQF(qf: QuantityFilterDto | undefined): Promise {\r\n\t\ttry {\r\n\t\t\t// wait-cursor. https://jira.eg.dk/browse/AJC-1725 todo\r\n\t\t\tQuantityFilters.animate(true);\r\n if (qf != undefined) {\r\n await this.impl_setSelectedQF(qf);//in-setSelectedQF.\r\n } else {\r\n this.resetSelectionAndFilter();\r\n }\r\n\t\t} finally {\r\n\t\t\tconsole.log('after');\r\n\t\t\t// clear-wait-cursor.\r\n\t\t\tQuantityFilters.animate(false);\r\n\t\t}\r\n }\r\n\r\n\tasync impl_setSelectedQF(qf: QuantityFilterDto):Promise { // UB:setSelectedQF\r\n let types: TypeDto[] = await this.qsService.getSelectedTypes(qf.id);\r\n\t\tif (types == undefined) {\r\n\t\t\tconsole.trace('now, why would types be undefined here?');\r\n\t\t\treturn;\r\n\t\t}\r\n this.filterTypesBasket = new Set (types.map(type => type.id));\r\n this.originalSources = new Set (types.map(type => type.id));\r\n this.loadedTypes = this.setSelectedForTypes(this.loadedTypes);\r\n this.isBasketAndOriginalDifferent = false;\r\n this.setIsAllSelected();\r\n this.selectedQF = qf;\r\n\t}\r\n\r\n async newSearchForTypes(searchInpuDto: SearchInputDto, pageIndex: number): Promise {\r\n\t\t// JG: If we disable this, we can get the scroll problem back.\r\n //this.loadedTypes = []; //To avoid scroll intersection issues.\r\n\t\t//this.loadedTypes.length = 0; // den dur ikke?\r\n\t\tconsole.log('newSearchForTypes, setting this.loadedTypes, had#:', this.loadedTypes.length);\r\n\r\n let types: TypeDtoWCategory[] = await this.qsService.searchForTypes(searchInpuDto, pageIndex);\r\n\r\n\t\t//this.loadedTypes = []; // dette er tidsnok.\r\n\r\n\t\tthis.setSelectedForTypes(types);\r\n\r\n\t\tthis.loadedTypes = []; // dette er for sent.\r\n\r\n\r\n\t\t//this.loadedTypes = [];\r\n\t\t//this.loadedTypes.length = 0;\r\n //this.loadedTypes.splice(0,this.loadedTypes.length, ...types);\r\n this.loadedTypes.push(...types);\r\n\r\n\t\tconsole.log('newSearchForTypes, DONE setting this.loadedTypes, now has:#', this.loadedTypes.length);\r\n this.setIsAllSelected();\r\n this.selectedType = undefined;\r\n }\r\n\r\n async scrollSearchForTypes(searchInpuDto: SearchInputDto, pageIndex: number): Promise {\r\n let types: TypeDtoWCategory[] = await this.qsService.searchForTypes(searchInpuDto,pageIndex);\r\n this.loadedTypes.splice(this.loadedTypes.length,0,...this.setSelectedForTypes(types));\r\n this.setIsAllSelected();\r\n }\r\n\r\n setSelectedForTypes(types: TypeDtoWCategory[]): TypeDtoWCategory[] {\r\n console.log(\"loadedTypes\", types);\r\n console.log(\"filterTypesBasket\", this.filterTypesBasket);\r\n types.forEach(type => {\r\n type.selected = this.filterTypesBasket.has(type.id);\r\n });\r\n return types;\r\n }\r\n\r\n setIsAllSelected(): void {\r\n this.isAllSelected = 0 == this.loadedTypes.filter(type => !type.selected).length;\r\n }\r\n\r\n handleDeletedQF(qf: QuantityFilterDto): boolean {\r\n if (qf.id == this.selectedQF?.id) {\r\n this.resetSelectionAndFilter();\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n async updateSourcesOnFilter(): Promise {\r\n\t\tconsole.log('SourceMediator.updateSourcesOnFilter');\r\n if (!this.selectedQF) { return; }\r\n\r\n\t\tlet itemsToRemove: string[] = [];\r\n\t\tthis.originalSources.forEach(type => {\r\n\t\t\tif (!this.filterTypesBasket.has(type)) {\r\n\t\t\t\titemsToRemove.push(type);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tlet itemsToAdd: string[] = [];\r\n\t\tthis.filterTypesBasket.forEach(type => {\r\n\t\t\tif (!this.originalSources.has(type)) {\r\n\t\t\t\titemsToAdd.push(type);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tlet successfullyUpdated: boolean = await this.qsService.updateSources(this.selectedQF.id, itemsToAdd,itemsToRemove);\r\n\t\tif (successfullyUpdated) {\r\n\t\t\tlet types: TypeDto[] = await this.qsService.getSelectedTypes(this.selectedQF.id);\r\n\t\t\tthis.originalSources = new Set(types.map(t => t.id));\r\n\t\t\tthis.isBasketAndOriginalDifferent = false;\r\n\t\t\tthis.events.publish('pivot-grid-component:update-grid');\r\n\t\t\tthis.events.publish('type-overview:update-sources');\r\n\t\t}\r\n\t\tconsole.log(\"New selected Sources\", this.originalSources);\r\n }\r\n\r\n resetSelectionAndFilter(): void {\r\n this.selectedQF = undefined;\r\n this.originalSources.clear();\r\n this.filterTypesBasket.clear();\r\n this.isBasketAndOriginalDifferent = false;\r\n this.isAllSelected = false;\r\n\r\n\t\t// JG: If we disable this, we can get the scroll problem back.\r\n //this.loadedTypes = []; // the fix-hack\r\n\t\tconsole.log('resetSelectionAndFilter, clearing loadedTypes.selected');\r\n\r\n\t\tthis.loadedTypes.forEach(type => type.selected = false);\r\n\t\tconsole.log('resetSelectionAndFilter, DONE clearing loadedTypes.selected');\r\n\r\n this.selectedType = undefined;\r\n }\r\n}\r\n","import { TypeDtoWCategory } from \"app/components/quantity-filter-sources/quantity-filter-sources\";\r\nimport { ApiClient } from \"app/services/api-client\";\r\nimport { AppContextService } from \"app/services/app-context-service\";\r\nimport { autoinject, bindable } from 'aurelia-framework';\r\nimport { QuantitySourcesService, SearchInputDto } from \"app/services/quantity-sources-service\";\r\nimport { SourceMediator } from \"../source-mediator\";\r\nimport { EventAggregator } from \"aurelia-event-aggregator\";\r\nimport { ModalService } from \"app/services/modal-service\";\r\nimport { DialogCloseResult } from \"aurelia-dialog\";\r\n\r\n\r\n@autoinject\r\nexport class SourceSelector {\r\n @bindable projectId: string = \"\";\r\n @bindable private catInput: string = \"\";\r\n @bindable private typeInput: string = \"\";\r\n @bindable private famInput: string = \"\";\r\n private pageIndex: number = 0;\r\n private pageSize: number = 50;\r\n private isLoading: boolean = false;\r\n private resetTimeoutId: number = 0; //Number does not matter, as it is just an id for resetting the timeout.\r\n\r\n constructor(public appContext: AppContextService, public apiClient: ApiClient, \r\n public qsService: QuantitySourcesService, public sMediator: SourceMediator,\r\n private events: EventAggregator, private modal: ModalService) {}\r\n\r\n async bind(): Promise {\r\n console.log(\"source-selector:bind \", this.projectId);\r\n await this.sMediator.newSearchForTypes(this.getSearchInputDto(),this.pageIndex);\r\n await this.getMoreTypes();\r\n // this.sMediator.loadedTypes = await this.qsService.searchForTypes();\r\n }\r\n async attached(): Promise {\r\n this.setupResizing();\r\n }\r\n \r\n async resetSearch(): Promise {\r\n this.catInput = \"\";\r\n this.typeInput = \"\";\r\n this.famInput = \"\";\r\n await this.searchForTypes();\r\n }\r\n\r\n async catInputChanged(): Promise {\r\n this.handleInput();\r\n }\r\n \r\n async typeInputChanged(): Promise {\r\n this.handleInput();\r\n }\r\n \r\n async famInputChanged(): Promise {\r\n this.handleInput();\r\n }\r\n\r\n async handleInput(): Promise {\r\n clearTimeout(this.resetTimeoutId);\r\n this.resetTimeoutId = setTimeout(async () => {\r\n await this.searchForTypes();\r\n }, 500);\r\n }\r\n\r\n async projectIdChanged(): Promise {\r\n this.catInput = \"\";\r\n this.typeInput = \"\";\r\n this.famInput = \"\";\r\n await this.searchForTypes();\r\n }\r\n\r\n async searchForTypes(): Promise {\r\n this.pageIndex = 0;\r\n await this.sMediator.newSearchForTypes(this.getSearchInputDto(),this.pageIndex);\r\n this.getMoreTypes();\r\n }\r\n\r\n async getMoreTypes(scrollContext?: any): Promise {\r\n\t\t//console.log('getMoreTypes, scrollContext: (bot)', scrollContext?.isAtBottom, 'rest:', scrollContext);\r\n\t\t// burde topIndex hjælpe os?\t\r\n if (scrollContext?.isAtBottom == false) { //built in virtual-repeat.for used for only getting more items if bottom is reached.\r\n return;\r\n }\r\n let newPageIndex: number = Math.round(this.sMediator.loadedTypes.length / this.pageSize);\r\n if (!this.isLoading && newPageIndex != this.pageIndex) {\r\n await this.loadMoreTypes(newPageIndex);\r\n }\r\n }\r\n\r\n async loadMoreTypes(newPageIndex: number): Promise {\r\n this.isLoading = true;\r\n this.pageIndex = newPageIndex;\r\n await this.sMediator.scrollSearchForTypes(this.getSearchInputDto(), this.pageIndex);\r\n this.isLoading = false;\r\n }\r\n\r\n\t// JG: - not currently active.\r\n //sortTypes(): void {\r\n // this.sMediator.loadedTypes.sort((element1, element2) => {\r\n // if (element1 && element2) {\r\n // return element1.name.localeCompare(element2.name);\r\n // }\r\n // return 0;\r\n // });\r\n //}\r\n\r\n getSearchInputDto(): SearchInputDto {\r\n return {catInput: this.catInput,typeInput: this.typeInput, famInput: this.famInput};\r\n }\r\n\r\n handleToggledItem(type: TypeDtoWCategory): void {\r\n this.sMediator.handleToggledItem(type)\r\n }\r\n\r\n async toggleAll(): Promise {\r\n await this.loadAllTypes(); //To select or deselect all sources, they must first be fetched\r\n await this.sMediator.handleAllToggle();\r\n }\r\n\r\n async loadAllTypes(): Promise {\r\n let doneLoading: boolean = false;\r\n while (!doneLoading) {\r\n let amountOfTypesLoaded: number = this.sMediator.loadedTypes.length;\r\n await this.getMoreTypes();\r\n doneLoading = amountOfTypesLoaded == this.sMediator.loadedTypes.length;\r\n }\r\n }\r\n\r\n async switchToViewerMode(): Promise {\r\n if (this.sMediator.selectedQF != undefined && this.sMediator.isBasketAndOriginalDifferent) {\r\n let response: DialogCloseResult = await this.modal.OpenConfirm(\"Unsaved data\", \"The changes made have not been saved. Do you wish to continue without saving changes?\").whenClosed();\r\n if (response.wasCancelled == true) {\r\n return;\r\n }\r\n }\r\n this.clearSearchField();\r\n this.sMediator.selectedType = undefined;\r\n this.events.publish('takeoff-switch-right-view');\r\n }\r\n\r\n clearSearchField(): void {\r\n this.catInput = \"\";\r\n this.typeInput = \"\";\r\n this.famInput = \"\";\r\n }\r\n \r\n async updateFilterSources(): Promise {\r\n\t\tconsole.log('sourceSelector.updateFilterSources');\r\n await this.sMediator.updateSourcesOnFilter();\r\n }\r\n\r\n async selectType(typeDto: TypeDtoWCategory) { //If a type is selected Properties will b displayed.\r\n if (this.sMediator.selectedType == typeDto) {\r\n this.sMediator.selectedType = undefined;\r\n } else {\r\n this.sMediator.selectedType = typeDto\r\n }\r\n }\r\n\r\n setupResizing() {\r\n\t\t//Code inspiration from: https://htmldom.dev/resize-columns-of-a-table/\r\n\t\t// Query the table\r\n\t\tconst table = document.getElementById('resizable-source-table');\r\n\r\n\t\t// Query all headers\r\n\t\tconst cols: NodeListOf | undefined = table?.querySelectorAll('th');\r\n console.log(\"cols \" , cols);\r\n\t\tif (cols && cols?.length > 0 && cols[0].classList.contains('placeholder-column')) { return; } //If it is a placeholder-column resize is not added.\r\n\t\t// Loop over them\r\n\t\tcols?.forEach(col => {\r\n if (col.classList.contains('source-checkbox') || col == cols[cols.length -1]) { return; }\r\n\t\t\t// Create a resizer element\r\n\t\t\tconst resizer = document.createElement('div');\r\n\t\t\tresizer.classList.add('resizer');\r\n\r\n\t\t\t// Set the height\r\n\t\t\tresizer.style.height = `${table?.offsetHeight}px`;\r\n\r\n\t\t\t// Add a resizer element to the column\r\n\t\t\tcol.appendChild(resizer);\r\n\r\n\t\t\t// Will be implemented in the next section\r\n\t\t\tthis.createResizableColumn(col, resizer);\r\n\t\t});\r\n\t}\r\n\r\n\tcreateResizableColumn(col: HTMLTableCellElement, resizer: HTMLDivElement) {\r\n\t\t// Track the current position of mouse\r\n\t\tlet x = 0;\r\n\t\tlet w = 0;\r\n\t\r\n\t\tconst mouseDownHandler = function (e: any) {\r\n\t\t\t// Get the current mouse position\r\n\t\t\tx = e.clientX;\r\n\t\r\n\t\t\t// Calculate the current width of column\r\n\t\t\tconst styles = window.getComputedStyle(col);\r\n\t\t\tw = parseInt(styles.width, 10);\r\n\t\r\n\t\t\t// Attach listeners for document's events\r\n\t\t\tdocument.addEventListener('mousemove', mouseMoveHandler);\r\n\t\t\tdocument.addEventListener('mouseup', mouseUpHandler);\r\n\t\t};\r\n\t\r\n\t\tconst mouseMoveHandler = function (e: any) {\r\n\t\t\t// Determine how far the mouse has been moved\r\n\t\t\tconst dx = e.clientX - x;\r\n\t\t\t\r\n\t\t\t// Update the width of column\r\n\t\t\tlet newWidth: number = w + dx;\r\n\t\t\tcol.style.minWidth = `${newWidth}px`; //Both has to be set.\r\n\t\t\tcol.style.width = `${newWidth}px`; //Both has to be set.\r\n\t\t};\r\n\t\r\n\t\t// When user releases the mouse, remove the existing event listeners\r\n\t\tconst mouseUpHandler = function () {\r\n\t\t\tdocument.removeEventListener('mousemove', mouseMoveHandler);\r\n\t\t\tdocument.removeEventListener('mouseup', mouseUpHandler);\r\n\t\t};\r\n\t\r\n\t\tresizer.addEventListener('mousedown', mouseDownHandler);\r\n\t}\r\n}\r\n\r\n\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","exports","SourceMediator","constructor","qsService","events","loadedTypes","originalSources","Set","filterTypesBasket","isBasketAndOriginalDifferent","isAllSelected","handleToggledItem","type","selected","this","add","delete","hasSourcesBeenChanged","setIsAllSelected","handleAllToggle","length","filter","forEach","idsToRemove","map","itemsToAdd","has","setSelectedForTypes","size","isChanged","t","setSelectedQF","qf","QuantityFilters","animate","undefined","impl_setSelectedQF","resetSelectionAndFilter","console","log","types","getSelectedTypes","selectedQF","trace","newSearchForTypes","searchInpuDto","pageIndex","searchForTypes","selectedType","scrollSearchForTypes","splice","handleDeletedQF","updateSourcesOnFilter","itemsToRemove","updateSources","publish","clear","autoinject","EventAggregator","SourceSelector","appContext","apiClient","sMediator","modal","projectId","catInput","typeInput","famInput","pageSize","isLoading","resetTimeoutId","bind","getSearchInputDto","getMoreTypes","attached","setupResizing","resetSearch","catInputChanged","handleInput","typeInputChanged","famInputChanged","clearTimeout","setTimeout","async","projectIdChanged","scrollContext","isAtBottom","newPageIndex","Math","round","loadMoreTypes","toggleAll","loadAllTypes","doneLoading","amountOfTypesLoaded","switchToViewerMode","OpenConfirm","whenClosed","wasCancelled","clearSearchField","updateFilterSources","selectType","typeDto","table","document","getElementById","cols","querySelectorAll","classList","contains","col","resizer","createElement","style","height","offsetHeight","appendChild","createResizableColumn","x","w","mouseMoveHandler","e","dx","clientX","newWidth","minWidth","width","mouseUpHandler","removeEventListener","addEventListener","styles","window","getComputedStyle","parseInt","bindable"],"sourceRoot":""}