Files
firefly-iii/public/v2/js/dashboard.js

2 lines
283 KiB
JavaScript
Raw Normal View History

2021-05-08 21:26:50 +02:00
(self.webpackChunk=self.webpackChunk||[]).push([[663],{232:(t,e,a)=>{"use strict";a.r(e);var n=a(7760),i=a.n(n),r=a(7152),s=a(4605);window.$=window.jQuery=a(9755),window.axios=a(9669),window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";var o=document.head.querySelector('meta[name="csrf-token"]');o?window.axios.defaults.headers.common["X-CSRF-TOKEN"]=o.content:console.error("CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token");var c=document.head.querySelector('meta[name="locale"]');localStorage.locale=c?c.content:"en_US",a(6891),a(3734),a(7632),a(5432),window.vuei18n=r.Z,window.uiv=s,i().use(vuei18n),i().use(s),window.Vue=i()},9899:(t,e,a)=>{"use strict";a.d(e,{Z:()=>w});var n=a(7760),i=a.n(n),r=a(629),s=a(4478),o=a(3465);const c={namespaced:!0,state:function(){return{transactionType:"any",groupTitle:"",transactions:[],customDateFields:{interest_date:!1,book_date:!1,process_date:!1,due_date:!1,payment_date:!1,invoice_date:!1},defaultTransaction:(0,s.f$)(),defaultErrors:(0,s.kQ)()}},getters:{transactions:function(t){return t.transactions},defaultErrors:function(t){return t.defaultErrors},groupTitle:function(t){return t.groupTitle},transactionType:function(t){return t.transactionType},accountToTransaction:function(t){return t.accountToTransaction},defaultTransaction:function(t){return t.defaultTransaction},sourceAllowedTypes:function(t){return t.sourceAllowedTypes},destinationAllowedTypes:function(t){return t.destinationAllowedTypes},allowedOpposingTypes:function(t){return t.allowedOpposingTypes},customDateFields:function(t){return t.customDateFields}},actions:{},mutations:{addTransaction:function(t){var e=o(t.defaultTransaction);e.errors=o(t.defaultErrors),t.transactions.push(e)},resetErrors:function(t,e){t.transactions[e.index].errors=o(t.defaultErrors)},resetTransactions:function(t){t.transactions=[]},setGroupTitle:function(t,e){t.groupTitle=e.groupTitle},setCustomDateFields:function(t,e){t.customDateFields=e},deleteTransaction:function(t,e){t.transactions.splice(e.index,1),t.transactions.length},setTransactionType:function(t,e){t.transactionType=e},setAllowedOpposingTypes:function(t,e){t.allowedOpposingTypes=e},setAccountToTransaction:function(t,e){t.accountToTransaction=e},updateField:function(t,e){t.transactions[e.index][e.field]=e.value},setTransactionError:function(t,e){t.transactions[e.index].errors[e.field]=e.errors},setDestinationAllowedTypes:function(t,e){t.destinationAllowedTypes=e},setSourceAllowedTypes:function(t,e){t.sourceAllowedTypes=e}}};var l=a(9119),_=a(3894),d=a(584),u=a(7090),p=a(4431),y=a(8358),g=a(4135),h=a(3703);const m={namespaced:!0,state:function(){return{viewRange:"default",start:null,end:null,defaultStart:null,defaultEnd:null}},getters:{start:function(t){return t.start},end:function(t){return t.end},defaultStart:function(t){return t.defaultStart},defaultEnd:function(t){return t.defaultEnd},viewRange:function(t){return t.viewRange}},actions:{initialiseStore:function(t){t.dispatch("restoreViewRange"),axios.get("./api/v1/preferences/viewRange").then((function(e){var a=e.data.data.attributes.data,n=t.getters.viewRange;t.commit("setViewRange",a),a!==n&&t.dispatch("setDatesFromViewRange"),a===n&&t.dispatch("restoreViewRangeDates")})).catch((function(){t.commit("setViewRange","1M"),t.dispatch("setDatesFromViewRange")}))},restoreViewRangeDates:function(t){localStorage.viewRangeStart&&t.commit("setStart",new Date(localStorage.viewRangeStart)),localStorage.viewRangeEnd&&t.commit("setEnd",new Date(localStorage.viewRangeEnd)),localStorage.viewRangeDefaultStart&&t.commit("setDefaultStart",new Date(localStorage.viewRangeDefaultStart)),localStorage.viewRangeDefaultEnd&&t.commit("setDefaultEnd",new Date(localStorage.viewRangeDefaultEnd))},restoreViewRange:function(t){var e=localStorage.getItem("viewRange");null!==e&&t.commit("setViewRange",e)},setDatesFromViewRange:function(t){var e,a,n=t.getters.viewRange,i=new Date;switch(n){case"1D":e=(0,l.Z)(i),a=(0,_.Z)(i);break;case"1W":e=(0,l.Z)((0,d.Z)(i,{weekStartsOn:1})),a=(0,_.Z)((0,u.Z)(i,{weekStartsOn:1}));break;case"1M"