{"version":3,"sources":["webpack:///./src/views/bankaccounts/BankAccountCreateFund.vue?03b1","webpack:///./src/models/bankaccounts/BankAccountCreateFundRequestModel.ts","webpack:///./src/views/bankaccounts/BankAccountCreateFund.vue","webpack:///./src/views/bankaccounts/BankAccountCreateFund.vue?8fc0","webpack:///./src/views/bankaccounts/BankAccountCreateFund.vue?3dc4","webpack:///../../../src/components/VTextarea/VTextarea.ts"],"names":["render","_vm","this","_h","$createElement","_c","_self","attrs","staticClass","name","_v","params","bankAccountId","authorized","_e","ref","fundNameRules","model","value","callback","$$v","fundName","expression","notes","processing","on","saveClick","_l","e","index","key","_s","staticRenderFns","trim","length","funds","$store","state","selectedBankAccount","fundIdx","findIndex","x","toUpperCase","authorizedOperations","BankAccountOperations","CREATE_FUND","isFormValid","resetProcessingValues","request","api","BankAccountsApi","createFundAsync","member","jwt","$router","push","toString","handleProcessingErrorAsync","form","$refs","createFundForm","validate","ViewBase","default","required","component","VAlert","VBtn","VCard","VCardText","VCardTitle","VCol","VContainer","VForm","VIcon","VRow","VTextField","VTextarea","baseMixins","props","autoGrow","noResize","rowHeight","type","Number","validator","v","isNaN","parseFloat","rows","parseInt","computed","classes","noResizeHandle","watch","lazyValue","$nextTick","mounted","setTimeout","methods","calculateInputHeight","input","height","minHeight","Math","genInput","onInput","onKeyDown","isFocused"],"mappings":"gJAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,cAAc,CAACA,EAAG,QAAQ,CAACE,MAAM,CAAC,QAAU,WAAW,CAACF,EAAG,QAAQ,CAACE,MAAM,CAAC,KAAO,KAAK,GAAK,KAAK,GAAK,IAAI,GAAK,IAAI,GAAK,MAAM,CAACF,EAAG,cAAc,CAACG,YAAY,OAAOD,MAAM,CAAC,GAAK,CAACE,KAAM,wBAAwB,CAACR,EAAIS,GAAG,mBAAmBL,EAAG,SAAS,CAACE,MAAM,CA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KAAKyD,MAAnB,MACA,MAEA0C,EAAA,iBACA,IAAMC,EAASD,EAAf,aACME,EAAYb,SAASxF,KAAD,KAAR,IAA0BsF,WAAWtF,KANrC,WASlBmG,EAAA,aAAqBG,KAAA,SAArB,OAEFC,SAZO,WAaL,IAAMJ,EAAQ,qCAAd,MAMA,OAJAA,EAAA,sBACOA,EAAA,WAAP,KACAA,EAAA,gBAA0BnG,KAA1B,KAEA,GAEFwG,QArBO,SAqBA,GACL,4CACAxG,KAAA,UAAiBA,KAAjB,wBAEFyG,UAzBO,SAyBE,GAIHzG,KAAK0G,WAAT,KAAsBhF,EAAA,SACpBA,EAAA,kBAGF1B,KAAA","file":"js/chunk-0ef6e57c.6aec48ea.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-container',[_c('v-row',{attrs:{\"justify\":\"center\"}},[_c('v-col',{attrs:{\"cols\":\"12\",\"xs\":\"12\",\"sm\":\"9\",\"md\":\"9\",\"lg\":\"6\"}},[_c('router-link',{staticClass:\"mr-2\",attrs:{\"to\":{name: 'memberbankaccounts'}}},[_vm._v(\"Bank Accounts\")]),_c('v-icon',{attrs:{\"small\":\"\"}},[_vm._v(\"mdi-forward\")]),_c('router-link',{staticClass:\"ml-2\",attrs:{\"to\":{name: 'bankaccountdashboard', params:{bankAccountId: _vm.bankAccountId}}}},[_vm._v(\"Bank Account\")])],1)],1),_c('v-row',{attrs:{\"justify\":\"center\"}},[_c('v-col',{attrs:{\"cols\":\"12\",\"xs\":\"12\",\"sm\":\"9\",\"md\":\"9\",\"lg\":\"6\"}},[_c('v-card',[_c('v-card-title',{staticClass:\"headline justify-center\"},[_vm._v(\"CREATE FUND\")]),_c('v-card-text',{staticClass:\"mt-2 black--text\"},[(!_vm.authorized)?_c('div',{staticClass:\"text-center\"},[_c('v-alert',{attrs:{\"type\":\"error\",\"outlined\":\"\"}},[_vm._v(\"Creating a fund is not authorized.\")])],1):_vm._e(),(_vm.authorized)?_c('div',[_c('v-form',{ref:\"createFundForm\",staticClass:\"px-3\"},[_c('v-text-field',{staticClass:\"mb-3\",attrs:{\"label\":\"Fund Name\",\"maxlength\":\"50\",\"autofocus\":\"\",\"prepend-icon\":\"mdi-wallet\",\"rules\":[_vm.fundNameRules]},model:{value:(_vm.fundName),callback:function ($$v) {_vm.fundName=$$v},expression:\"fundName\"}}),_c('v-textarea',{staticClass:\"mb-3\",attrs:{\"label\":\"Notes\",\"maxlength\":\"256\",\"prepend-icon\":\"mdi-clipboard-text\"},model:{value:(_vm.notes),callback:function ($$v) {_vm.notes=$$v},expression:\"notes\"}}),_c('div',{staticClass:\"text-center\"},[_c('v-btn',{staticClass:\"primary\",attrs:{\"loading\":_vm.processing},on:{\"click\":_vm.saveClick}},[_vm._v(\"SAVE\")])],1),(_vm.processingError)?_c('div',{staticClass:\"text-center mt-4\"},_vm._l((_vm.processingErrors),function(e,index){return _c('div',{key:index},[_c('v-alert',{attrs:{\"value\":true,\"type\":\"error\",\"outlined\":\"\"}},[_vm._v(_vm._s(e))])],1)}),0):_vm._e()],1)],1):_vm._e()])],1)],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\nexport default class BankAccountCreateFundRequestModel {\r\n public fundName: string = '';\r\n public notes: string = '';\r\n}\r\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\r\nimport {Component, Prop, Vue} from 'vue-property-decorator';\r\nimport ViewBase from '@/views/ViewBase';\r\nimport {BankAccountOperations} from '@/enums/BankAccountOperations';\r\nimport BankAccountsApi from '@/apis/BankAccountsApi';\r\nimport BankAccountCreateFundRequestModel from '@/models/bankaccounts/BankAccountCreateFundRequestModel';\r\nimport BankAccountFundResponseModel from '../../models/bankaccounts/BankAccountFundResponseModel';\r\n\r\n@Component({\r\n name: 'BankAccountCreateFund',\r\n },\r\n)\r\nexport default class BankAccountCreateFund extends ViewBase {\r\n @Prop({default: 0, required: true})\r\n public bankAccountId!: number;\r\n\r\n public fundName: string = '';\r\n public notes: string = '';\r\n public authorized: boolean = false;\r\n\r\n public fundNameRules(value: string): any {\r\n if ( value.trim().length === 0)\r\n {\r\n return 'A fund name is required.';\r\n }\r\n else\r\n {\r\n const funds: BankAccountFundResponseModel[] = this.$store.state.selectedBankAccount.funds;\r\n\r\n const fundIdx: number = funds.findIndex((x: BankAccountFundResponseModel) => x.fundName.toUpperCase() === value.toUpperCase());\r\n\r\n if ( fundIdx > -1 )\r\n {\r\n return 'A fund with the same name already exists.';\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n public created() {\r\n if ( this.$store.state.selectedBankAccount.authorizedOperations & BankAccountOperations.CREATE_FUND )\r\n {\r\n this.authorized = true;\r\n }\r\n }\r\n\r\n public async saveClick() {\r\n\r\n if ( this.isFormValid() ) {\r\n try {\r\n this.resetProcessingValues();\r\n\r\n const request = new BankAccountCreateFundRequestModel();\r\n request.fundName = this.fundName;\r\n request.notes = this.notes;\r\n\r\n const api = new BankAccountsApi();\r\n const response = await api.createFundAsync(this.bankAccountId, this.$store.state.member.jwt, request);\r\n\r\n await this.$router.push({name: 'bankaccountdashboard', params: { bankAccountId: this.bankAccountId.toString(10)}});\r\n }\r\n catch ( err ) {\r\n await this.handleProcessingErrorAsync(err);\r\n }\r\n finally {\r\n this.processing = false;\r\n }\r\n }\r\n }\r\n\r\n private isFormValid(): boolean {\r\n const form: any = this.$refs.createFundForm;\r\n\r\n return form.validate();\r\n }\r\n\r\n}\r\n\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./BankAccountCreateFund.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./BankAccountCreateFund.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./BankAccountCreateFund.vue?vue&type=template&id=5900730c&\"\nimport script from \"./BankAccountCreateFund.vue?vue&type=script&lang=ts&\"\nexport * from \"./BankAccountCreateFund.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 null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VAlert } from 'vuetify/lib/components/VAlert';\nimport { VBtn } from 'vuetify/lib/components/VBtn';\nimport { VCard } from 'vuetify/lib/components/VCard';\nimport { VCardText } from 'vuetify/lib/components/VCard';\nimport { VCardTitle } from 'vuetify/lib/components/VCard';\nimport { VCol } from 'vuetify/lib/components/VGrid';\nimport { VContainer } from 'vuetify/lib/components/VGrid';\nimport { VForm } from 'vuetify/lib/components/VForm';\nimport { VIcon } from 'vuetify/lib/components/VIcon';\nimport { VRow } from 'vuetify/lib/components/VGrid';\nimport { VTextField } from 'vuetify/lib/components/VTextField';\nimport { VTextarea } from 'vuetify/lib/components/VTextarea';\ninstallComponents(component, {VAlert,VBtn,VCard,VCardText,VCardTitle,VCol,VContainer,VForm,VIcon,VRow,VTextField,VTextarea})\n","// Styles\nimport './VTextarea.sass'\n\n// Extensions\nimport VTextField from '../VTextField/VTextField'\n\n// Utilities\nimport mixins from '../../util/mixins'\n\n// Types\nimport Vue from 'vue'\n\ninterface options extends Vue {\n $refs: {\n input: HTMLTextAreaElement\n }\n}\n\nconst baseMixins = mixins\n>(\n VTextField\n)\n\n/* @vue/component */\nexport default baseMixins.extend({\n name: 'v-textarea',\n\n props: {\n autoGrow: Boolean,\n noResize: Boolean,\n rowHeight: {\n type: [Number, String],\n default: 24,\n validator: (v: any) => !isNaN(parseFloat(v)),\n },\n rows: {\n type: [Number, String],\n default: 5,\n validator: (v: any) => !isNaN(parseInt(v, 10)),\n },\n },\n\n computed: {\n classes (): object {\n return {\n 'v-textarea': true,\n 'v-textarea--auto-grow': this.autoGrow,\n 'v-textarea--no-resize': this.noResizeHandle,\n ...VTextField.options.computed.classes.call(this),\n }\n },\n noResizeHandle (): boolean {\n return this.noResize || this.autoGrow\n },\n },\n\n watch: {\n lazyValue () {\n this.autoGrow && this.$nextTick(this.calculateInputHeight)\n },\n rowHeight () {\n this.autoGrow && this.$nextTick(this.calculateInputHeight)\n },\n },\n\n mounted () {\n setTimeout(() => {\n this.autoGrow && this.calculateInputHeight()\n }, 0)\n },\n\n methods: {\n calculateInputHeight () {\n const input = this.$refs.input\n if (!input) return\n\n input.style.height = '0'\n const height = input.scrollHeight\n const minHeight = parseInt(this.rows, 10) * parseFloat(this.rowHeight)\n // This has to be done ASAP, waiting for Vue\n // to update the DOM causes ugly layout jumping\n input.style.height = Math.max(minHeight, height) + 'px'\n },\n genInput () {\n const input = VTextField.options.methods.genInput.call(this)\n\n input.tag = 'textarea'\n delete input.data!.attrs!.type\n input.data!.attrs!.rows = this.rows\n\n return input\n },\n onInput (e: Event) {\n VTextField.options.methods.onInput.call(this, e)\n this.autoGrow && this.calculateInputHeight()\n },\n onKeyDown (e: KeyboardEvent) {\n // Prevents closing of a\n // dialog when pressing\n // enter\n if (this.isFocused && e.keyCode === 13) {\n e.stopPropagation()\n }\n\n this.$emit('keydown', e)\n },\n },\n})\n"],"sourceRoot":""}