{"version":3,"sources":["webpack:///./src/views/kyc-form/section/about-you/DependantsView.vue?4abd","webpack:///./src/views/kyc-form/section/about-you/DependantsView.vue?d001","webpack:///./src/views/kyc-form/section/about-you/DependantsView.vue","webpack:///./src/views/kyc-form/section/about-you/DependantsView.vue?ee78","webpack:///./src/views/kyc-form/section/about-you/DependantsView.vue?1125"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","_v","attrs","depColumns","dependants","dependantsError","staticRenderFns","kycFormStore","errors","computedValidationResult","Dependants","Common","finalErrors","map","key","message","index","variableName","push","msg","kycForm","clientDeclaration","label","type","disabledFutureDate","model","get","dob","undefined","set","value","relationship","yearsSupport","disabled","options","RelationshipOptions","age","GenderOptions","onBlur","defaultYearsSupport","alert","tooltip","content","getContent","str","excludeKeys","Object","keys","yearSupportMap","forEach","includes","year","required","some","dependant","requiredDeviationExplanation","client1","recommendationBasis","productDeviationsExistence","State","components","AppFormTable","component"],"mappings":"gHAAA,W,gECAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACA,EAAG,MAAM,CAACE,YAAY,SAAS,CAACN,EAAIO,GAAG,gBAAgBH,EAAG,eAAe,CAACI,MAAM,CAAC,OAASR,EAAIS,WAAW,KAAOT,EAAIU,WAAW,OAASV,EAAIW,oBAAoB,IACtQC,EAAkB,G,wLCiBhBC,EAAe,eAAU,gBAQV,EAArB,+KAOE,WAAmB,QACXC,GAAS,UAAAb,KAAKc,gCAAL,mBAA+BC,kBAA/B,eAA2CC,SAAU,GAC9DC,EAAgD,GAUtD,OATAJ,EAAOK,KAAI,YAA4B,IAAzBC,EAAyB,EAAzBA,IAAKC,EAAoB,EAApBA,QAASC,EAAW,EAAXA,MAC1BF,EAAID,KAAI,SAAAI,GACDL,EAAYI,EAAQ,KAAIJ,EAAYI,EAAQ,GAAK,IACtDJ,EAAYI,EAAQ,GAAG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,GAAOuB,qBACjEC,MAAM,wDAGVC,QAAS,CACPC,QAAS/C,KAAKgD,kBA1FxB,wBAgGE,WAAU,WACJC,EAAM,GACJC,EAAc,CAAC,OAAQ,UAO7B,OANAC,OAAOC,KAAKpD,KAAKqD,gBAAgBC,SAAQ,SAAAnC,GACvC,IAAK+B,EAAYK,SAASpC,GAAM,CAC9B,IAAMiB,EAAe,EAAKiB,eAAelC,GACzC8B,GAAOb,EAAaT,MAAQ,YAAcS,EAAaoB,KAAO,aAG3DP,IAzGX,oCA4GE,WACE,IAAMQ,EAAWzD,KAAKS,WAAWiD,MAAK,SAAAC,GAAS,OAAIA,EAAUC,gCACzDH,IACFzD,KAAKyB,QAAQoC,QAAQC,oBAAoBC,2BAA6B,WA/G5E,GAA4C,QAE1C,gBADCnD,EAAaoD,O,8BAId,gBADCpD,EAAaoD,O,+CAJK,EAAc,gBANlC,eAAU,CACTC,WAAY,CACVC,eAAA,SAIiB,WC1B0a,I,wBCQ3bC,EAAY,eACd,EACArE,EACAa,GACA,EACA,KACA,WACA,MAIa,aAAAwD,E","file":"js/chunk-e4093eee.d7fc03c5.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!./DependantsView.vue?vue&type=style&index=0&id=24bd63a4&lang=scss&scoped=true&\"","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(\"Dependants\")]),_c('AppFormTable',{attrs:{\"fields\":_vm.depColumns,\"data\":_vm.dependants,\"errors\":_vm.dependantsError}})],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\nimport { Component, Vue } from 'vue-property-decorator'\nimport { namespace } from 'vuex-class'\nimport KYCForm from '@company-common/model/kyc-form/KYCForm'\nimport { TableFormStructure } from '@master/model/structure/FormStructure'\nimport { YearsSupportMap, CustomDependant } from '@company-common/model/kyc-form/CustomDependant'\nimport { RelationshipOptions } from '@master/model/options/RelationshipOptions'\nimport AppFormTable from '@core/components/AppFormTable.vue'\nimport { GenderOptions } from '@master/model/options/GenderOptions'\n\nconst kycFormStore = namespace('KYCFormStore')\n\n@Component({\n components: {\n AppFormTable\n }\n})\n\nexport default class DependantsView extends Vue {\n @kycFormStore.State\n private kycForm!: KYCForm\n\n @kycFormStore.State\n private computedValidationResult: any\n\n get dependantsError () {\n const errors = this.computedValidationResult?.Dependants?.Common || []\n const finalErrors: { key: string; msg: string }[][] = []\n errors.map(({ key, message, index }) => {\n key.map(variableName => {\n if (!finalErrors[index - 1]) finalErrors[index - 1] = []\n finalErrors[index - 1].push({\n key: variableName,\n msg: message\n })\n })\n })\n return finalErrors\n }\n\n get yearSupportMap () {\n return YearsSupportMap\n }\n\n get dependants () {\n return this.kycForm?.dependants ?? []\n }\n\n get clientDeclaration () {\n return this.kycForm.clientDeclaration\n }\n\n get depColumns (): TableFormStructure {\n return [\n { label: 'Name (as per NRIC/FIN/Passport No.)', key: 'name', type: 'text' },\n { label: 'NRIC/FIN/Passport No.', key: 'nric', type: 'text' },\n {\n label: 'Date of Birth (dd/mm/yyyy)',\n type: 'date',\n disabledFutureDate: true,\n model: {\n get: (index) => {\n return this.dependants[index]?.dob ?? undefined\n },\n set: (index, value) => {\n if (this.dependants[index].relationship) {\n this.dependants[index].yearsSupport = '' // reset year to support so that it can take the default value\n }\n\n this.dependants[index].dob = value\n }\n }\n },\n {\n label: 'Age',\n key: 'age',\n type: 'number',\n disabled: true\n },\n {\n label: 'Relationship to Client',\n type: 'dropdown',\n options: RelationshipOptions,\n model: {\n get: (index) => {\n return this.dependants[index]?.relationship ?? ''\n },\n set: (index, value) => {\n if (this.dependants[index].age !== 0 && !this.dependants[index].age) {\n this.dependants[index].relationship = value\n } else if (this.dependants[index].relationship !== value) {\n this.dependants[index].yearsSupport = '' // reset year to support so that it can take the default value\n }\n this.dependants[index].relationship = value\n }\n }\n },\n { label: 'Gender', key: 'gender', type: 'dropdown', options: GenderOptions },\n {\n label: 'Years to support',\n key: 'customYearsSupport',\n type: 'number',\n onBlur: (index) => {\n if (this.dependants[index].yearsSupport !== this.dependants[index].defaultYearsSupport) {\n alert('Please explain deviation on Basis of Recommendation')\n }\n },\n tooltip: {\n content: this.getContent()\n }\n }\n ]\n }\n\n getContent () {\n let str = ''\n const excludeKeys = ['male', 'female']\n Object.keys(this.yearSupportMap).forEach(key => {\n if (!excludeKeys.includes(key)) {\n const relationship = this.yearSupportMap[key]\n str += relationship.label + ': to Age ' + relationship.year + '
'\n }\n })\n return str\n }\n\n setIfDeviationRequired () {\n const required = this.dependants.some(dependant => dependant.requiredDeviationExplanation)\n if (required) {\n this.kycForm.client1.recommendationBasis.productDeviationsExistence = 'yes'\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!./DependantsView.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!./DependantsView.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./DependantsView.vue?vue&type=template&id=24bd63a4&scoped=true&\"\nimport script from \"./DependantsView.vue?vue&type=script&lang=ts&\"\nexport * from \"./DependantsView.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./DependantsView.vue?vue&type=style&index=0&id=24bd63a4&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 \"24bd63a4\",\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}