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aAAc,CACpB,IAAIC,EAAIxB,KAAKG,YACb,GAAIqB,KAAOA,EAAEjB,KAAKkB,OAAS,GAAM,OAAOzB,KAAK0B,KAAK,uBAAuBJ,GACzEA,EAAEK,OAAS3B,KAAKG,W,CAEjB,OAAO,CACR,CAEA,IAAAuB,CAAKE,EAAaN,GAGjB,OAFAO,MAAMD,GACNN,EAAEC,cAAe,GACV,CACR,GApEYxC,E,mUAAiB,EAD7B,EAAA+C,W,kIAcmB,EAAAC,iBACC,IACC,OAfThD,E,sICNN,IAAMiD,EAAN,MAGN,WAAAhD,CAAsBC,GAAA,KAAAA,OAAAA,EAFtB,KAAAgD,aAAoC,IAIpC,CAEA,MAAAC,GACClC,KAAKf,OAAOiD,QACb,CAEA,EAAAC,GACCC,QAAQC,IAAI,qCACZrC,KAAKf,OAAOkD,KACZC,QAAQC,IAAI,mCACb,CAEA,UAAAC,CAAWC,G,QACVH,QAAQC,IAAI,wBAAyBE,GACjCA,EAAOhB,eAEXa,QAAQC,IAAI,oBAAoBE,EAAQ,MAAwB,QAAjB,EAAAvC,KAAKiC,oBAAY,eAAE1B,MAClEgC,EAAOZ,OAA0B,QAAjB,EAAA3B,KAAKiC,oBAAY,eAAE1B,KACpC,GAvBYyB,E,mUAAY,EADxB,EAAAF,W,kIAI8B,EAAAC,oBAHlBC,E","sources":["webpack://client-app/./src/app/components/modals/manual-entry-editor/manual-entry-editor.scss","webpack://client-app/./src/app/components/modals/new-value-list/new-value-list.scss","webpack://client-app/./src/app/components/modals/manual-entry-editor/manual-entry-editor.html","webpack://client-app/./src/app/components/modals/new-value-list/new-value-list.html","webpack://client-app/./src/app/components/modals/manual-entry-editor/manual-entry-editor.ts","webpack://client-app/./src/app/components/modals/new-value-list/new-value-list.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, `.manual-entry-editor ux-dialog{max-width:900px}@media(max-width: 1024px){[data-device-type=tablet] .manual-entry-editor ux-dialog{width:calc(100vw - 60px)}}@media(min-width: 1024px){[data-device-type=tablet] .manual-entry-editor ux-dialog{width:80vw}}.manual-entry-editor ux-dialog-body{flex-direction:column;padding:15px !important}.manual-entry-editor ux-dialog-body .form-group:last-of-type{margin-bottom:0}.manual-entry-editor ux-dialog-body label{display:block;padding-top:10px;padding-bottom:5px}.manual-entry-editor ux-dialog-body .splitpeter{display:flex;gap:15px}.manual-entry-editor ux-dialog-body .splitpeter>*{flex:100%}.manual-entry-editor ux-dialog-body .weighting{display:grid;align-items:center;grid-template-columns:1fr calc(15px*3);gap:calc(15px/1.5)}.manual-entry-editor ux-dialog-body .weighting__value{text-align:right}`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/app/components/modals/manual-entry-editor/manual-entry-editor.scss\",\"webpack://./src/resources/customized-styles/variables.scss\"],\"names\":[],\"mappings\":\"AAEA,+BACC,eAAA,CAGC,0BADD,yDAEE,wBAAA,CAAA,CAGD,0BALD,yDAME,UAAA,CAAA,CAIF,oCACC,qBAAA,CACA,uBAAA,CAGC,6DACC,eAAA,CAIF,0CACC,aAAA,CACA,gBAAA,CACA,kBAAA,CAGD,gDACC,YAAA,CACA,QChBM,CDkBN,kDACC,SAAA,CAIF,+CACC,YAAA,CACA,kBAAA,CACA,sCAAA,CACA,kBAAA,CAEA,sDACC,gBAAA\",\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// 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, `.new-value-list{width:300px}.new-value-list ux-dialog-body{flex-direction:column;padding:15px !important;width:100%}`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/app/components/modals/new-value-list/new-value-list.scss\"],\"names\":[],\"mappings\":\"AAEA,gBACC,WAAA,CAGC,+BACC,qBAAA,CACA,uBAAA,CACA,UAAA\",\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Module\nvar code = ` `;\n// Exports\nexport default code;","// Module\nvar code = ` `;\n// Exports\nexport default code;","import { ManualEntryDto } from 'app/models/manual-entry-dto';\r\nimport { EntryTypes } from './../../../models/manual-entry-dto';\r\nimport { autoinject } from 'aurelia-framework';\r\nimport { AppContextService } from 'app/services/app-context-service';\r\nimport { ApiClient } from 'app/services/api-client';\r\nimport { DisplayUnitTypesOnProject } from 'app/models/parameter-definition-dto';\r\nimport { DialogCloseResult, DialogController } from 'aurelia-dialog';\r\n\r\n\r\n\r\n@autoinject\r\nexport class ManualEntryEditor {\r\n\tpublic manualEntry: ManualEntryDto | undefined;\r\n\tpublic unitTypes: DisplayUnitTypesOnProject[] = [];\r\n\tpublic entryTypes: EntryTypes[] = [EntryTypes.Main, EntryTypes.Option, EntryTypes.Regulation];\r\n\r\n\t/* Right now, both devs and production\r\n\t * should experience EntryTypes as disabled,\r\n\t * to prepare for manual-entries release.\r\n\t * Later, we will re-enable it for TEST-env.\r\n\t */\r\n\tpublic entryTypesDisabled: boolean = true; //!(environment.debug || environment.testing);\r\n\r\n\tconstructor(\r\n\t\tprotected dialog: DialogController,\r\n\t\tprivate apiClient: ApiClient,\r\n\t\tprivate appContext: AppContextService\r\n\t) {\r\n\t\tdialog.settings.overlayDismiss = false;\r\n\t\t// bemaerk, vi redigerer ManualEntryDto.quantityPrecise\r\n\t}\r\n\r\n\tasync activate(ME_Args:ManualEntryEditorArgs) {\r\n\t\tlet model: ManualEntryDto|undefined = ME_Args.ME_model;\r\n\r\n\t\t// It would be much faster if we could cache this data in the parent.\r\n\t\t//console.log('ManualEntryEditor.activate, calling GetDisplayUnitTypeEnums');\r\n\t\t//this.unitTypes = await this.apiClient.projectWToken(this.appContext.projectId).get(\"ParameterDefinitions/GetDisplayUnitTypeEnums\").jsonResult();\r\n\t\tthis.unitTypes = ME_Args.displayUnits;\r\n\r\n\t\tif (Boolean(model)) { // edit existing.\r\n\t\t\tthis.manualEntry = Object.assign({}, model);\r\n\t\t} else { // create new.\r\n\t\t\tlet firstUnitType = this.unitTypes[0];\r\n\t\t\tthis.manualEntry = {\r\n\t\t\t\tid: \"00000000-0000-0000-0000-000000000000\",\r\n\t\t\t\tname: \"\",\r\n\t\t\t\tentryType: EntryTypes.Main,\r\n\t\t\t\tquantity: 0,\r\n\t\t\t\tquantityPrecise: \"0\",\t\t\t\t\r\n\t\t\t\tquantityRounded: \"0\",\t\t\t\t\r\n\t\t\t\tquantity_UnitType: firstUnitType.unitTypeEnumInt, \r\n\t\t\t\tdisplayUnit_short: firstUnitType.unitShort,\r\n\t\t\t\tdisplayUnit_long: firstUnitType.unitString,\r\n\t\t\t\tweighting: 0,\r\n\t\t\t\tselected: false\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\r\n\tupdateWeighting() {\r\n\t\tif (this.manualEntry) {\r\n\t\t\tthis.manualEntry.weighting = this.manualEntry.entryType === EntryTypes.Option ? 100 : 0;\r\n\t\t}\r\n\t}\r\n\r\n\tcanDeactivate(r: DialogCloseResult):boolean {\r\n\t\tif (!r.wasCancelled) {\r\n\t\t\tlet m = this.manualEntry;\r\n\t\t\tif (m && !(m.name.length > 0)) { return this.fail('Name cannot be empty',r); }\r\n\t\t\tr.output = this.manualEntry;\r\n\t\t} \r\n\t\treturn true;\r\n\t}\r\n\r\n\tfail(msg: string, r: DialogCloseResult):boolean {\r\n\t\talert(msg); // Alert() er ikke god, fordi den ikke tager keyboard focus.\r\n\t\tr.wasCancelled = true;\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nexport interface ManualEntryEditorArgs {\r\n\tME_model: ManualEntryDto|undefined;\r\n\tdisplayUnits: DisplayUnitTypesOnProject[];\r\n}\r\n","import { ValueListDto } from 'app/models/value-list-dtos';\r\nimport {DialogCloseError, DialogCloseResult, DialogController} from 'aurelia-dialog';\r\nimport { autoinject } from 'aurelia-framework';\r\n\r\n@autoinject\r\nexport class NewValueList {\r\n\tnewValueList: ValueListDto | null = null;\r\n\r\n\tconstructor(protected dialog: DialogController) {\r\n\r\n\t}\r\n\r\n\tcancel() {\r\n\t\tthis.dialog.cancel();\r\n\t}\r\n\r\n\tok() {\r\n\t\tconsole.log('BEFORE ctrl.ok, ok-button+clicked');\r\n\t\tthis.dialog.ok();\r\n\t\tconsole.log('AFTER ctrl.ok, ok-button+clicked');\r\n\t}\r\n\t\r\n\tdeactivate(result: DialogCloseResult | DialogCloseError) {\r\n\t\tconsole.log('welcome to deactivate', result);\r\n\t\tif (result.wasCancelled) { return; }\r\n\r\n\t\tconsole.log('setting output in',result, 'to:', this.newValueList?.name);\r\n\t\tresult.output = this.newValueList?.name;\r\n\t}\r\n}\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","ManualEntryEditor","constructor","dialog","apiClient","appContext","unitTypes","entryTypes","Main","Option","Regulation","entryTypesDisabled","settings","overlayDismiss","activate","ME_Args","model","ME_model","this","displayUnits","Boolean","manualEntry","Object","assign","firstUnitType","name","entryType","quantity","quantityPrecise","quantityRounded","quantity_UnitType","unitTypeEnumInt","displayUnit_short","unitShort","displayUnit_long","unitString","weighting","selected","updateWeighting","canDeactivate","r","wasCancelled","m","length","fail","output","msg","alert","autoinject","DialogController","NewValueList","newValueList","cancel","ok","console","log","deactivate","result"],"sourceRoot":""}