{"version":3,"file":"app-04df81e9.d152cf98c45d962fa693.bundle.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AAsBA;AACA;AApBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;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;AAGA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AAEA;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;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAKA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAKA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAlPA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AASA;;AAIA;;AAMA;AACA;;AAKA;AACA;AAvBA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAGA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;AAEA;;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;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;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;;AAEA;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;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AAGA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;ACjPA;AACA;AACA;AACA;AACA;AAEA;AAOA;AAAA;AALA;AACA;AAEA;AAmDA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAGA;AACA;AACA;AACA;AA7DA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAmBA;;;;;;;;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACXA;AACA;AACA;AACA","sources":["webpack://HRMSPortal/./src/components/dashboard/dashboardcomponent.js","webpack://HRMSPortal/./src/components/datatable/datatablecomponent.js","webpack://HRMSPortal/./src/components/editPerson/editperson.js","webpack://HRMSPortal/./src/components/dashboard/dashboardcomponent.html","webpack://HRMSPortal/./src/components/datatable/datatablecomponent.html","webpack://HRMSPortal/./src/components/editPerson/editperson.html"],"sourcesContent":["import {inject,bindable } from 'aurelia-framework';\r\nimport {LoginService} from '../../shared/services/loginservice';\r\nimport {DashboardService} from '../../shared/services/dashboardservice';\r\nimport {Router} from 'aurelia-router';\r\nimport { EmployeeService } from '../../shared/services/employeeservice';\r\nimport {DialogService} from 'aurelia-dialog';\r\nimport Scrollbar from 'smooth-scrollbar';\r\nimport {JwtService} from '../../shared/services/jwtservice';\r\nimport {AttendanceService} from '../../shared/services/attendanceservice';\r\nimport { App } from '../../app';\r\nimport * as moment from 'moment';\r\nimport {SharedState} from \"../../shared/state/sharedstate\";\r\n\r\n\r\n@inject(LoginService,Router,DashboardService,EmployeeService,DialogService,JwtService,AttendanceService,SharedState,App)\r\nexport class DashboardComponent {\r\n\r\n time='';\r\n comments='';\r\n attendanceDetails=[];\r\n inTime='';\r\n outTime='';\r\n record=[];\r\n message='';\r\n totalTime;\r\n firstInTime;\r\n @bindable login;\r\n taskViewList = [];\r\n holidayViewList = [];\r\n leaveViewList = [];\r\n announcementViewList = [];\r\n newTasks = 0;\r\n overTasks = 0;\r\n appreciations = 0;\r\n isPunchedIn = false;\r\n\r\n constructor(loginservice,router,dashboardservice,employeeservice,dialogService,JwtService,attendanceservice,sharedState,App)\r\n {\r\n this.loginservice = loginservice;\r\n this.router = router;\r\n this.dashboardservice = dashboardservice;\r\n this.employeeservice = employeeservice;\r\n this.dialogService = dialogService;\r\n this.jwtService = JwtService;\r\n this.attendanceService=attendanceservice;\r\n this.app=App;\r\n this.serverDate = ''; // Initialize serverDate\r\n this.formattedDate = '';\r\n this.formattedTime = '';\r\n this.timeZone = '';\r\n this.login=true;\r\n this.sharedState = sharedState;\r\n }\r\n\r\n bind(){\r\n this.isLoginPage=true;\r\n }\r\n\r\n /**\r\n * UpdatePropertyValue using this to show header and sidebar after login.\r\n * Added isLoading=false and scrollbar inside the api fetch data to work their functionality after loading the api data.\r\n * Moved scroll bar inside a if condition so it only works if the taskViewList have data.\r\n */\r\n attached(){\r\n\r\n // if(this.jwtService.getToken() === undefined){\r\n // this.loginservice.purgeAuth();\r\n // this.router.navigateToRoute('login')\r\n // }\r\n setTimeout(()=>{\r\n Scrollbar.init(document.querySelector('.smooth-scrollbar'));\r\n },2000);\r\n this.isLoading = true;\r\n this.empid = this.jwtService.getEmployeeId();\r\n // setInterval(() => {\r\n this.dashboardservice.GetDashboardDetails(this.empid)\r\n .then(data => {\r\n console.log();\r\n this.taskViewList = data.TaskViewList;\r\n this.holidayViewList = data.HolidayViewList;\r\n this.leaveViewList = data.LeaveViewList;\r\n this.announcementViewList = data.AnnouncementViewList;\r\n this.newTasks = data.NewTasks;\r\n this.OverDueTasks = data.OverDueTasks;\r\n this.appreciations = data.Appreciations;\r\n this.isLoading = false;\r\n this.serverDate = data.CurrentDate;\r\n console.log(this.serverDate);\r\n // Splitting date and time components\r\n const dateTimeParts = this.serverDate.split('T');\r\n this.formattedDate = this.formatDate(dateTimeParts[0]);\r\n this.formattedTime = this.formatTime(dateTimeParts[1]);\r\n //this.timeZone = this.formatTimeZone(dateTimeParts[2]);\r\n });\r\n // }, 1000); \r\n if(this.taskViewList.length > 0){\r\n Scrollbar.init(document.querySelector('.smooth-scrollbar'));\r\n }\r\n this.app.updatePropertyValue(true);\r\n this.getAttendanceDetails();\r\n\r\n\r\n }\r\n\r\n\r\n /**\r\n * To update time for every second in frontend\r\n */\r\n// Function to format the date (August 17, 2023)\r\n formatDate(dateStr) {\r\n const date = new Date(dateStr);\r\n const options = { year: 'numeric', month: 'long', day: 'numeric' };\r\n return date.toLocaleDateString('en-US', options);\r\n }\r\n\r\n // Function to format the time (18:34)\r\n formatTime(timeStr) {\r\n const timeWithoutSeconds = timeStr.split('.')[0]; // Removing milliseconds\r\n const timeComponents = timeWithoutSeconds.split(':');\r\n return `${timeComponents[0]}:${timeComponents[1]}`;\r\n }\r\n\r\n // // Function to format the time zone (UTC+05:30)\r\n // formatTimeZone(timeZoneStr) {\r\n // const sign = timeZoneStr.charAt(0) === '+' ? 'UTC+' : 'UTC-';\r\n // const time = timeZoneStr.substring(1);\r\n // const hours = Math.floor(time / 60);\r\n // const minutes = time % 60;\r\n // return `${sign}${hours}:${minutes}`;\r\n // }\r\n\r\n /**\r\n * Function to get the attendance details of a employee.\r\n * Fetch the attendance details using empId and assigned the first array value to the variables\r\n * calculating the time for each array value by sending to calculateTotalTime function\r\n */\r\n async getAttendanceDetails(){\r\n await this.attendanceService.GetAttendanceDetails(this.empid)\r\n .then(data => {\r\n this.attendanceDetails= data;\r\n console.log(data);\r\n this.inTime = this.attendanceDetails.length !==0 ? this.attendanceDetails[0].InTime: null;\r\n this.outTime = this.attendanceDetails.length !==0 ? this.attendanceDetails[0].OutTime : null;\r\n this.attendanceId=this.attendanceDetails.length !==0 ? this.attendanceDetails[0].AttendanceID : null;\r\n this.totalTime = this.calculateTotalTime(this.attendanceDetails);\r\n this.firstInTime = this.attendanceDetails.length !==0 ? this.attendanceDetails[this.attendanceDetails.length-1].InTime: null;\r\n });\r\n };\r\n /**\r\n * This function is to calculate total time for each row in punchin / punch out details section\r\n * sending all the total time records to the this.totaltime and converting into minutes,seconds,hours in\r\n * attached().\r\n * @param attendanceData\r\n * @returns {string}\r\n */\r\n\r\n calculateTotalTime(attendanceData){\r\n let totalSeconds = 0;\r\n\r\n if(!attendanceData){\r\n return null;\r\n }\r\n for (let attendance of attendanceData) {\r\n if (attendance.InTime && attendance.OutTime) {\r\n let inTime = new Date(attendance.InTime);\r\n let outTime = new Date(attendance.OutTime);\r\n let diff = Math.abs(outTime - inTime);\r\n totalSeconds += Math.floor(diff / 1000);\r\n }\r\n }\r\n let hours = Math.floor(totalSeconds / 3600);\r\n let minutes = Math.floor((totalSeconds - (hours * 3600)) / 60);\r\n let seconds = totalSeconds - (hours * 3600) - (minutes * 60);\r\n let totalTime = `${hours} hours, ${minutes} minutes, and ${seconds} seconds`;\r\n return `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`;\r\n }\r\n\r\n /**\r\n * Function for Punch In and Punch Out.\r\n *\r\n * calling getAttendanceDetails function to reload the punch In/punch Out section and showing successful message.\r\n */\r\n saveTime(){\r\n event.preventDefault();\r\n if(this.inTime !== null && this.outTime === null){\r\n let inAndOut={AttendanceID:this.attendanceId,OutTime:this.record.Time, OutTimeComment:this.record.Comments,EmployeeID:this.record.EmployeeID};\r\n const sendAttendanceDate = this.attendanceService.SaveAttendance(inAndOut);\r\n sendAttendanceDate.then(\r\n async () => await this.getAttendanceDetails(),\r\n this.message=\"Successfully punched out\",\r\n this.record.Comments=''\r\n ).catch(e => console.error(e))\r\n }else {\r\n let inAndOut={InTime:this.record.Time,InTimeComment:this.record.Comments,EmployeeID:this.record.EmployeeID};\r\n const sendAttendanceDate = this.attendanceService.SaveAttendance(inAndOut);\r\n sendAttendanceDate.then(\r\n async () => await this.getAttendanceDetails(),\r\n this.message=\"Successfully punched in\",\r\n this.record.Comments=''\r\n ).catch(e => console.error(e))\r\n }\r\n }\r\n\r\n /**\r\n * to convert data into day format .output show only day value\r\n * @param data\r\n * @returns {string}\r\n */\r\n\r\n dayFormat(data){\r\n const inputDate = data;\r\n const parsedDate = moment(inputDate, 'DD-MM-YYYY');\r\n const formattedDate = parsedDate.format('DD');\r\n return formattedDate;\r\n\r\n }\r\n\r\n /**\r\n * To convert data into month format .output show only month value\r\n * @param data\r\n * @returns {string}\r\n */\r\n\r\n\r\n monthFormat(data){\r\n const inputDate = data;\r\n const parsedDate = moment(inputDate, 'DD-MM-YYYY');\r\n const formattedDate = parsedDate.format('MMM');\r\n return formattedDate;\r\n }\r\n\r\n /**\r\n * To calculate days remaining for the next holiday, compare holiday date and today date\r\n * @param date\r\n * @returns {number}\r\n */\r\n\r\n timefornextholiday(date){\r\n const presentDate = new Date();\r\n const expiryDate = date;\r\n const presentdate = moment(presentDate, 'DD-MM-YYYY');\r\n const holidaydate = moment(expiryDate, 'DD-MM-YYYY');\r\n const daysremaing = holidaydate - presentdate;\r\n const timeDiffDays = Math.ceil(daysremaing / (24 * 60 * 60 * 1000));\r\n return timeDiffDays;\r\n\r\n }\r\n\r\n navigateToPage(support) {\r\n if (\r\n (navigator.userAgent.includes('Mac') && navigator.userAgent.includes('Safari')) ||\r\n (navigator.userAgent.includes('iPhone') && navigator.userAgent.includes('Safari'))\r\n ) {\r\n setTimeout(function () {\r\n window.location.reload();\r\n }, 500);\r\n } \r\n this.router.navigateToRoute(support);\r\n }\r\n\r\n // redirectToOrganization(announcementId) {\r\n // // Construct the URL for the organization tab and include the announcementId as a parameter\r\n // const organizationUrl = `#/organization?announcementId=${announcementId}`;\r\n //\r\n // // Navigate to the organization tab\r\n // window.location.href = organizationUrl;\r\n // }\r\n\r\n}\r\n\r\n","import {inject } from 'aurelia-framework';\r\nimport {Router} from 'aurelia-router';\r\nimport { EmployeeService } from '../../shared/services/employeeservice';\r\nimport {DialogService} from 'aurelia-dialog';\r\nimport { EditPerson } from '../editPerson/editperson';\r\nimport { ObserverLocator } from 'aurelia-binding';\r\nimport Scrollbar from 'smooth-scrollbar';\r\nimport {LoginService} from \"../../shared/services/loginservice\";\r\nimport {JwtService} from \"../../shared/services/jwtservice\";\r\n\r\n@inject(Router,EmployeeService,DialogService,Element,ObserverLocator,LoginService,JwtService)\r\nexport class DatatableComponent {\r\n \r\n favorites = [];\r\n employeedetails = [];\r\n searchTerm = '';\r\n data = [];\r\n sortby = 1;\r\n position = 'asc';\r\n //sorting based on column\r\n sortName = 'EmployeeID';\r\n sortDirection = 'ascending';\r\n globalColumn = '';\r\n //Buttons\r\n showPrevious = false;\r\n showNext = true;\r\n showNoData = false;\r\n showEmployeeData = true;\r\n\r\n //Api Params\r\n search = ''; //search Global \r\n searchTermObserver = null;\r\n globalSearchTerm = '';\r\n\r\n \r\n constructor(router,employeeservice,dialogService,element,observerLocator,loginservice,jwtService)\r\n {\r\n this.router = router;\r\n this.employeeservice = employeeservice;\r\n this.dialogService = dialogService;\r\n this.element = element;\r\n // Get an observer for the searchTerm property\r\n this.searchTermObserver = observerLocator.getObserver(this, 'searchTerm');\r\n // Subscribe to changes to the searchTerm property\r\n this.search;\r\n this.searchTermObserver.subscribe((newValue) => {\r\n //console.log('Search term changed:', newValue);\r\n this.search = newValue;\r\n });\r\n this.currentPage = 1;\r\n this.pagevalue = [];\r\n this.loginservice = loginservice;\r\n this.jwtService = jwtService;\r\n\r\n }\r\n\r\n //Fetch Employee Data\r\n\r\n async attached() {\r\n // if(this.jwtService.getToken() === undefined){\r\n // this.loginservice.purgeAuth();\r\n // this.router.navigateToRoute('login')\r\n // }\r\n this.fetchData(this.currentPage);\r\n const input = this.element.querySelector('#search-box');\r\n input.addEventListener('input', async () => {\r\n //console.log(this.searchTerm);\r\n if (this.searchTerm && this.searchTerm.length > 3) {\r\n const employeeData = await this.employeeservice.GetPagedEmployeeDetails(this.globalColumn, this.sortDirection, this.searchTerm, this.currentPage);\r\n this.employeedetails = employeeData;\r\n console.log('main');\r\n console.log(this.employeedetails.length);\r\n this.currentPageRecords = this.employeedetails.length;\r\n //this.showNext = false;\r\n if (this.employeedetails.length === 0) {\r\n // Third condition: Display \"No data found\" message\r\n console.log('3');\r\n this.fetchData(this.currentPage);\r\n console.log(this.employeedetails.length);\r\n this.currentPageRecords = this.employeedetails.length;\r\n } else {\r\n console.log('3 else');\r\n console.log(this.employeedetails.length);\r\n this.currentPageRecords = this.employeedetails.length;\r\n this.showNoDataMessage = false;\r\n this.showNext = false;\r\n }\r\n } else {\r\n const employeeData = await this.employeeservice.GetPagedEmployeeDetails(this.globalColumn, this.sortDirection, null, this.currentPage);\r\n this.employeedetails = employeeData;\r\n if (this.employeedetails.length === 0) {\r\n // Second condition: Display \"No data found\" message\r\n this.showNoDataMessage = true;\r\n this.showNext = false;\r\n this.showPrevious = false;\r\n console.log('2');\r\n this.fetchData(this.currentPage);\r\n } else {\r\n console.log('2 else');\r\n this.showNoDataMessage = false;\r\n this.showNext = true;\r\n }\r\n }\r\n });\r\n input.addEventListener('focus', () => {\r\n this.currentPage = 1; // Reset current page to 1 when input is focused\r\n });\r\n if (this.employeedetails.length === 0) {\r\n // First condition: Display \"No data found\" message\r\n console.log('1 throw error');\r\n this.showNoDataMessage = true;\r\n this.showNext = false;\r\n } else {\r\n console.log('1 throw error else');\r\n this.showNoDataMessage = false;\r\n }\r\n this.checkForNoRecordsMessage();\r\n}\r\n\r\nasync fetchData(currentPage) {\r\n const employeeData = await this.employeeservice.GetPagedEmployeeDetails(this.globalColumn, this.sortDirection, this.searchTerm, currentPage);\r\n this.employeedetails = employeeData;\r\n if (this.employeedetails.length === 0) {\r\n // First condition: Display \"No data found\" message\r\n console.log('1');\r\n console.log(this.employeedetails.length);\r\n this.currentPageRecords = this.employeedetails.length;\r\n this.showNext = false;\r\n this.showPrevious = false;\r\n this.showNoDataMessage = true;\r\n } else {\r\n console.log('1 else');\r\n this.employeedetails = employeeData;\r\n console.log(this.employeedetails.length);\r\n this.currentPageRecords = this.employeedetails.length;\r\n if(this.employeedetails.length > 10){\r\n this.showNoDataMessage = false;\r\n this.showNext = false;\r\n }\r\n this.currentPageRecords = this.employeedetails.length;\r\n this.showNoDataMessage = false;\r\n this.showNext = true;\r\n }\r\n this.checkForNoRecordsMessage();\r\n}\r\n\r\ncheckForNoRecordsMessage() {\r\n if (this.searchTerm && this.employeedetails.length !== 0 && this.employeedetails.every((employee) => employee.name.toLowerCase().indexOf(this.searchTerm.toLowerCase()) === -1)) {\r\n // Fourth condition: Display \"No records to display\" error message\r\n console.log('4 condi - No records to display');\r\n this.recordsError = 'No records to display';\r\n }\r\n}\r\n\r\n\r\n //Next Pagination\r\n\r\n // nextPage() {\r\n // console.log(this.employeedetails.length,'next page');\r\n // if(this.pagevalue.length === 1) {\r\n // this.showPrevious = true; \r\n // this.currentPage = this.pagevalue[0] + 1;\r\n // } else if (this.pagevalue.length > 1) {\r\n // let maxPageValue = Math.max(...this.pagevalue);\r\n // this.currentPage = maxPageValue + 1;\r\n // }\r\n // else {\r\n // this.currentPage++; \r\n // }\r\n // this.showPrevious = true; \r\n // return this.employeeservice.GetPagedEmployeeDetails(this.globalColumn, this.sortDirection,this.searchTerm, this.currentPage)\r\n // .then(data => {\r\n // this.employeedetails = data;\r\n // console.log(this.employeedetails);\r\n // this.pagevalue.push(this.currentPage);\r\n // });\r\n // }\r\n\r\n nextPage() { \r\n this.currentPage++; \r\n return this.employeeservice.GetPagedEmployeeDetails(this.globalColumn,this.sortDirection,this.searchTerm,this.currentPage)\r\n .then(data => {\r\n this.employeedetails = data;\r\n this.pagevalue.push(this.currentPage);\r\n if(this.currentPage > 1){\r\n this.showPrevious = true;\r\n }\r\n console.log(this.employeedetails);\r\n });\r\n }\r\n \r\n\r\n //Previous Pagination\r\n previousPage() {\r\n if (this.currentPage > 1) { \r\n this.currentPage--; \r\n return this.employeeservice.GetPagedEmployeeDetails(this.globalColumn,this.sortDirection,this.searchTerm,this.currentPage)\r\n .then(data => {\r\n this.employeedetails = data;\r\n this.pagevalue.pop();\r\n if(this.currentPage <= 1){\r\n this.showPrevious = false;\r\n }\r\n console.log(this.employeedetails);\r\n }); \r\n }\r\n }\r\n //On clicking Current Pagination\r\n goToPage(currentPage) {\r\n this.currentPage = currentPage;\r\n this.fetchData(currentPage);\r\n }\r\n\r\n //Sorting and Direction of the data\r\n\r\n sortData(column) {\r\n this.sortDirection = this.sortDirection === 'asc' ? 'desc' : 'asc';\r\n this.searchTerm = '';\r\n this.globalColumn = column;\r\n return this.employeeservice.GetPagedEmployeeDetails(this.globalColumn,this.sortDirection,this.searchTerm,this.currentPage)\r\n .then(data => {\r\n this.employeedetails = data;\r\n console.log(this.employeedetails);\r\n });\r\n }\r\n \r\n //PageSize\r\n getValue() {\r\n console.log('Selected value:', this.selectedSize);\r\n return this.pageSize = this.selectedSize;\r\n }\r\n\r\n //Dialog Open\r\n showDialog(user) {\r\n this.dialogService.open({viewModel: EditPerson, model: user});\r\n }\r\n\r\n \r\n cancel() {\r\n this.controller.cancel();\r\n }\r\n}\r\n\r\n","import {inject} from 'aurelia-framework';\r\nimport {DialogController} from 'aurelia-dialog';\r\nimport {LoginService} from \"../../shared/services/loginservice\";\r\nimport {JwtService} from \"../../shared/services/jwtservice\";\r\nimport {Router} from 'aurelia-router';\r\n\r\n @inject(DialogController,LoginService,Router,JwtService)\r\n export class EditPerson {\r\n isDragging = false;\r\n dialog;\r\n static inject = [Element];\r\n message = '';\r\n\r\n constructor(controller,router,loginservice,jwtService) {\r\n this.controller = controller;\r\n this.router = router;\r\n this.loginservice = loginservice;\r\n this.jwtService = jwtService;\r\n }\r\n\r\n activate(message) {\r\n this.EmployeeID = message.EmployeeID;\r\n this.FirstName = message.FirstName;\r\n this.LastName = message.LastName;\r\n this.UserName = message.UserName;\r\n this.DepartmentName = message.DepartmentName;\r\n\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 }\r\n\r\n async save() {\r\n const result = {\r\n EmployeeID:this.EmployeeID,\r\n FirstName: this.FirstName,\r\n LastName: this.LastName,\r\n UserName: this.UserName,\r\n DepartmentName:this.DepartmentName\r\n };\r\n console.log(result);\r\n this.controller.cancel();\r\n }\r\n\r\n cancel() {\r\n this.controller.cancel();\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 }\r\n","// 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);\nvar ___HTML_LOADER_IMPORT_1___ = new URL(\"../../images/newtask-icon.svg\", import.meta.url);\nvar ___HTML_LOADER_IMPORT_2___ = new URL(\"../../images/overdue-icon.svg\", import.meta.url);\nvar ___HTML_LOADER_IMPORT_3___ = new URL(\"../../images/appreciation-icon.svg\", import.meta.url);\nvar ___HTML_LOADER_IMPORT_4___ = new URL(\"../../images/clock.svg\", import.meta.url);\nvar ___HTML_LOADER_IMPORT_5___ = new URL(\"../../images/timer-reset.svg\", import.meta.url);\n// Module\nvar ___HTML_LOADER_REPLACEMENT_0___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_0___);\nvar ___HTML_LOADER_REPLACEMENT_1___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_1___);\nvar ___HTML_LOADER_REPLACEMENT_2___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_2___);\nvar ___HTML_LOADER_REPLACEMENT_3___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_3___);\nvar ___HTML_LOADER_REPLACEMENT_4___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_4___);\nvar ___HTML_LOADER_REPLACEMENT_5___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_5___);\nvar code = \"\\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/sort-icon.svg\", import.meta.url);\nvar ___HTML_LOADER_IMPORT_1___ = new URL(\"../../images/more-icon.svg\", import.meta.url);\nvar ___HTML_LOADER_IMPORT_2___ = new URL(\"../../images/edit.svg\", import.meta.url);\n// Module\nvar ___HTML_LOADER_REPLACEMENT_0___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_0___);\nvar ___HTML_LOADER_REPLACEMENT_1___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_1___);\nvar ___HTML_LOADER_REPLACEMENT_2___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_2___);\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;"],"names":[],"sourceRoot":""}