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AC7FpI,gBAdcA,cAAA,QAAAA,MAAA,qCAAAA,MAAA,GAAAqH,EAAArH,MAAA,IAAAA,MAAA,qCAAAA,MAAA,GAAAsH,QAGPtH,MAAA,GAAAA,MAAA,mBAAAD,EAAA6H,0BAQiD5H,QAA6CA,MAA7C,cAAAD,EAAAgI,6BAA6C/H,CAAD,UAAAD,EAAA0I,gBAEtFzI,MAAA,GAA+BA,MAA/B,UAAAD,EAAAsI,mBAA+BrI,CAAD,qGCO/BwH,CAAuB","names":["GridColorListPreviewComponent","_GridColorListPreviewComponent","agInit","params","this","overviewListColorSet","value","selectors","decls","vars","consts","template","rf","ctx","i0","_r2","ctx_r2","navigateToAddColorSet","SelectColorSetComponent","_SelectColorSetComponent","BaseComponent","constructor","colorSets","qualities","dialogRef","gridOptionsBuilderFactoryService","colDefBuilderFactoryService","data","navigationHelperService","router","super","COLOR_SET_EDIT_PERMISSION","LastModifiedCardUtils","getPermissionToModifyItems","numberOfCreelPositions","has","machineQualityId","qualityId","existingColorSets","gridOptionsForListOfColorSets","listOfGridOptions","ngOnInit","setGridOptionsForListOfColorSets","getColorSets","ngAfterViewInit","_this$colorSetsGrid","listOfGridApis","colorSetsGrid","api","onNavigationHelperDestroy","savePartialState","dialogComponent","selectColorSet","close","getSelectedRows","canSelectColorSet","_this$colorSetsGrid2","AssertionUtils","isEmpty","_this$listOfColorSets","isNullOrUndefined","listOfColorSets","length","getById","pipe","takeUntil","unSubscribeOnViewDestroy","subscribe","quality","_quality$singleWidth$","_quality$singleWidth","navigateToNextRouteWithPartialState","singleWidth","weaveStructure","doubleWidth","bottomWeaveStructure","RouteUtils","paths","texStyle","colorSet","addColorSet","absolutePath","creelPositions","request","isNil","getAll","getAllByMachineQuality","filter","isEqual","size","indexOf","id","getBuilder","getColumnDefsForListOfColorSets","GridIdentifier","SELECT_COLOR_SET","withOnCellDoubleClicked","withNoRowsOverlay","scale","titleParam","hideDescription","withLoadingOverlay","withRememberStateForNavigationHelper","build","withField","withHeaderName","withComparator","StringUtils","stringComparator","valueA","valueB","withValueGetter","getColorNamesForColorSet","withSortable","withCellRenderer","withoutFilter","getUniqueColors","map","color","name","join","COLOR_SETS","MACHINE_QUALITIES","i1","i2","MAT_DIALOG_DATA","i3","i4","viewQuery","SelectColorSetComponent_button_6_Template","_r1","_c2","_c1","navigateToAddYarnSet","SelectYarnSetComponent","_SelectYarnSetComponent","yarnSets","overviewListYarnSetService","YARN_SET_EDIT_PERMISSION","possibleValuesSubject","ReplaySubject","gridOptionsForListOfYarnSets","setGridOptionsForListOfYarnSets","getYarnSets","_this$yarnSetsGrid","yarnSetsGrid","selectYarnSet","canSelectYarnSet","_this$yarnSetsGrid2","yarnSet","addYarnSet","listOfYarnSets","next","getColumnDefsForListOfYarnSets","SELECT_YARN_SET","YARN_SETS","SelectYarnSetComponent_button_6_Template"],"ignoreList":[],"sourceRoot":"webpack:///","sources":["./apps/texconnect/src/app/presentation/components/grid/grid-color-list-preview/grid-color-list-preview.component.ts","./apps/texconnect/src/app/presentation/components/grid/grid-color-list-preview/grid-color-list-preview.component.html","./apps/texconnect/src/app/presentation/pages/textile-data/colored-yarn-set/add/select-color-set/select-color-set.component.html","./apps/texconnect/src/app/presentation/pages/textile-data/colored-yarn-set/add/select-color-set/select-color-set.component.ts","./apps/texconnect/src/app/presentation/pages/textile-data/colored-yarn-set/add/select-yarn-set/select-yarn-set.component.html","./apps/texconnect/src/app/presentation/pages/textile-data/colored-yarn-set/add/select-yarn-set/select-yarn-set.component.ts"],"sourcesContent":["import {Component} from '@angular/core';\nimport {OverviewListColorSet} from '@presentation/pages/textile-data/color-set/overview/overview-list-color-set';\n\n@Component({\n templateUrl: './grid-color-list-preview.component.html',\n styleUrls: ['./grid-color-list-preview.component.scss']\n})\nexport class GridColorListPreviewComponent {\n public overviewListColorSet: OverviewListColorSet;\n\n public agInit(params: any): void {\n this.overviewListColorSet = params.value;\n }\n}\n"," \n","
\n \n
\n \n \n \n \n
\n \n
\n","import {AfterViewInit, Component, Inject, OnInit, ViewChild} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';\nimport {Router} from '@angular/router';\nimport {GridIdentifier} from '@application/grids/grid-identifier.enum';\nimport {LastModifiedCardUtils} from '@application/helper/last-modified-card-utils';\nimport {NavigationHelperService} from '@application/helper/navigation-helper/navigation-helper.service';\nimport {NavigationNumberOfCreelPositionsData} from '@application/helper/navigation-helper/navigation-number-of-creel-positions-data.interface';\nimport {RouteUtils} from '@application/helper/routing/route-utils';\nimport {StringUtils} from '@application/helper/string-utils';\nimport {WeaveQuality} from '@domain/textile-data/machine-quality/weave-quality';\nimport {COLOR_SETS, ColorSets} from '@infrastructure/http/color-set/color-sets';\nimport {MACHINE_QUALITIES, MachineQualities} from '@infrastructure/http/machine-quality/machine-qualities';\nimport {GridColorListPreviewComponent} from '@presentation/components/grid/grid-color-list-preview/grid-color-list-preview.component';\nimport {OverviewListColorSet} from '@presentation/pages/textile-data/color-set/overview/overview-list-color-set';\nimport {\n AssertionUtils,\n BaseComponent,\n ColDefBuilderFactoryService,\n Color,\n DialogComponentData,\n GridOptionsBuilderFactoryService,\n NoDataOverlayComponentParams,\n OverlayComponentParams,\n SelectGridDialog\n} from '@vdw/angular-component-library';\nimport {AgGridAngular} from 'ag-grid-angular';\nimport {ColDef, GridApi, GridOptions, ValueGetterParams} from 'ag-grid-community';\nimport {filter, has, indexOf, isEqual, isNil, size} from 'lodash-es';\nimport {takeUntil} from 'rxjs/operators';\n\n@Component({\n templateUrl: './select-color-set.component.html'\n})\nexport class SelectColorSetComponent extends BaseComponent implements OnInit, AfterViewInit, SelectGridDialog {\n @ViewChild('colorSetsGrid') public colorSetsGrid: AgGridAngular;\n public listOfColorSets: OverviewListColorSet[];\n public listOfGridOptions: GridOptions[];\n public listOfGridApis: GridApi[];\n public readonly COLOR_SET_EDIT_PERMISSION = LastModifiedCardUtils.getPermissionToModifyItems('colorSet');\n\n private numberOfCreelPositions: number;\n private machineQualityId: number;\n private existingColorSets: number[];\n\n public constructor(\n @Inject(COLOR_SETS) private readonly colorSets: ColorSets,\n @Inject(MACHINE_QUALITIES) private readonly qualities: MachineQualities,\n private readonly dialogRef: MatDialogRef,\n private readonly gridOptionsBuilderFactoryService: GridOptionsBuilderFactoryService,\n private readonly colDefBuilderFactoryService: ColDefBuilderFactoryService,\n @Inject(MAT_DIALOG_DATA) public data: {numberOfCreelPositions: number; qualityId: number; existingColorSets: number[]},\n private readonly navigationHelperService: NavigationHelperService & NavigationNumberOfCreelPositionsData>,\n private readonly router: Router\n ) {\n super();\n this.numberOfCreelPositions = has(data, 'numberOfCreelPositions') ? data.numberOfCreelPositions : null;\n this.machineQualityId = has(data, 'qualityId') ? data.qualityId : null;\n this.existingColorSets = has(data, 'existingColorSets') ? data.existingColorSets : [];\n }\n\n public get gridOptionsForListOfColorSets(): GridOptions {\n return this.listOfGridOptions[0];\n }\n\n public ngOnInit(): void {\n this.setGridOptionsForListOfColorSets();\n this.getColorSets();\n }\n\n public ngAfterViewInit(): void {\n this.listOfGridApis = [this.colorSetsGrid?.api];\n }\n\n public onNavigationHelperDestroy(): void {\n this.navigationHelperService.savePartialState>({dialogComponent: SelectColorSetComponent});\n }\n\n public selectColorSet(): void {\n this.dialogRef.close(this.colorSetsGrid.api.getSelectedRows()[0]);\n }\n\n public canSelectColorSet(): boolean {\n return !AssertionUtils.isEmpty(this.colorSetsGrid?.api?.getSelectedRows());\n }\n\n public navigateToAddColorSet(): void {\n if (!AssertionUtils.isNullOrUndefined(this.machineQualityId) && this.listOfColorSets?.length < 1) {\n this.qualities\n .getById(this.machineQualityId)\n .pipe(takeUntil(this.unSubscribeOnViewDestroy))\n .subscribe((quality: WeaveQuality) => {\n this.navigationHelperService.navigateToNextRouteWithPartialState(\n {numberOfCreelPositions: quality.singleWidth?.weaveStructure.numberOfCreelPositions ?? quality.doubleWidth.bottomWeaveStructure.numberOfCreelPositions},\n RouteUtils.paths.texStyle.colorSet.addColorSet.absolutePath\n );\n });\n } else {\n this.navigationHelperService.navigateToNextRouteWithPartialState(\n {numberOfCreelPositions: AssertionUtils.isNullOrUndefined(this.machineQualityId) ? this.numberOfCreelPositions : this.listOfColorSets[0].creelPositions.length},\n RouteUtils.paths.texStyle.colorSet.addColorSet.absolutePath\n );\n }\n }\n\n private getColorSets(): void {\n const request = isNil(this.machineQualityId) ? this.colorSets.getAll() : this.colorSets.getAllByMachineQuality(this.machineQualityId);\n request.pipe(takeUntil(this.unSubscribeOnViewDestroy)).subscribe((listOfColorSets: OverviewListColorSet[]) => {\n this.listOfColorSets = !isNil(this.numberOfCreelPositions)\n ? filter(listOfColorSets, (colorSet: OverviewListColorSet) => {\n return isEqual(this.numberOfCreelPositions, size(colorSet.creelPositions));\n })\n : listOfColorSets;\n\n this.listOfColorSets = filter(this.listOfColorSets, (colorSet: OverviewListColorSet) => isEqual(indexOf(this.existingColorSets, colorSet.id), -1));\n });\n }\n\n private setGridOptionsForListOfColorSets(): void {\n this.listOfGridOptions = [\n this.gridOptionsBuilderFactoryService\n .getBuilder(this.getColumnDefsForListOfColorSets(), GridIdentifier.SELECT_COLOR_SET)\n .withOnCellDoubleClicked(() => this.selectColorSet())\n .withNoRowsOverlay({\n scale: 0.7,\n titleParam: 'TEXTILE_DATA.COLOR_SET.COLOR_SET',\n hideDescription: true\n } as NoDataOverlayComponentParams)\n .withLoadingOverlay({\n scale: 0.7\n } as OverlayComponentParams)\n .withRememberStateForNavigationHelper()\n .build()\n ];\n }\n\n private getColumnDefsForListOfColorSets(): ColDef[] {\n return [\n this.colDefBuilderFactoryService.getBuilder().withField('name', true).withHeaderName('GENERAL.NAME').withComparator(StringUtils.stringComparator).build(),\n this.colDefBuilderFactoryService\n .getBuilder()\n .withHeaderName('TEXTILE_DATA.MATERIAL_SET.NUMBER_OF_CREEL_POSITIONS')\n .withField('creelPositions.length', true)\n .withComparator((valueA: number, valueB: number) => valueA - valueB)\n .build(),\n this.colDefBuilderFactoryService\n .getBuilder()\n .withHeaderName('TEXTILE_DATA.COLOR.COLOR')\n .withValueGetter((params: ValueGetterParams) => this.getColorNamesForColorSet(params.data), true)\n .withComparator(StringUtils.stringComparator)\n .build(),\n this.colDefBuilderFactoryService\n .getBuilder()\n .withValueGetter('data')\n .withHeaderName('GENERAL.PREVIEW')\n .withSortable(false)\n .withCellRenderer(GridColorListPreviewComponent)\n .withoutFilter()\n .build()\n ];\n }\n\n private getColorNamesForColorSet(colorSet: OverviewListColorSet): string {\n return colorSet\n .getUniqueColors()\n .map((color: Color) => color.name)\n .join(', ');\n }\n}\n","
\n \n
\n \n \n \n \n
\n \n
\n","import {AfterViewInit, Component, Inject, OnInit, ViewChild} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';\nimport {GridIdentifier} from '@application/grids/grid-identifier.enum';\nimport {LastModifiedCardUtils} from '@application/helper/last-modified-card-utils';\nimport {NavigationHelperService} from '@application/helper/navigation-helper/navigation-helper.service';\nimport {NavigationNumberOfCreelPositionsData} from '@application/helper/navigation-helper/navigation-number-of-creel-positions-data.interface';\nimport {RouteUtils} from '@application/helper/routing/route-utils';\nimport {YARN_SETS, YarnSets} from '@infrastructure/http/yarn-set/yarn-sets';\nimport {OverviewListYarnSet} from '@presentation/pages/textile-data/yarn-set/overview/overview-list-yarn-set';\nimport {OverviewListYarnSetService} from '@presentation/pages/textile-data/yarn-set/overview/overview-list-yarn-set.service';\nimport {AssertionUtils, BaseComponent, DialogComponentData, GridOptionsBuilderFactoryService, OverlayComponentParams, SelectGridDialog} from '@vdw/angular-component-library';\nimport {AgGridAngular} from 'ag-grid-angular';\nimport {GridApi, GridOptions} from 'ag-grid-community';\nimport {filter, has, isEqual, isNil, size} from 'lodash-es';\nimport {ReplaySubject} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\n@Component({\n selector: 'app-select-yarn-set',\n templateUrl: './select-yarn-set.component.html'\n})\nexport class SelectYarnSetComponent extends BaseComponent implements OnInit, AfterViewInit, SelectGridDialog {\n @ViewChild('yarnSetsGrid') public yarnSetsGrid: AgGridAngular;\n public listOfYarnSets: OverviewListYarnSet[];\n public listOfGridOptions: GridOptions[];\n public listOfGridApis: GridApi[];\n public readonly YARN_SET_EDIT_PERMISSION = LastModifiedCardUtils.getPermissionToModifyItems('yarnSet');\n\n private numberOfCreelPositions: number;\n private readonly possibleValuesSubject = new ReplaySubject();\n\n public constructor(\n @Inject(YARN_SETS) private readonly yarnSets: YarnSets,\n private readonly dialogRef: MatDialogRef,\n private readonly gridOptionsBuilderFactoryService: GridOptionsBuilderFactoryService,\n private readonly overviewListYarnSetService: OverviewListYarnSetService,\n @Inject(MAT_DIALOG_DATA) public data: {numberOfCreelPositions: number},\n private readonly navigationHelperService: NavigationHelperService>\n ) {\n super();\n\n this.numberOfCreelPositions = has(data, 'numberOfCreelPositions') ? data.numberOfCreelPositions : null;\n }\n\n public get gridOptionsForListOfYarnSets(): GridOptions {\n return this.listOfGridOptions[0];\n }\n\n public ngOnInit(): void {\n this.setGridOptionsForListOfYarnSets();\n this.getYarnSets();\n }\n\n public ngAfterViewInit(): void {\n this.listOfGridApis = [this.yarnSetsGrid?.api];\n }\n\n public onNavigationHelperDestroy(): void {\n this.navigationHelperService.savePartialState>({dialogComponent: SelectYarnSetComponent});\n }\n\n public selectYarnSet(): void {\n this.dialogRef.close(this.yarnSetsGrid.api.getSelectedRows()[0]);\n }\n\n public canSelectYarnSet(): boolean {\n return !AssertionUtils.isEmpty(this.yarnSetsGrid?.api?.getSelectedRows());\n }\n\n public navigateToAddYarnSet(): void {\n this.navigationHelperService.navigateToNextRouteWithPartialState(\n {numberOfCreelPositions: this.numberOfCreelPositions},\n RouteUtils.paths.texStyle.yarnSet.addYarnSet.absolutePath\n );\n }\n\n private getYarnSets(): void {\n this.yarnSets\n .getAll()\n .pipe(takeUntil(this.unSubscribeOnViewDestroy))\n .subscribe((listOfYarnSets: OverviewListYarnSet[]) => {\n this.listOfYarnSets = !isNil(this.numberOfCreelPositions)\n ? filter(listOfYarnSets, (yarnSet: OverviewListYarnSet) => {\n return isEqual(this.numberOfCreelPositions, size(yarnSet.creelPositions));\n })\n : listOfYarnSets;\n this.possibleValuesSubject.next(this.listOfYarnSets);\n });\n }\n\n private setGridOptionsForListOfYarnSets(): void {\n this.listOfGridOptions = [\n this.gridOptionsBuilderFactoryService\n .getBuilder(this.overviewListYarnSetService.getColumnDefsForListOfYarnSets(this.possibleValuesSubject, false), GridIdentifier.SELECT_YARN_SET)\n .withOnCellDoubleClicked(() => this.selectYarnSet())\n .withLoadingOverlay({\n scale: 0.7\n } as OverlayComponentParams)\n .withNoRowsOverlay({\n scale: 0.7,\n titleParam: 'TEXTILE_DATA.YARN_SET.YARN_SET',\n hideDescription: true\n })\n .withRememberStateForNavigationHelper()\n .build()\n ];\n }\n}\n"],"x_google_ignoreList":[]}