{"version":3,"sources":["webpack:///./src/views/kyc-form/component/TheUploadDocument.vue?4ee1","webpack:///./src/views/kyc-form/section/UploadDocument.vue?d48d","webpack:///./src/views/kyc-form/component/TheUploadDocument.vue?17ba","webpack:///./src/views/kyc-form/component/TheUploadDocument.vue","webpack:///./src/views/kyc-form/component/TheUploadDocument.vue?7b5e","webpack:///./src/views/kyc-form/component/TheUploadDocument.vue?c42e","webpack:///./src/views/kyc-form/section/UploadDocument.vue","webpack:///./src/views/kyc-form/section/UploadDocument.vue?bccb","webpack:///./src/views/kyc-form/section/UploadDocument.vue?83e7"],"names":["render","_vm","this","_h","$createElement","_c","_self","attrs","documentTypeOption","kycFormOid","on","updateAppendixList","staticRenderFns","staticClass","_v","uploadedPDFList","length","$event","showAddNewDocumentDialog","sort","class","getActiveClass","_m","_l","document","index","key","_s","fileName","documentType","convertTimestamptoDateString","createdAt","formatFileSize","fileSize","download","deleteDoc","slot","ref","handleFileUpload","target","files","directives","name","rawName","value","expression","$$selectedVal","Array","prototype","filter","call","options","o","selected","map","val","_value","selectedDocumentType","multiple","section","option","domProps","uploadDocument","_e","parsedDocumentTypeOption","sortBy","prop","order","sortedData","array","data","a","b","fileList","newDocument","inputFile","$refs","loadDataBase","window","open","pdfOid","$api","uploadDoc","delete","error","uiService","alert","show","type","message","success","resetField","list","$emit","formData","FormData","append","upload","hasJsonStructure","JSON","parse","sharedVariable","timeStamp","Date","Number","format","bytes","si","dp","thresh","Math","abs","units","u","r","round","toFixed","str","result","Object","toString","err","components","AppDialog","component","kycSectionStore","evt","updateTotalUploadedPdf","$route","params","formOid","Mutation","State","TheUploadDocument"],"mappings":"kHAAA,W,yCCAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACA,EAAG,oBAAoB,CAACE,MAAM,CAAC,mBAAqBN,EAAIO,mBAAmB,WAAaP,EAAIQ,YAAY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KAAK8H,OAAOC,OAAOC,YArCzC,GAA4C,QAE1C,gBADCL,EAAgBM,U,6CAIjB,gBADCN,EAAgBO,O,uCAJE,EAAc,gBALlC,eAAU,CACTV,WAAY,CACVW,kBAAA,MAGiB,WCpBwZ,ICOza,EAAY,eACd,EACArI,EACAY,GACA,EACA,KACA,WACA,MAIa,e","file":"js/chunk-2a36fc34.fb2a8f03.js","sourcesContent":["export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TheUploadDocument.vue?vue&type=style&index=0&id=599bec0c&lang=scss&scoped=true&\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('TheUploadDocument',{attrs:{\"documentTypeOption\":_vm.documentTypeOption,\"kycFormOid\":_vm.kycFormOid},on:{\"update\":_vm.updateAppendixList}})],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:\"title\"},[_vm._v(\"Upload Documents \"),_c('button',{staticClass:\"btn-default\",attrs:{\"disabled\":_vm.uploadedPDFList.length > 9},on:{\"click\":function($event){_vm.showAddNewDocumentDialog = true}}},[_vm._v(\"New Document\")])]),_c('table',{staticClass:\"bordered doc-table\"},[_c('thead',[_c('tr',[_c('th',{staticClass:\"file-name\",on:{\"click\":function($event){return _vm.sort('fileName')}}},[_c('div',{staticClass:\"cell\"},[_c('span',[_vm._v(\"File Name\")]),_c('span',{staticClass:\"caret-wrapper\"},[_c('i',{staticClass:\"sort-caret ascending\",class:_vm.getActiveClass('fileName','ascending')}),_c('i',{staticClass:\"sort-caret descending\",class:_vm.getActiveClass('fileName','descending')})])])]),_c('th',{staticClass:\"doc-type\",on:{\"click\":function($event){return _vm.sort('documentType')}}},[_c('div',{staticClass:\"cell\"},[_c('span',[_vm._v(\"Document Type\")]),_c('span',{staticClass:\"caret-wrapper\"},[_c('i',{staticClass:\"sort-caret ascending\",class:_vm.getActiveClass('documentType','ascending')}),_c('i',{staticClass:\"sort-caret descending\",class:_vm.getActiveClass('documentType','descending')})])])]),_c('th',{on:{\"click\":function($event){return _vm.sort('createdAt')}}},[_c('div',{staticClass:\"cell\"},[_c('span',[_vm._v(\"Date Uploaded\")]),_c('span',{staticClass:\"caret-wrapper\"},[_c('i',{staticClass:\"sort-caret ascending\",class:_vm.getActiveClass('createdAt','ascending')}),_c('i',{staticClass:\"sort-caret descending\",class:_vm.getActiveClass('createdAt','descending')})])])]),_c('th',[_vm._v(\"File Size\")]),_c('th',[_vm._v(\"Download\")]),_c('th',[_vm._v(\"Delete\")])])]),_c('tbody',[(_vm.uploadedPDFList.length == 0)?[_vm._m(0)]:_vm._l((_vm.uploadedPDFList),function(document,index){return _c('tr',{key:index},[_c('td',{staticClass:\"file-name\"},[_vm._v(_vm._s(document.fileName))]),_c('td',{staticClass:\"doc-type\"},[_vm._v(_vm._s(document.documentType))]),_c('td',[_vm._v(_vm._s(_vm.convertTimestamptoDateString(document.createdAt)))]),_c('td',[_vm._v(_vm._s(_vm.formatFileSize(document.fileSize)))]),_c('td',[_c('button',{staticClass:\"btn-default\",on:{\"click\":function($event){return _vm.download(document)}}},[_vm._v(\"Download\")])]),_c('td',[_c('button',{staticClass:\"btn-danger\",on:{\"click\":function($event){return _vm.deleteDoc(document)}}},[_vm._v(\"Delete\")])])])})],2)]),(_vm.showAddNewDocumentDialog)?_c('AppDialog',{on:{\"close\":function($event){_vm.showAddNewDocumentDialog = false}}},[_c('template',{slot:\"header\"},[_vm._v(\"New Document\")]),_c('div',{attrs:{\"slot\":\"body\"},slot:\"body\"},[_c('div',{staticClass:\"file-picker-div\"},[_c('input',{ref:\"inputFile\",staticClass:\"input-file\",attrs:{\"type\":\"file\",\"data-test\":\"upload-doc\",\"accept\":\".pdf, application/pdf\"},on:{\"change\":function($event){return _vm.handleFileUpload($event.target.files);}}}),_c('div',[_vm._v(\"Document Type\")]),_c('select',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.selectedDocumentType),expression:\"selectedDocumentType\"}],on:{\"change\":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return val}); _vm.selectedDocumentType=$event.target.multiple ? $$selectedVal : $$selectedVal[0]}}},[_vm._l((_vm.parsedDocumentTypeOption),function(section){return [_c('optgroup',{key:section.section,attrs:{\"label\":section.section}},_vm._l((section.options),function(option,index){return _c('option',{key:index,domProps:{\"value\":option.value}},[_vm._v(_vm._s(option.value))])}),0)]})],2)])]),_c('template',{slot:\"footer\"},[_c('button',{staticClass:\"btn-default\",attrs:{\"type\":\"primary\"},on:{\"click\":function($event){return _vm.uploadDocument()}}},[_vm._v(\"Upload\")])])],2):_vm._e()],1)}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('tr',[_c('td',{attrs:{\"colspan\":\"6\"}},[_vm._v(\"------ Data Not Available ------\")])])}]\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// command to build web component : npx vue-cli-service build --mode production --target wc --name the-upload-document src/views/kyc-form/section/TheUploadDocument.vue\nimport { Component, Vue, Prop } from 'vue-property-decorator'\nimport { isEmpty, isUndefined, isNull } from 'lodash/fp'\nimport dayjs from 'dayjs'\nimport API from '@core/services/API'\nimport { inject } from 'inversify-props'\nimport { UIService } from '@core/services/UIService'\nimport { SharedVariable } from '@core/model/SharedVariable'\nimport AppDialog from '@core/components/AppDialog.vue'\n\ninterface Sort {\n prop: string;\n order: 'ascending' | 'descending';\n}\n\n@Component({\n components: {\n AppDialog\n }\n})\nexport default class TheUploadDocument extends Vue {\n @inject()\n private $api: API\n\n @inject()\n private sharedVariable: SharedVariable\n\n uiService: UIService\n\n @Prop() documentTypeOption\n @Prop() readonly kycFormOid\n private showAddNewDocumentDialog = false\n private selectedDocumentType = ''\n private newDocument\n private uploadedPDFList = []\n private parsedDocumentTypeOption = []\n\n private sortBy: Sort = {\n prop: 'fileName',\n order: 'descending'\n }\n\n sort (prop) {\n this.sortBy.prop = prop\n this.sortBy.order = this.sortBy.order === 'descending' ? 'ascending' : 'descending'\n this.uploadedPDFList = this.sortedData(this.uploadedPDFList)\n }\n\n sortedData (array) {\n if (!array) {\n return []\n }\n const data = array.sort((a, b) => {\n if (this.sortBy.order === 'ascending') {\n if (a[this.sortBy.prop] > b[this.sortBy.prop]) { return 1 }\n if (a[this.sortBy.prop] < b[this.sortBy.prop]) { return -1 }\n } else {\n if (a[this.sortBy.prop] > b[this.sortBy.prop]) { return -1 }\n if (a[this.sortBy.prop] < b[this.sortBy.prop]) { return 1 }\n }\n return 0\n })\n return data\n }\n\n handleFileUpload (fileList) {\n // handle file changes\n if (!fileList.length) return\n this.newDocument = fileList[0]\n }\n\n async resetField () {\n this.showAddNewDocumentDialog = false\n this.selectedDocumentType = ''\n const inputFile = this.$refs.inputFile as HTMLInputElement\n if (inputFile?.value) inputFile.value = ''\n await this.loadDataBase()\n }\n\n async download (document) {\n window.open(`/live/api/kyc-doc-upload/${this.kycFormOid}/${document.pdfOid}`, '_blank')\n }\n\n async deleteDoc (document) {\n const data = await this.$api.uploadDoc.delete(this.kycFormOid, document.pdfOid)\n\n if (data.error) {\n await this.uiService.alert.show({\n type: 'error',\n message: data.error\n })\n } else if (data.success) {\n await this.resetField()\n } else {\n await this.uiService.alert.show({\n type: 'error',\n message: 'Fail to delete, something wrong'\n })\n }\n }\n\n async loadDataBase () {\n const data = await this.$api.uploadDoc.list({ kycFormOid: this.kycFormOid })\n\n if (data.error) {\n await this.uiService.alert.show({\n type: 'error',\n message: data.error\n })\n return\n }\n this.uploadedPDFList = this.sortedData(data)\n this.$emit('update', this.uploadedPDFList)\n }\n\n async uploadDocument () {\n if (isEmpty(this.selectedDocumentType)) {\n await this.uiService.alert.show({\n type: 'warning',\n message: 'Please select Document Type'\n })\n return\n }\n\n if (!this.newDocument) {\n await this.uiService.alert.show({\n type: 'warning',\n message: 'Please choose file'\n })\n return\n }\n\n const formData = new FormData()\n formData.append('kycformOid', this.kycFormOid)\n formData.append('fileName', this.newDocument.name)\n formData.append('documentType', this.selectedDocumentType)\n formData.append('file', this.newDocument, this.newDocument.name)\n\n const data = await this.$api.uploadDoc.upload(formData)\n\n if (data.error) {\n await this.uiService.alert.show({\n type: 'error',\n message: data.error\n })\n } else if (data.success) {\n await this.uiService.alert.show({\n type: 'success',\n message: 'Upload Success'\n })\n await this.resetField()\n } else {\n await this.uiService.alert.show({\n type: 'error',\n message: 'Upload fail, something wrong'\n })\n this.showAddNewDocumentDialog = false\n }\n }\n\n async mounted () {\n if (this.documentTypeOption && this.hasJsonStructure(this.documentTypeOption)) {\n this.parsedDocumentTypeOption = JSON.parse(this.documentTypeOption)\n } else {\n this.parsedDocumentTypeOption = this.documentTypeOption\n }\n\n this.uiService = this.sharedVariable.uiService\n\n await this.loadDataBase()\n }\n\n convertTimestamptoDateString (timeStamp) {\n return dayjs(new Date(Number(timeStamp))).format('DD/MM/YYYY')\n }\n\n getActiveClass (prop, order) {\n return this.sortBy.prop === prop &&\n this.sortBy.order === order ? 'active' : null\n }\n\n formatFileSize (bytes = 0, si = true, dp = 0) {\n const thresh = si ? 1000 : 1024\n\n if (isUndefined(bytes) || isNull(bytes)) return '0B'\n if (Math.abs(bytes) < thresh) {\n return bytes + ' B'\n }\n\n const units = si\n ? ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']\n : ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']\n let u = -1\n const r = 10 ** dp\n\n do {\n bytes /= thresh\n ++u\n } while (Math.round(Math.abs(bytes) * r) / r >= thresh && u < units.length - 1)\n\n return bytes.toFixed(dp) + '' + units[u]\n }\n\n hasJsonStructure (str) {\n if (typeof str !== 'string') return false\n try {\n const result = JSON.parse(str)\n const type = Object.prototype.toString.call(result)\n return type === '[object Object]' || type === '[object Array]'\n } catch (err) {\n return false\n }\n }\n}\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--14-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TheUploadDocument.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--14-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TheUploadDocument.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./TheUploadDocument.vue?vue&type=template&id=599bec0c&scoped=true&\"\nimport script from \"./TheUploadDocument.vue?vue&type=script&lang=ts&\"\nexport * from \"./TheUploadDocument.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./TheUploadDocument.vue?vue&type=style&index=0&id=599bec0c&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"599bec0c\",\n null\n \n)\n\nexport default component.exports","\n\n\n\n\n\n\n\n\nimport { Component, Vue } from 'vue-property-decorator'\nimport TheUploadDocument from '../component/TheUploadDocument.vue'\nimport { namespace } from 'vuex-class'\n\nconst kycSectionStore = namespace('KYCSectionStore')\n\n@Component({\n components: {\n TheUploadDocument\n }\n})\nexport default class UploadDocument extends Vue {\n @kycSectionStore.Mutation\n public updateTotalUploadedPdf!: (list: []) => void\n\n @kycSectionStore.State\n private totalUploadedPdf: []\n\n private kycFormOid = ''\n\n private documentTypeOption = [{\n section: 'Type of Document (New Business)',\n options: [\n { value: 'NRIC' },\n { value: 'Application Forms' },\n { value: 'Policy Illustration' },\n { value: 'Personal Financial Review' },\n { value: 'Birth Certificate' },\n { value: 'Medical Reports' },\n { value: 'Cheque Image' },\n { value: 'Terms & Conditions' },\n { value: 'Others' }\n ]\n }, {\n section: 'Type of Document (Follow Up)',\n options: [\n { value: 'Service Recovery' },\n { value: 'Claims' },\n { value: 'Change of FAR' },\n { value: 'Nomination Form' }\n ]\n }]\n\n updateAppendixList (evt) {\n this.updateTotalUploadedPdf(evt)\n }\n\n created () {\n this.kycFormOid = this.$route.params.formOid\n }\n}\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--14-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UploadDocument.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--14-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UploadDocument.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./UploadDocument.vue?vue&type=template&id=bc20d326&scoped=true&\"\nimport script from \"./UploadDocument.vue?vue&type=script&lang=ts&\"\nexport * from \"./UploadDocument.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"bc20d326\",\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}