{"version":3,"file":"app-31743c5a.d152cf98c45d962fa693.bundle.js","mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAKA;AAMA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAKA;AAOA;AAEA;AACA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AACA;AAUA;AAKA;AAEA;AACA;;;;;;;;;;;;;;;;;;;;ACnGA;AACA;AACA;AACA;AACA;AACA;AAEA;AAOA;AAAA;AAJA;AACA;AAyBA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAGA;AACA;AACA;AACA;AAlCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;;AAWA;AAAA;AAbA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAkGA;AACA;AAjGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;;AAEA;AACA;;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;ACtPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAOA;AAAA;AAJA;AACA;AAIA;AACA;AACA;AACA;AACA;AAGA;AAEA;AAEA;AAEA;AACA;AACA;AAEA;AAOA;;;;;;;;;;;;;;;;;;;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AAaA;AAAA;AAVA;AACA;AACA;AAGA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAIA;AACA;AACA;AACA;AACA;AACA;AAGA;AAEA;AAEA;AACA;AACA;AACA;AACA;;AAGA;AAGA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AAEA;AAGA;AAGA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAIA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AAGA;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAWA;AAAA;AATA;AACA;AACA;AACA;AACA;AAEA;AACA;AAyHA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAGA;AACA;AACA;AACA;AAnIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAkBA;;;;;;;;;;;AC3JA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACPA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA","sources":["webpack://HRMSPortal/./src/components/sample/samplecomponent.js","webpack://HRMSPortal/./src/components/sesssionconfirmation/confirmationcomponent.js","webpack://HRMSPortal/./src/components/support/support.js","webpack://HRMSPortal/./src/components/task/taskcomponent.js","webpack://HRMSPortal/./src/components/test/testlistscreencomponent.js","webpack://HRMSPortal/./src/components/uploadimagepopup/uploadimagepopupcomponent.js","webpack://HRMSPortal/./src/components/sample/samplecomponent.html","webpack://HRMSPortal/./src/components/sesssionconfirmation/confirmationcomponent.html","webpack://HRMSPortal/./src/components/support/support.html","webpack://HRMSPortal/./src/components/task/taskcomponent.html","webpack://HRMSPortal/./src/components/test/testlistscreencomponent.html","webpack://HRMSPortal/./src/components/uploadimagepopup/uploadimagepopupcomponent.html"],"sourcesContent":["import {inject } from 'aurelia-framework';\r\n\r\nimport {HttpClient, json} from 'aurelia-fetch-client';\r\n\r\nimport {Router,activationStrategy} from 'aurelia-router';\r\n\r\nimport {SharedState} from '../../shared/state/sharedstate';\r\n\r\nimport {config} from '../../shared/services/config';\r\n\r\nimport {ValidationControllerFactory, ValidationRules} from 'aurelia-validation';\r\n\r\nimport {ApiService} from '../../shared/services/apiservice';\r\n\r\n\r\n\r\n\r\n@inject(ApiService,SharedState, Router, HttpClient, Element, ValidationControllerFactory)\r\n\r\nexport class Sample {\r\n\r\n\r\n\r\nconstructor( apiService,sharedState, router, httpClient, element, controllerFactory) {\r\n\r\n this.apiService = apiService;\r\n\r\n this.sharedState = sharedState;\r\n\r\n this.router = router;\r\n\r\n this.httpClient = httpClient;\r\n\r\n this.element = element;\r\n\r\n this.controller = controllerFactory.createForCurrentScope(); \r\n\r\n}\r\n\r\n\r\n\r\n\r\n submit()\r\n\r\n{\r\n\r\n\r\n\r\n\r\nvar employee = {\r\n\r\n \"SalaryRevisionId\":2769,\r\n \"EmployeeID\":384,\r\n\r\n \"AppraiseeId\": 0 ,\r\n\r\n \"AppraisalLetter\": \"\",\r\n\r\n\"DateofAppraisal\": \"2023-4-30\",\r\n\r\n\"DaysToRemindsHR\":0,\r\n\r\n \"DepartmentId\":0,\r\n\r\n \"PositionId\":0,\r\n\r\n \"PositionLevelId\":0,\r\n\r\n \"PositionlevelEffectiveDate\":\"\",\r\n\r\n\"RevisedCTCEffectiveDate\":\"2023-4-30\",\r\n\r\n\"Reason\":\"test123\",\r\n\r\n \"NextRevisionDueDate\":\"2024-4-30\",\r\n\r\n\"PersonID\":388,\r\n\r\n\"RevisedCTC\":550000,\r\n\r\n \"VariablePay\":100000,\r\n \"TotalPay\" : 600000\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n};\r\n\r\n\r\n\r\n\r\n return this.apiService.post('/Employee/PostPersonCTCRevision/',employee)\r\n\r\n}\r\n}","// confirmation-dialog.js\r\nimport { inject } from 'aurelia-framework';\r\nimport { DialogController } from 'aurelia-dialog';\r\nimport {LoginService} from \"../../shared/services/loginservice\";\r\nimport {App} from \"../../app\";\r\nimport {Router} from 'aurelia-router';\r\n\r\n@inject(DialogController,LoginService,App,Router,Element)\r\n\r\nexport class ConfirmationDialog {\r\n isDragging = false;\r\n dialog;\r\n static inject = [Element];\r\n\r\n constructor(controller,loginService,App,router,element) {\r\n this.controller = controller;\r\n this.loginService= loginService;\r\n this.app = App;\r\n this.router = router;\r\n this.element = element;\r\n }\r\n activate(message) {\r\n this.message = message;\r\n }\r\n startDragging(event) {\r\n if (event.button === 0) {\r\n this.isDragging = true;\r\n this.offsetX = event.clientX - this.dialogElement.getBoundingClientRect().left;\r\n this.offsetY = event.clientY - this.dialogElement.getBoundingClientRect().top;\r\n\r\n window.addEventListener('mousemove', this.drag);\r\n window.addEventListener('mouseup', this.stopDragging);\r\n }\r\n }\r\n\r\n drag = (event) => {\r\n if (this.isDragging) {\r\n const x = event.clientX - this.offsetX;\r\n const y = event.clientY - this.offsetY;\r\n\r\n this.dialogElement.style.left = `${x}px`;\r\n this.dialogElement.style.top = `${y}px`;\r\n }\r\n }\r\n\r\n stopDragging = () => {\r\n this.isDragging = false;\r\n window.removeEventListener('mousemove', this.drag);\r\n window.removeEventListener('mouseup', this.stopDragging);\r\n }\r\n logout() {\r\n const parentDiv = event.target.parentNode.parentNode;\r\n if (parentDiv.classList.contains('userlogout')) {\r\n this.loginService.purgeAuth();\r\n this.app.updatePropertyValue(false);\r\n // Redirect to the login page\r\n this.router.navigateToRoute('login');\r\n }\r\n this.controller.ok();\r\n }\r\n}\r\n","import {inject,bindable, bindingMode, customAttribute } from 'aurelia-framework';\r\nimport * as tinymce from 'tinymce';\r\nimport {ValidationControllerFactory, ValidationRules,validateTrigger} from 'aurelia-validation';\r\nimport { SupportService } from '../../shared/services/supportservice';\r\nimport {JwtService} from '../../shared/services/jwtservice';\r\nimport { data } from 'jquery';\r\nimport {LoginService} from \"../../shared/services/loginservice\";\r\nimport {Router} from 'aurelia-router';\r\n@inject(ValidationControllerFactory,SupportService,JwtService,LoginService,Router)\r\nexport class Support {\r\n support=[];\r\n errors = null;\r\n //editorContent = '';\r\n filePath = '';\r\n message;\r\n editor = null;\r\n fileMessage;\r\n Filename='';\r\n reasonErrorMessage = false;\r\n feedbackType=null;\r\n location=null;\r\n module=null;\r\n isFormSubmitted = false;\r\n constructor(controllerFactory,SupportService,JwtService,loginService,router){\r\n this.support.feedbackType=null;\r\n this.support.location=null;\r\n this.support.module=null;\r\n this.controller = controllerFactory.createForCurrentScope();\r\n this.controller.validateTrigger = validateTrigger.change; \r\n this.supportService = SupportService;\r\n this.jwtService = JwtService;\r\n this.router = router;\r\n this.loginService = loginService;\r\n this.rules = ValidationRules\r\n .ensure('feedbackType').displayName(\"Feedback type\").required()\r\n .ensure('location').required()\r\n .ensure('module').required()\r\n .ensure('editorContent').required()\r\n .on(this.support);\r\n\r\n \r\n }\r\n\r\n getCurrentRouteURL() {\r\n const currentInstruction = this.router.currentInstruction;\r\n if (currentInstruction) {\r\n const routeURL = currentInstruction.fragment;\r\n const sidebarListItem = document.querySelector('.sidebar ul li.support');\r\n if (sidebarListItem) {\r\n const subActiveItems = document.querySelectorAll('.sidebar ul li.sub-active');\r\n subActiveItems.forEach(item => item.classList.remove('sub-active'));\r\n const activeLinkItems = document.querySelectorAll('.sidebar ul li.active-link');\r\n activeLinkItems.forEach(item => item.classList.remove('active-link'));\r\n sidebarListItem.classList.add('sub-active');\r\n }\r\n }\r\n return '';\r\n }\r\n\r\n attached(){\r\n this.getCurrentRouteURL();\r\n this.empid = this.jwtService.getEmployeeId();\r\n this.locid = this.jwtService.getLocationId();\r\n tinymce.init({\r\n selector: 'textarea',\r\n toolbar: 'undo redo | blocks fontfamily fontsize | bold italic underline strikethrough | link image media table mergetags | addcomment showcomments | spellcheckdialog a11ycheck typography | align lineheight | checklist numlist bullist indent outdent | emoticons charmap | removeformat',\r\n setup: editor => {\r\n editor.on('init', () => {\r\n this.editor = editor;\r\n this.editorContent = '';\r\n });\r\n editor.on('change', () => {\r\n this.editorContent = editor.getContent();\r\n });\r\n editor.on('keyup', () => {\r\n this.reasonErrorMessage = false;\r\n });\r\n },\r\n });\r\n const fileInput = document.querySelector('input[type=\"file\"]');\r\n const allowedTypes = ['image/jpeg', 'image/png','application/msword','application/pdf'];\r\n fileInput.addEventListener('change', (event) => {\r\n const file = event.target.files[0];\r\n const fileType = file.type;\r\n if (!allowedTypes.includes(fileType)) {\r\n this.fileMessage=\"Only JPEG, PNG, PDF and DOC files are allowed.\";\r\n } else {\r\n this.fileMessage=null;\r\n }\r\n });\r\n this.isLoading = true;\r\n this.supportService.getLocationsByEmployeeId(this.empid).then(\r\n data=>{\r\n this.isLoading = false;\r\n this.locations=data;\r\n console.log(data);\r\n });\r\n this.supportService.getModulesData().then(\r\n data=>{\r\n this.isLoading = false;\r\n this.modules=Object.entries(data).map(([key, value])=>({value, key}));\r\n });\r\n this.supportService.getFeedbackTypes().then(data=>{\r\n this.isLoading = false;\r\n this.feedbackTypes = Object.entries(data).map(([key, value])=>({value, key}));\r\n });\r\n\r\n var topSidebarLinks = document.querySelectorAll('.top-sidebar-links li');\r\n topSidebarLinks.forEach(function(li) {\r\n li.addEventListener('click', function() {\r\n var supportItems = document.querySelectorAll('.sidebar ul li.support');\r\n supportItems.forEach(function(supportItem) {\r\n supportItem.classList.remove('sub-active');\r\n });\r\n });\r\n }); \r\n\r\n }\r\n\r\n locationMatcher = (a, b) => {\r\n return a.key === b.key;\r\n };\r\n openFileDialog() {\r\n document.getElementById('attachments').click();\r\n }\r\n handleFileSelect(files) {\r\n const file = files[0];\r\n const maxSize = 2.5 * 1024 * 1024;\r\n if (file.size > maxSize) {\r\n this.fileMessage = 'File size should be less than 2.5 MB.';\r\n setTimeout(() => {\r\n this.fileMessage = null;\r\n }, 4000);\r\n this.removeFile();\r\n return;\r\n }\r\n else if (file.size <= maxSize) {\r\n this.file = file;\r\n let reader = new FileReader();\r\n reader.readAsDataURL(file);\r\n this.DocumentName = file.name;\r\n reader.onload = () => {\r\n this.file = reader.result;\r\n };\r\n }\r\n }\r\n removeFile() {\r\n this.file = null;\r\n this.DocumentName = '';\r\n const fileInput = document.getElementById('attachments');\r\n if (fileInput) {\r\n fileInput.value = '';\r\n }\r\n }\r\n validateField(data){\r\n console.log(data);\r\n console.log(this.editorContent);\r\n if(data)\r\n {\r\n console.log(data);\r\n this.reasonErrorMessage = false;\r\n this.controller.clear();\r\n\r\n //return;\r\n }\r\n ValidationRules\r\n .ensure('feedbackType').displayName(\"Feedback type\").required()\r\n .ensure('location').required()\r\n .ensure('module').required()\r\n .on(this.controller);\r\n }\r\n saveRequest() {\r\n this.errors = null;\r\n if(this.fileMessage){\r\n return false;\r\n }\r\n this.controller.validate()\r\n .then(result => {\r\n if (result.valid) {\r\n let supportData = {\r\n ModuleID: this.support.module,\r\n LocationID:this.support.location,\r\n FeedbackTypeID:this.support.feedbackType,\r\n EmployeeID:this.empid,\r\n Comments:this.editorContent,\r\n FilePath:this.file,\r\n FileName:this.DocumentName\r\n };\r\n if (this.editorContent == null || this.editorContent == \"\" || this.editorContent == undefined) {\r\n this.reasonErrorMessage = true;\r\n }\r\n else {\r\n this.reasonErrorMessage = false;\r\n this.isFormSubmitted = true;\r\n this.supportService.SaveSupportForm(supportData).then(()=>{\r\n console.log(supportData);\r\n this.support.module='';\r\n this.support.location='';\r\n this.support.feedbackType='';\r\n this.support.upload='';\r\n this.editorContent='';\r\n this.file='';\r\n this.message=\"Request submitted successfully\";\r\n const errorElement = document.querySelector(\".scrolltoerrorsuccess\");\r\n if (errorElement) {\r\n errorElement.scrollIntoView({ behavior: \"auto\", block: \"start\", inline: \"nearest\" });\r\n window.scrollBy(0, -200);\r\n }\r\n const fileInput = document.querySelector('input[type=file]');\r\n if (fileInput) {\r\n fileInput.value = '';\r\n }\r\n if (this.editor) {\r\n this.editor.setContent('');\r\n this.editor = null;\r\n }\r\n this.editorContent = '';\r\n\r\n setTimeout(()=>{this.message=null},3000);\r\n this.isFormSubmitted = false;\r\n });\r\n }\r\n } else {\r\n this.errors = \"Invalid credentials\";\r\n const errorElement = document.querySelector(\".scrolltoerrorsuccess\");\r\n if (errorElement) {\r\n errorElement.scrollIntoView({ behavior: \"auto\", block: \"start\", inline: \"nearest\" });\r\n window.scrollBy(0, -200);\r\n }\r\n }\r\n }); }\r\n detached() {\r\n tinymce.remove(this.editor);\r\n }\r\n resetForm(){\r\n this.controller.reset();\r\n this.support.module='';\r\n this.reasonErrorMessage = false;\r\n this.support.location ='';\r\n this.support.feedbackType='';\r\n this.support.upload='';\r\n this.support.comments='';\r\n this.editorContent='';\r\n this.editor.setContent('');\r\n this.file='';\r\n }\r\n}\r\n","import {inject,bindingMode,bindable } from 'aurelia-framework';\r\nimport flatpickr from \"flatpickr\";\r\nimport { JwtService } from '../../shared/services/jwtservice';\r\nimport { DialogController } from 'aurelia-dialog';\r\nimport {DialogService} from 'aurelia-dialog';\r\nimport { TaskService } from '../../shared/services/taskservice';\r\nimport * as XLSX from 'xlsx';\r\nimport {config} from '../../shared/services/config';\r\nimport { data } from 'jquery';\r\n\r\n@inject(DialogController,JwtService,TaskService,DialogService)\r\nexport class MyTimeoffDetailsComponent{\r\n \r\n isLoading = false;\r\n taskViewList = [];\r\n pageSize = config.grid_PazeSize;\r\n \r\n constructor(controller,JwtService,TaskService,DialogService){\r\n this.controller = controller;\r\n this.jwtService= JwtService;\r\n this.taskService = TaskService;\r\n this.dialogService = DialogService;\r\n this.empid = this.jwtService.getEmployeeId();\r\n \r\n \r\n }\r\n \r\n attached(){\r\n\r\n this.taskService.GettaskList(this.empid)\r\n .then(data =>{\r\n this.taskViewList = data.TaskViewListData;\r\n console.log(this.taskViewList)\r\n });\r\n\r\n }\r\n\r\n \r\n\r\n \r\n\r\n \r\n}\r\n","import {inject,bindingMode,bindable } from 'aurelia-framework';\r\nimport { EmployeeService } from '../../shared/services/employeeservice';\r\nimport flatpickr from \"flatpickr\";\r\nimport { JwtService } from '../../shared/services/jwtservice';\r\nimport { DialogController } from 'aurelia-dialog';\r\nimport {DialogService} from 'aurelia-dialog';\r\nimport { TaskService } from '../../shared/services/taskservice';\r\nimport * as XLSX from 'xlsx';\r\nimport {config} from '../../shared/services/config';\r\nimport { data } from 'jquery';\r\n\r\n\r\n@inject(EmployeeService,DialogController,JwtService,TaskService,DialogService)\r\nexport class MyTimeoffDetailsComponent{\r\n \r\n isLoading = false;\r\n taskViewList = [];\r\n pageSize = config.grid_PazeSize;\r\n \r\n statusOptions = [\r\n { label: 'All', value: 'All', checked: false },\r\n { label: 'Pending with me', value: 'PUB', checked: true},\r\n { label: 'Pending approval', value: 'ACT', checked: false },\r\n ];\r\n\r\n constructor(employeeServices,controller,JwtService,TaskService,DialogService){\r\n this.employeeServices = employeeServices;\r\n this.controller = controller;\r\n this.jwtService= JwtService;\r\n this.taskService = TaskService;\r\n this.dialogService = DialogService;\r\n this.empid = this.jwtService.getEmployeeId();\r\n \r\n \r\n }\r\n \r\n attached(){\r\n\r\n // this.taskService.GettaskList(167)\r\n // .then(data =>{\r\n // this.taskViewList = data.TaskViewListData;\r\n // console.log(this.taskViewList)\r\n // });\r\n\r\n\r\n const selectedStatusList = this.statusOptions\r\n .filter(status => status.checked)\r\n .map(status => status.value);\r\n console.log(this.statusOptions);\r\n const timeoff = {\r\n EmployeeID:1270,\r\n StatusList:selectedStatusList\r\n \r\n };\r\n this.employeeServices.GetMyGoalSheet(timeoff).then(data=>\r\n {\r\n this.taskViewList = data.EmployeeCategoryList;\r\n });\r\n console.log(data);\r\n\r\n }\r\n\r\n save() {\r\n \r\n const selectedStatusList = this.statusOptions\r\n .filter(status => status.checked)\r\n .map(status => status.value);\r\n console.log(this.statusOptions);\r\n\r\n\r\n const timeoff = {\r\n EmployeeID:1270,\r\n StatusList:selectedStatusList\r\n \r\n };\r\n this.employeeServices.GetMyGoalSheet(timeoff).then(data=>\r\n {\r\n this.taskViewList = data.EmployeeCategoryList;\r\n });\r\n console.log(data);\r\n\r\n // const exit= this.employeeServices.PostResignationRequest(data)\r\n // .then(() => {\r\n \r\n // });\r\n\r\n\r\n \r\n// GetMyGoalSheet(data)\r\n// {\r\n// return this.apiService.post('/KRA/GetMyGoalSheet',data)\r\n// .then(data =>\r\n\r\n// {\r\n// return data;\r\n// });\r\n// }\r\n \r\n \r\n }\r\n\r\n \r\n\r\n \r\n\r\n \r\n}\r\n","import {inject } from 'aurelia-framework';\r\nimport { DialogController } from 'aurelia-dialog';\r\nimport {ProfileService} from '../../shared/services/profielservice';\r\nimport Cropper from \"cropperjs\";\r\nimport {JwtService} from '../../shared/services/jwtservice';\r\nimport { Router } from 'aurelia-router';\r\nimport {HeaderService} from '../../shared/services/headerservice';\r\nimport { HeaderLayout } from '../../shared/layouts/headerlayout';\r\nimport {ValidationControllerFactory, ValidationRules} from 'aurelia-validation';\r\nimport {LoginService} from \"../../shared/services/loginservice\";\r\n@inject(DialogController,ProfileService,JwtService,Router,HeaderService,HeaderLayout,ValidationControllerFactory,LoginService)\r\nexport class Uploadimagepopupcomponent {\r\n options = [];\r\n Filename='';\r\n filePath = '';\r\n fileMessage;\r\n cropClicked = false;\r\n static inject = [DialogController,Element];\r\n isDragging = false;\r\n dialog;\r\n\r\n constructor(controller,ProfileService,JwtService,router,HeaderService,HeaderLayout,controllerFactory,loginService) {\r\n this.controller = controller;\r\n this.profileService=ProfileService;\r\n this.jwtService = JwtService;\r\n this.headerService = HeaderService;\r\n this.HeaderLayout=HeaderLayout;\r\n this.router = router;\r\n this.loginService = loginService;\r\n this.validatorFacory = controllerFactory.createForCurrentScope();\r\n this.rules = ValidationRules.ensure('Image')\r\n .required()\r\n .on(this);\r\n //this.router = router;\r\n }\r\n attached() {\r\n // if(this.jwtService.getToken() === undefined){\r\n // this.loginService.purgeAuth();\r\n // this.router.navigateToRoute('login')\r\n // }\r\n const fileInput = document.querySelector('input[type=\"file\"]');\r\n const allowedTypes = ['image/jpeg', 'image/png'];\r\n fileInput.addEventListener('change', (event) => {\r\n const file = event.target.files[0];\r\n const fileType = file.type;\r\n if (!allowedTypes.includes(fileType)) {\r\n this.fileMessage=\"Only JPEG and PNG files are allowed.\";\r\n this.wrongImage=true;\r\n\r\n } else {\r\n this.fileMessage=null;\r\n this.wrongImage=false;\r\n }\r\n });\r\n this.cropper = new Cropper(this.imageElement, {\r\n aspectRatio: null,\r\n dragMode: 'crop',\r\n movable: true,\r\n zoomable: false,\r\n cropBoxResizable: true,\r\n cropBoxMovable: true,\r\n crop(event) {\r\n const croppedDataUrl = this.cropper.getCroppedCanvas().toDataURL();\r\n let croppedImage = new Image();\r\n croppedImage.src = croppedDataUrl;\r\n let container = document.getElementById('showImage');\r\n // Clear the container before appending the new image\r\n while (container.firstChild) {\r\n container.removeChild(container.firstChild);\r\n }\r\n // Append the cropped image to the container\r\n container.appendChild(croppedImage);\r\n }\r\n });\r\n }\r\n cancel() {\r\n this.controller.cancel();\r\n }\r\n fileSelected(event) {\r\n const file = event.target.files[0];\r\n //this.file= event.target.files[0];\r\n if (!file.type.startsWith('image/')) {\r\n this.message='Please select an image file.';\r\n return;\r\n }\r\n const reader = new FileReader();\r\n this.Filename = file.name;\r\n reader.onload = () => {\r\n this.file = reader.result;\r\n this.imageUrl = reader.result;\r\n this.cropper.reset();\r\n this.cropper.replace(this.imageUrl);\r\n };\r\n reader.readAsDataURL(file);\r\n }\r\n crop() {\r\n const refreshEvent = new CustomEvent('refreshImage');\r\n\r\n if (!this.Image) {\r\n this.cropClicked = true;\r\n setTimeout(()=>{this.cropClicked=null},5000);\r\n }\r\n this.errors = null;\r\n this.validatorFacory.validate().then(result=>{\r\n if(result.valid && !this.wrongImage){\r\n const canvas = this.cropper.getCroppedCanvas({\r\n width: 200,\r\n height: 200\r\n });\r\n let croppedImage = new Image();\r\n croppedImage.src = canvas.toDataURL();\r\n const dataUrl = canvas.toDataURL('image/jpeg');\r\n const empid = this.jwtService.getEmployeeId();\r\n let data = {\r\n EmployeeID:empid,\r\n PhotoPath:dataUrl,\r\n PhotoName:this.Filename,\r\n };\r\n this.profileService.SavePostPersonPhotoPath(data).then(()=>{\r\n this.headerService.dynamicHeader(empid)\r\n .then(() => {\r\n document.dispatchEvent(refreshEvent); // Trigger the custom event\r\n });\r\n this.controller.cancel();\r\n });\r\n }\r\n }); \r\n }\r\n startDragging(event) {\r\n if (event.button === 0) {\r\n this.isDragging = true;\r\n this.offsetX = event.clientX - this.dialogElement.getBoundingClientRect().left;\r\n this.offsetY = event.clientY - this.dialogElement.getBoundingClientRect().top;\r\n\r\n window.addEventListener('mousemove', this.drag);\r\n window.addEventListener('mouseup', this.stopDragging);\r\n }\r\n }\r\n\r\n drag = (event) => {\r\n if (this.isDragging) {\r\n const x = event.clientX - this.offsetX;\r\n const y = event.clientY - this.offsetY;\r\n\r\n this.dialogElement.style.left = `${x}px`;\r\n this.dialogElement.style.top = `${y}px`;\r\n }\r\n }\r\n\r\n stopDragging = () => {\r\n this.isDragging = false;\r\n window.removeEventListener('mousemove', this.drag);\r\n window.removeEventListener('mouseup', this.stopDragging);\r\n }\r\n\r\n}\r\n","// Module\nvar code = \"x`\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\\r\\n\";\n// Exports\nexport default code;","// Imports\nimport ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from \"../../../node_modules/html-loader/dist/runtime/getUrl.js\";\nvar ___HTML_LOADER_IMPORT_0___ = new URL(\"../../images/loader.gif\", import.meta.url);\n// Module\nvar ___HTML_LOADER_REPLACEMENT_0___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_0___);\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \" \\r\\n\";\n// Exports\nexport default code;"],"names":[],"sourceRoot":""}