Skip to content

Open source personal finance application

refactor: new eslint syntax

ilkomedcb44f75f3f1
diff --git a/assets/js/colors.js b/assets/js/colors.js
index 1a0595c9..0636cd6b 100644
--- a/assets/js/colors.js
+++ b/assets/js/colors.js
@@ -190,5 +190,5 @@ export default [
'#37474f',
'#263238',
'#ffffff',
- '#000000'
+ '#000000',
]
diff --git a/assets/js/colorsPopular.js b/assets/js/colorsPopular.js
index 4cc79206..a983d86f 100644
--- a/assets/js/colorsPopular.js
+++ b/assets/js/colorsPopular.js
@@ -29,7 +29,7 @@ export const popularColors = [
'#fb8c00',
'#fdd835',
'#ff8a65',
- '#ffc107'
+ '#ffc107',
]
export const allColors = [
@@ -182,5 +182,5 @@ export const allColors = [
'#78909c',
'#607d8b',
'#546e7a',
- '#455a64'
+ '#455a64',
]
diff --git a/assets/js/emo.js b/assets/js/emo.js
index 2ecaf37b..e5b9a701 100755
--- a/assets/js/emo.js
+++ b/assets/js/emo.js
@@ -2,7 +2,7 @@ const successEmo = ['🤟', '🤘', '🤙', '👌', '👍', '💪', '👏', '
const errorEmo = ['🤷‍♀️', '🤦‍♀️', '🤔', '😲']
const updateEmo = ['🤟', '💃', '✨', '🔥', '💥', '🎉', '🤘', '🤙']
-function random (icons) {
+function random(icons) {
return icons[Math.floor(Math.random() * icons.length)]
}
@@ -10,5 +10,5 @@ export {
successEmo,
errorEmo,
updateEmo,
- random
+ random,
}
diff --git a/assets/js/icons.js b/assets/js/icons.js
index d2711d07..83d9af3f 100644
--- a/assets/js/icons.js
+++ b/assets/js/icons.js
@@ -21,7 +21,7 @@ export default [
'mdi mdi-egg',
'mdi mdi-egg-outline',
'mdi mdi-baguette',
- 'mdi mdi-mushroom'
+ 'mdi mdi-mushroom',
], [
'mdi mdi-dump-truck',
'mdi mdi-car-sports',
@@ -40,7 +40,7 @@ export default [
'mdi mdi-vlc',
'mdi mdi-road-variant',
'mdi mdi-gas-station',
- 'mdi mdi-gauge-full'
+ 'mdi mdi-gauge-full',
], [
'mdi mdi-airplane',
'mdi mdi-rocket',
@@ -51,7 +51,7 @@ export default [
'mdi mdi-cloud',
'mdi mdi-sail-boat',
'mdi mdi-map-search',
- 'mdi mdi-ferris-wheel'
+ 'mdi mdi-ferris-wheel',
], [
'mdi mdi-bike',
'mdi mdi-scooter',
@@ -76,7 +76,7 @@ export default [
'mdi mdi-soccer',
'mdi mdi-diving-helmet',
'mdi mdi-diving-flippers',
- 'mdi mdi-diving-snorkel'
+ 'mdi mdi-diving-snorkel',
], [
'mdi mdi-shape',
'mdi mdi-telescope',
@@ -93,7 +93,7 @@ export default [
'mdi mdi-music-clef-treble',
'mdi mdi-music',
'mdi mdi-theater',
- 'mdi mdi-movie-roll'
+ 'mdi mdi-movie-roll',
], [
'mdi mdi-palm-tree',
'mdi mdi-island',
@@ -103,7 +103,7 @@ export default [
'mdi mdi-leaf',
'mdi mdi-clover',
'mdi mdi-flower-tulip-outline',
- 'mdi mdi-flower'
+ 'mdi mdi-flower',
], [
// animals
'mdi mdi-space-invaders',
@@ -120,7 +120,7 @@ export default [
'mdi mdi-language-swift',
'mdi mdi-bat',
'mdi mdi-paw',
- 'mdi mdi-gnome'
+ 'mdi mdi-gnome',
], [
// people
'mdi mdi-account-tie',
@@ -135,7 +135,7 @@ export default [
'mdi mdi-emoticon-happy-outline',
'mdi mdi-drama-masks',
'mdi mdi-guy-fawkes-mask',
- 'mdi mdi-gender-female'
+ 'mdi mdi-gender-female',
], [
// medicine
'mdi mdi-emoticon-poop',
@@ -148,7 +148,7 @@ export default [
'mdi mdi-tooth-outline',
'mdi mdi-hospital',
'mdi mdi-pill',
- 'mdi mdi-folder-heart-outline'
+ 'mdi mdi-folder-heart-outline',
], [
// home
'mdi mdi-home-heart',
@@ -173,7 +173,7 @@ export default [
'mdi mdi-wind-turbine',
'mdi mdi-spray',
'mdi mdi-air-filter',
- 'mdi mdi-waves'
+ 'mdi mdi-waves',
], [
// staf
'mdi mdi-gift',
@@ -210,7 +210,7 @@ export default [
'mdi mdi-format-paint',
'mdi mdi-magnify-close',
'mdi mdi-basket-fill',
- 'mdi mdi-metronome'
+ 'mdi mdi-metronome',
], [
'mdi mdi-folder-star',
'mdi mdi-chart-donut',
@@ -227,7 +227,7 @@ export default [
'mdi mdi-cash-multiple',
'mdi mdi-cash-100',
'mdi mdi-repeat',
- 'mdi mdi-bank'
+ 'mdi mdi-bank',
], [
'mdi mdi-auto-fix',
'mdi mdi-wifi',
@@ -247,7 +247,7 @@ export default [
'mdi mdi-minecraft',
'mdi mdi-web',
'mdi mdi-disqus',
- 'mdi mdi-white-balance-auto'
+ 'mdi mdi-white-balance-auto',
], [
// rotate
'mdi mdi-bullseye',
@@ -262,7 +262,7 @@ export default [
'mdi mdi-vector-difference-ab',
'mdi mdi-alpha-i-circle-outline',
'mdi mdi-alpha-m-circle-outline',
- 'mdi mdi-all-inclusive'
+ 'mdi mdi-all-inclusive',
], [
'mdi mdi-clippy',
'mdi mdi-attachment',
@@ -278,6 +278,6 @@ export default [
'mdi mdi-script',
'mdi mdi-dev-to',
'mdi mdi-code-not-equal-variant',
- 'mdi mdi-code-braces'
- ]
+ 'mdi mdi-code-braces',
+ ],
]
diff --git a/assets/js/isTouchDevice.js b/assets/js/isTouchDevice.js
index ddc6bd5e..c855f5b2 100644
--- a/assets/js/isTouchDevice.js
+++ b/assets/js/isTouchDevice.js
@@ -1,8 +1,8 @@
-export default function isTouchDevice () {
+export default function isTouchDevice() {
if (
- ('ontouchstart' in window) ||
- (window.DocumentTouch && document instanceof DocumentTouch)) {
+ ('ontouchstart' in window)
+ || (window.DocumentTouch && document instanceof DocumentTouch))
return true
- }
+
return false
}
diff --git a/components/about/About.vue b/components/about/About.vue
index bcadf664..0273c30f 100644
--- a/components/about/About.vue
+++ b/components/about/About.vue
@@ -31,16 +31,16 @@ div
<i18n lang="json5">
{
- en: {
- title: 'Creators',
- author: 'Author',
- thanks: 'Thanks for support'
+ "en": {
+ "title": "Creators",
+ "author": "Author",
+ "thanks": "Thanks for support"
},
- ru: {
- title: 'Создатели',
- author: 'Автор',
- thanks: 'Спасибо за поддержку'
+ "ru": {
+ "title": "Создатели",
+ "author": "Автор",
+ "thanks": "Спасибо за поддержку"
}
}
</i18n>
diff --git a/components/amount/Amount.vue b/components/amount/Amount.vue
index 0aa9eded..b484ae0e 100644
--- a/components/amount/Amount.vue
+++ b/components/amount/Amount.vue
@@ -18,35 +18,35 @@ export default {
size: { type: String, default: null },
type: { type: Number, default: null },
value: { type: Number, required: true },
- vertical: { type: String, default: null }
+ vertical: { type: String, default: null },
},
- setup () {
+ setup() {
const { getAmountInBaseCurrency } = useAmount()
return { getAmountInBaseCurrency }
},
computed: {
- className () {
+ className() {
return {
_altColor: this.isAltColor,
_expenses: this.isColorize && this.type === 0,
_incomes: this.isColorize && this.type === 1,
[`_${this.vertical}`]: this.vertical,
- [`_size_${this.size}`]: this.size
+ [`_size_${this.size}`]: this.size,
}
},
- amountInBaseCurrency () {
+ amountInBaseCurrency() {
return this.getAmountInBaseCurrency({
amount: this.value,
- currency: this.currency
+ currency: this.currency,
})
- }
+ },
},
methods: {
- getCurrencySymbol (currency) {
+ getCurrencySymbol(currency) {
switch (currency) {
case 'USD':
return '$'
@@ -63,10 +63,10 @@ export default {
}
},
- formatAmount (amount) {
+ formatAmount(amount) {
return baseAmountFormat(amount, ' ')
- }
- }
+ },
+ },
}
</script>
diff --git a/components/amount/Amount2.vue b/components/amount/Amount2.vue
index 5fc0135c..ea12751b 100644
--- a/components/amount/Amount2.vue
+++ b/components/amount/Amount2.vue
@@ -6,10 +6,10 @@ export default defineComponent({
amount: { type: Number, required: true },
currency: { type: String, required: true },
colorize: { type: String, default: 'none' },
- type: { type: Number, default: null }
+ type: { type: Number, default: null },
},
- setup ({ type }) {
+ setup({ type }) {
const { baseCurrency, formatAmount, getCurrencySymbol, getAmountInBaseCurrency } = useAmount()
const sign = type === 0 ? '-' : '+'
@@ -19,9 +19,9 @@ export default defineComponent({
getCurrencySymbol,
getAmountInBaseCurrency,
- formatAmount
+ formatAmount,
}
- }
+ },
})
</script>
diff --git a/components/amount/useAmount.ts b/components/amount/useAmount.ts
index 098c2f86..ae944bf6 100644
--- a/components/amount/useAmount.ts
+++ b/components/amount/useAmount.ts
@@ -1,6 +1,6 @@
import currency from 'currency.js'
-function getCurrencySymbol (currency) {
+function getCurrencySymbol(currency) {
switch (currency) {
case 'USD':
return '$'
@@ -22,13 +22,13 @@ const formatAmount = (value, separator = ' ') =>
symbol: '',
precision: 0,
pattern: '#',
- separator
+ separator,
}).format()
-export default function useAmount () {
+export default function useAmount() {
const { $store } = useNuxtApp()
- function getAmountInBaseCurrency ({ amount, currency, noFormat }) {
+ function getAmountInBaseCurrency({ amount, currency, noFormat }) {
const fixed = $store.state.currencies.base === 'RUB' ? 0 : 2
const baseValue = (amount / $store.state.currencies.rates[currency]).toFixed(fixed)
if (!baseValue) return
@@ -43,6 +43,6 @@ export default function useAmount () {
formatAmount,
getCurrencySymbol,
- getAmountInBaseCurrency
+ getAmountInBaseCurrency,
}
}
diff --git a/components/analytics/Analytics.vue b/components/analytics/Analytics.vue
index a0511053..77c4bf6b 100644
--- a/components/analytics/Analytics.vue
+++ b/components/analytics/Analytics.vue
@@ -5,19 +5,19 @@ export default {
props: {
showCategoriesCharts: {
type: Boolean,
- default: true
+ default: true,
},
showInside: {
type: Boolean,
- default: false
- }
+ default: false,
+ },
},
computed: {
- statCurrentPeriod () {
+ statCurrentPeriod() {
return this.$store.getters['stat/statCurrentPeriod']
- }
- }
+ },
+ },
}
</script>
diff --git a/components/analytics/AnalyticsChart.vue b/components/analytics/AnalyticsChart.vue
index f7fa1794..e96e042f 100644
--- a/components/analytics/AnalyticsChart.vue
+++ b/components/analytics/AnalyticsChart.vue
@@ -9,50 +9,50 @@ export default {
name: 'AnalyticsChart',
components: {
- Chart
+ Chart,
},
props: {
categoryId: {
type: String,
- required: true
+ required: true,
},
chartType: {
type: String,
- default: 'column'
- }
+ default: 'column',
+ },
},
- data () {
+ data() {
return {
average: 0,
total: 0,
date: this.$day().valueOf(),
visiblePeriodMenu: false,
dateStart: null,
- dateEnd: null
+ dateEnd: null,
}
},
computed: {
- showedPeriods () {
+ showedPeriods() {
return this.$store.state.stat.showedPeriods
},
- statCurrentPeriod () {
+ statCurrentPeriod() {
return this.$store.getters['stat/statCurrentPeriod']
},
- filterDate () {
+ filterDate() {
return this.$store.state.filter.date
},
- periodName () {
+ periodName() {
return this.$store.state.filter.period
},
- chartData () {
+ chartData() {
const vm = this
const trns = this.$store.state.trns.items
const periodName = this.periodName
@@ -66,10 +66,10 @@ export default {
const categoryData = []
let format = 'MMM'
- if (periodName === 'day') { format = 'D.MM' }
- if (periodName === 'week') { format = 'D.MM' }
- if (periodName === 'month') { format = 'MMMM' }
- if (periodName === 'year') { format = 'YYYY' }
+ if (periodName === 'day') format = 'D.MM'
+ if (periodName === 'week') format = 'D.MM'
+ if (periodName === 'month') format = 'MMMM'
+ if (periodName === 'year') format = 'YYYY'
for (let index = 0; index < periodsToShow; index++) {
// count total period
@@ -78,7 +78,7 @@ export default {
const trnsIds = this.$store.getters['trns/getTrns']({
categoryId: this.categoryId,
date: periodDate,
- periodName
+ periodName,
})
const periodTotal = this.$store.getters['trns/getTotalOfTrnsIds'](trnsIds)
@@ -89,8 +89,8 @@ export default {
color: 'var(--c-font-1)',
marker: {
radius: 6,
- enabled: this.$day(periodDate).isSame(this.$store.state.filter.date, periodName)
- }
+ enabled: this.$day(periodDate).isSame(this.$store.state.filter.date, periodName),
+ },
})
categories.unshift(name)
}
@@ -111,9 +111,9 @@ export default {
series: [{
visible: true,
type: this.chartType,
- data: categoryData
+ data: categoryData,
}],
- categories
+ categories,
}
return {
@@ -123,16 +123,16 @@ export default {
shared: true,
animation: false,
outside: true,
- positioner () {
+ positioner() {
return { x: -1000, y: -1000 }
- }
+ },
},
series: data.series,
xAxis: {
...chartOptions.xAxis,
- categories: data.categories
+ categories: data.categories,
},
yAxis: {
@@ -142,8 +142,8 @@ export default {
value: this.average, // Insert your average here
width: '2',
height: 160,
- zIndex: 1
- }]
+ zIndex: 1,
+ }],
},
chart: {
@@ -151,11 +151,11 @@ export default {
height: '120',
events: {
- click (e) {
+ click(e) {
const value = this.series[0].searchPoint(e, true) || this.series[1].searchPoint(e, true)
vm.$store.dispatch('filter/setDate', parseInt(value.date))
- }
- }
+ },
+ },
},
plotOptions: {
@@ -164,35 +164,35 @@ export default {
...chartOptions.plotOptions.series,
dataLabels: {
...chartOptions.plotOptions.series.dataLabels,
- enabled: true
+ enabled: true,
},
cursor: 'pointer',
point: {
events: {
- click () {
+ click() {
vm.$store.dispatch('filter/setDate', parseInt(this.date))
- }
- }
+ },
+ },
},
allowPointSelect: true,
states: {
select: {
color: 'green',
- backgroundColor: 'var(--c-bg-14)'
- }
- }
- }
- }
+ backgroundColor: 'var(--c-bg-14)',
+ },
+ },
+ },
+ },
}
- }
+ },
},
methods: {
- formatAmount (amount) {
+ formatAmount(amount) {
const fixed = this.$store.state.currencies.base === 'RUB' ? 0 : 2
return baseAmountFormat(amount, ' ', fixed)
- }
- }
+ },
+ },
}
</script>
diff --git a/components/analytics/AnalyticsChartTrns.vue b/components/analytics/AnalyticsChartTrns.vue
index ce7bc83f..492fef0d 100644
--- a/components/analytics/AnalyticsChartTrns.vue
+++ b/components/analytics/AnalyticsChartTrns.vue
@@ -9,22 +9,22 @@ export default {
name: 'AnalyticsChartTrns',
components: {
- Chart
+ Chart,
},
props: {
periodName: {
type: String,
- default: 'month'
+ default: 'month',
},
isShowSummury: {
type: Boolean,
- default: true
- }
+ default: true,
+ },
},
- data () {
+ data() {
return {
biggest: 0,
average: 0,
@@ -35,61 +35,61 @@ export default {
chartOptions: {
...chartOptions,
legend: false,
- tooltip: false
- }
+ tooltip: false,
+ },
}
},
computed: {
- periods () {
+ periods() {
return this.$store.state.chart.periods
},
- statCurrentPeriod () {
+ statCurrentPeriod() {
return this.$store.getters['stat/statCurrentPeriod']
},
- statAverage () {
+ statAverage() {
return this.$store.getters['stat/statAverage']
},
- filterDate () {
+ filterDate() {
return this.$store.state.filter.date
},
- filterCategory () {
+ filterCategory() {
return this.$store.state.filter.categoryId
},
- filterWallet () {
+ filterWallet() {
return this.$store.state.filter.walletId
- }
+ },
},
watch: {
- showedPeriods () {
+ showedPeriods() {
this.init()
},
- filterDate () {
+ filterDate() {
this.init()
},
- filterCategory () {
+ filterCategory() {
this.init()
},
- filterWallet () {
+ filterWallet() {
this.init()
},
- periods () {
+ periods() {
this.init()
- }
+ },
},
- mounted () {
+ mounted() {
this.init()
},
methods: {
- init () {
+ init() {
const data = this.generateData(this.periodName)
const handlePerioSelect = (date) => {
this.$store.dispatch('filter/setPeriod', this.periodName)
@@ -101,18 +101,18 @@ export default {
cursor: 'pointer',
point: {
events: {
- click () {
+ click() {
handlePerioSelect(this.date)
- }
- }
- }
+ },
+ },
+ },
}
this.chartOptions = {
...this.chartOptions,
tooltip: false,
xAxis: {
- categories: data.categories
+ categories: data.categories,
},
yAxis: {
@@ -120,8 +120,8 @@ export default {
color: 'var(--c-bg-8)',
value: this.average, // Insert your average here
width: '2',
- zIndex: 1
- }]
+ zIndex: 1,
+ }],
},
chart: {
@@ -134,28 +134,28 @@ export default {
panKey: 'shift',
events: {
- click (e) {
+ click(e) {
// console.log(this.series[0].searchPoint(e, true))
- }
- }
- }
+ },
+ },
+ },
}
},
- formatAmount (amount) {
+ formatAmount(amount) {
const fixed = this.$store.state.currencies.base === 'RUB' ? 0 : 2
return baseAmountFormat(amount, ' ', fixed)
},
- generateData (periodName, oldSeries) {
+ generateData(periodName, oldSeries) {
const categories = []
const incomesData = []
let format = 'MM'
- if (periodName === 'day') { format = 'D.MM' }
- if (periodName === 'week') { format = 'D.MM' }
- if (periodName === 'month') { format = 'MMM' }
- if (periodName === 'year') { format = 'YYYY' }
+ if (periodName === 'day') format = 'D.MM'
+ if (periodName === 'week') format = 'D.MM'
+ if (periodName === 'month') format = 'MMM'
+ if (periodName === 'year') format = 'YYYY'
for (let index = 0; index < this.$store.state.chart.periods[periodName].showedPeriods; index++) {
// count total period
@@ -163,14 +163,13 @@ export default {
const name = this.$day(periodDate).startOf(periodName).format(format)
const trnsIds = this.$store.getters['trns/getTrns']({
date: periodDate,
- periodName
+ periodName,
})
const periodTotal = this.$store.getters['trns/getTotalOfTrnsIds'](trnsIds)
let amount = Math.floor(Number(`${periodTotal.incomes.toFixed() - periodTotal.expenses.toFixed()}`))
- if (!this.statAverage.total) {
+ if (!this.statAverage.total)
amount = Math.abs(Number(`${periodTotal.incomes.toFixed() - periodTotal.expenses.toFixed()}`))
- }
// return
incomesData.unshift({
@@ -193,29 +192,27 @@ export default {
if (iterator.y !== 0) {
periods = periods + 1
periodsTotal = periodsTotal + iterator.y
- if (iterator.y > biggest) {
+ if (iterator.y > biggest)
biggest = iterator.y
- }
}
}
this.biggest = biggest
let amountAverage = Math.floor(Number(periodsTotal / periods).toFixed())
- if (this.statAverage.total !== 0) {
+ if (this.statAverage.total !== 0)
amountAverage = Math.abs(Number(periodsTotal / periods).toFixed())
- }
+
this.average = amountAverage
let color = 'var(--c-blue-1)'
if (this.statAverage.total === 0) {
- if (this.statAverage.incomes > 0) {
+ if (this.statAverage.incomes > 0)
color = 'var(--c-incomes-1)'
- }
- else if (this.statAverage.expenses > 0) {
+
+ else if (this.statAverage.expenses > 0)
color = 'var(--c-expenses-1)'
- }
}
return {
@@ -229,13 +226,13 @@ export default {
fillColor: 'var(--c-bg-4)',
lineWidth: 2,
lineColor: 'var(--c-blue-1)',
- symbol: 'circle'
- }
+ symbol: 'circle',
+ },
}],
- categories
+ categories,
}
- }
- }
+ },
+ },
}
</script>
diff --git a/components/app/UpdateAppModal.vue b/components/app/UpdateAppModal.vue
index a052661e..c12076af 100644
--- a/components/app/UpdateAppModal.vue
+++ b/components/app/UpdateAppModal.vue
@@ -1,15 +1,15 @@
<script>
-import { updateEmo, random } from '~/assets/js/emo'
+import { random, updateEmo } from '~/assets/js/emo'
export default {
name: 'AppUpdateAppModal',
- setup () {
+ setup() {
const emo = computed(() => random(updateEmo))
return {
- emo
+ emo,
}
- }
+ },
}
</script>
@@ -49,16 +49,16 @@ TrnFormModal(@closed="$emit('onClose')")
<i18n lang="json5">
{
- en: {
- title: 'New version available',
- text: 'Reload the app to use new futures.',
- button: 'Wow, great!'
+ "en": {
+ "title": "New version available",
+ "text": "Reload the app to use new futures.",
+ "button": "Wow, great!"
},
- ru: {
- title: 'Доступа новая версия',
- text: 'Перезагрузи приложение, чтобы использовать все новые фишки.',
- button: 'Оки, Ура!'
+ "ru": {
+ "title": "Доступа новая версия",
+ "text": "Перезагрузи приложение, чтобы использовать все новые фишки.",
+ "button": "Оки, Ура!"
}
}
</i18n>
diff --git a/components/base/BottomSheet.vue b/components/base/BottomSheet.vue
index 15ae8c14..7c00661c 100644
--- a/components/base/BottomSheet.vue
+++ b/components/base/BottomSheet.vue
@@ -5,14 +5,14 @@ export default defineComponent({
props: {
keepAlive: { type: Boolean, default: false },
show: { type: Boolean, default: false },
- maxHeight: { type: Number, default: null }
+ maxHeight: { type: Number, default: null },
},
- setup (props, { emit }) {
+ setup(props, { emit }) {
// settings
const settings = {
moveToCloseOffset: 60,
- debounceOffset: 20
+ debounceOffset: 20,
}
// elements
@@ -37,7 +37,7 @@ export default defineComponent({
direction: computed(() => direction.value),
diffHeight: computed(() => diffHeight.value),
diffHeightWithDebounce: computed(() => diffHeightWithDebounce.value),
- nextCurrentY: computed(() => nextCurrentY.value)
+ nextCurrentY: computed(() => nextCurrentY.value),
})
const maxHeightScroll = computed(() => {
@@ -63,13 +63,13 @@ export default defineComponent({
const drugStyles = computed(() => {
if (nextCurrentY.value <= debounce.value) {
return {
- opacity: 1
+ opacity: 1,
}
}
return {
transform: `translateX(-50%) translateY(${nextCurrentY.value - debounce.value}px)`,
- ...overlayStyles.value
+ ...overlayStyles.value,
}
})
@@ -108,19 +108,19 @@ export default defineComponent({
? 1
: diffHeightWithDebounce.value >= 10
? `0.${diffHeightWithDebounce.value}`
- : `0.0${diffHeightWithDebounce.value}`
+ : `0.0${diffHeightWithDebounce.value}`,
)
}
return {
- opacity
+ opacity,
}
})
/**
* Get client Y
*/
- function getClientY (event): number {
+ function getClientY(event): number {
return event.type.includes('touch')
? Math.round(event.touches[0].clientY)
: event.clientY
@@ -129,7 +129,7 @@ export default defineComponent({
/**
* Content has scroll
*/
- function contentHasScroll (event): boolean {
+ function contentHasScroll(event): boolean {
// Handle scroll inside slider
const swiperSlideActive = drug.value?.querySelector('.swiper-slide-active')
if (swiperSlideActive) {
@@ -146,7 +146,7 @@ export default defineComponent({
/**
* Drag start
*/
- function onDragStart (event): void {
+ function onDragStart(event): void {
if (disabled.value)
return
@@ -167,7 +167,7 @@ export default defineComponent({
/**
* Dragging
*/
- function onDragging (event): void {
+ function onDragging(event): void {
if (disabled.value)
return
@@ -195,7 +195,7 @@ export default defineComponent({
/**
* Drag end
*/
- function onDragEnd (): void {
+ function onDragEnd(): void {
if (disabled.value || !isDraging.value)
return
@@ -207,7 +207,7 @@ export default defineComponent({
/**
* Clear
*/
- function clear () {
+ function clear() {
clientY.value = 0
isDraging.value = false
}
@@ -215,7 +215,7 @@ export default defineComponent({
/**
* Close modal
*/
- function close () {
+ function close() {
clear()
initialY.value = -(drug.value.clientHeight + handler.value.clientHeight)
}
@@ -223,7 +223,7 @@ export default defineComponent({
/**
* Open modal
*/
- function open () {
+ function open() {
clear()
opened.value = true
initialY.value = 0
@@ -232,7 +232,7 @@ export default defineComponent({
/**
* Scroll up all scroller blocks
*/
- function scrollUpAllScrollers () {
+ function scrollUpAllScrollers() {
const scrollerBlocks = drug.value?.querySelectorAll('.scrollerBlock')
if (scrollerBlocks) {
scrollerBlocks.forEach((el) => {
@@ -244,7 +244,7 @@ export default defineComponent({
/**
* On close modal
*/
- function onClose () {
+ function onClose() {
scrollUpAllScrollers()
drug.value.removeEventListener('transitionend', onClose)
opened.value = false
@@ -254,7 +254,7 @@ export default defineComponent({
/**
* Add events listeners
*/
- function addEvents () {
+ function addEvents() {
isEventsInited.value = true
// Touch
@@ -274,7 +274,7 @@ export default defineComponent({
/**
* Init modal
*/
- async function init () {
+ async function init() {
await nextTick()
initialY.value = -(drug.value.clientHeight + handler.value.clientHeight)
disabled.value = false
@@ -314,7 +314,7 @@ export default defineComponent({
/**
* Run init when mounted or show changed
*/
- watch(() => props.show, async () => {
+ watch(() => props.show, async() => {
if (!props.keepAlive || (props.keepAlive && props.show))
await init()
@@ -335,9 +335,9 @@ export default defineComponent({
close,
overlayStyles,
drugStyles,
- maxHeightScroll
+ maxHeightScroll,
}
- }
+ },
})
</script>
diff --git a/components/base/BottomSheetClose.vue b/components/base/BottomSheetClose.vue
index c193234f..269d3f33 100644
--- a/components/base/BottomSheetClose.vue
+++ b/components/base/BottomSheetClose.vue
@@ -1,6 +1,6 @@
<script>
export default {
- name: 'BaseBottomSheetClose'
+ name: 'BaseBottomSheetClose',
}
</script>
diff --git a/components/base/modal/useTouchClose.ts b/components/base/modal/useTouchClose.ts
index f712af92..7a77662c 100644
--- a/components/base/modal/useTouchClose.ts
+++ b/components/base/modal/useTouchClose.ts
@@ -1,4 +1,4 @@
-export default function useOnTouch () {
+export default function useOnTouch() {
let isDragging = true
let isDrugByHandler = false
let initialY = 0
@@ -9,7 +9,7 @@ export default function useOnTouch () {
whaitForScrollClassName: 'waitForScroll',
whaitForScrollSliderClassName: 'waitForScrollSlider',
doNotTouchClassName: 'doNotCloseModal',
- animClassName: '_anim'
+ animClassName: '_anim',
}
let container: (null | any) = null
@@ -24,7 +24,7 @@ export default function useOnTouch () {
* Init
* @param props
*/
- function initTouchModal (props: any): void {
+ function initTouchModal(props: any): void {
container = props.container
overflow = props.overflow
wrap = props.wrap
@@ -35,7 +35,7 @@ export default function useOnTouch () {
if (props.config) {
config = {
...config,
- ...props.config.value
+ ...props.config.value,
}
}
@@ -52,7 +52,7 @@ export default function useOnTouch () {
/**
* Translate
*/
- function setTranslate (): void {
+ function setTranslate(): void {
if (!wrap.value) return
const offset = isDrugByHandler ? 0 : config.dragOffset
@@ -78,7 +78,7 @@ export default function useOnTouch () {
* Drag start handler
* @param event
*/
- function onDragStart (event: any): void {
+ function onDragStart(event: any): void {
isDragging = false
wrap.value.classList.remove(config.animClassName)
@@ -125,7 +125,7 @@ export default function useOnTouch () {
* Dragging handler
* @param event
*/
- function onDragging (event: any): void {
+ function onDragging(event: any): void {
if (isDragging) {
event.type === 'touchmove'
? currentY = event.touches[0].clientY - initialY
@@ -138,7 +138,7 @@ export default function useOnTouch () {
/**
* Drag end handler
*/
- function onDragEnd (): void {
+ function onDragEnd(): void {
if (currentY >= 80) {
closeModal()
}
@@ -152,7 +152,7 @@ export default function useOnTouch () {
/**
* Transition end handler
*/
- function onTransitionEnd (): void {
+ function onTransitionEnd(): void {
wrap.value.removeEventListener('transitionend', onTransitionEnd)
currentY = 0
wrap.value.style.transform = ''
@@ -164,7 +164,7 @@ export default function useOnTouch () {
/**
* Clode modal
*/
- function closeModal (): void {
+ function closeModal(): void {
isDragging = false
isDrugByHandler = false
@@ -205,6 +205,6 @@ export default function useOnTouch () {
return {
initTouchModal,
- closeModal
+ closeModal,
}
}
diff --git a/components/categories/EditModal.vue b/components/categories/EditModal.vue
index 2b71fe90..026af5d5 100644
--- a/components/categories/EditModal.vue
+++ b/components/categories/EditModal.vue
@@ -1,12 +1,12 @@
<script>
import { saveData } from '~/services/firebaseHelpers'
import generateId from '~/utils/id'
-import { popularColors, allColors } from '~/assets/js/colorsPopular'
+import { allColors, popularColors } from '~/assets/js/colorsPopular'
import { random } from '~/assets/js/emo'
import icons from '~/assets/js/icons'
export default {
- setup () {
+ setup() {
const { $store } = useNuxtApp()
const showColors = ref(false)
@@ -19,10 +19,10 @@ export default {
parentId: 0,
showInLastUsed: true,
showInQuickSelector: false,
- showStat: true
+ showStat: true,
})
- function findCategoryWithThisColor (color) {
+ function findCategoryWithThisColor(color) {
const categories = $store.state.categories.items
if (categories) {
const categoryIdWithThisColor = $store.getters['categories/categoriesRootIds']?.find(id => categories[id]?.color === color)
@@ -31,7 +31,7 @@ export default {
}
}
- function onSelectColor (color) {
+ function onSelectColor(color) {
if (color)
category.value.color = color
}
@@ -51,42 +51,42 @@ export default {
popularColors,
allColors,
- documentHeight
+ documentHeight,
}
},
- data () {
+ data() {
return {
originalParentId: null,
showParents: false,
showIcons: false,
- applyChildColor: true
+ applyChildColor: true,
}
},
computed: {
- categoryId () {
+ categoryId() {
return this.$store.state.categories.editId
- }
+ },
},
watch: {
categoryId: {
- handler (categoryId) {
+ handler(categoryId) {
if (categoryId) {
this.category = {
...this.category,
- ...this.$store.state.categories.items[this.categoryId]
+ ...this.$store.state.categories.items[this.categoryId],
}
this.originalParentId = this.category.parentId
}
},
- immediate: true
- }
+ immediate: true,
+ },
},
- created () {
+ created() {
this.colors = allColors
this.icons = icons
if (!this.$store.state.categories.editId) {
@@ -95,22 +95,22 @@ export default {
}
},
- beforeDestroy () {
+ beforeUnmount() {
this.$store.commit('categories/setCategoryEditId', null)
},
methods: {
- closed () {
+ closed() {
this.$store.commit('categories/setCategoryEditId', null)
this.$store.dispatch('ui/setActiveTab', null)
},
- handleIconSelect (icon) {
+ handleIconSelect(icon) {
this.category.icon = icon
this.showIcons = false
},
- handleParenCategorySelect (categoryId) {
+ handleParenCategorySelect(categoryId) {
const parentCategory = this.$store.state.categories.items[categoryId]
if (parentCategory)
this.category.color = parentCategory.color
@@ -119,7 +119,7 @@ export default {
this.showParents = false
},
- handleSubmit (close) {
+ handleSubmit(close) {
if (this.validateForm()) {
const uid = this.$store.state.user.user.uid
const id = this.categoryId || generateId()
@@ -134,7 +134,7 @@ export default {
parentId: this.category.parentId,
showInLastUsed: this.category.showInLastUsed,
showInQuickSelector: this.category.showInQuickSelector,
- showStat: true
+ showStat: true,
}
// ad or remove from parent
@@ -145,7 +145,7 @@ export default {
if (originalParent) {
saveData(`users/${uid}/categories/${this.originalParentId}`, {
...originalParent,
- childIds: originalParent.childIds.filter(cId => cId !== id)
+ childIds: originalParent.childIds.filter(cId => cId !== id),
})
}
}
@@ -161,7 +161,7 @@ export default {
...parenCategory,
showInLastUsed: false,
showInQuickSelector: false,
- childIds
+ childIds,
})
}
}
@@ -171,7 +171,7 @@ export default {
// update category
saveData(`users/${uid}/categories/${id}`, {
...categoriesValues,
- childIds
+ childIds,
})
// update child categories colors
@@ -184,12 +184,12 @@ export default {
}
},
- validateForm () {
+ validateForm() {
const categories = this.$store.state.categories.items
if (!this.category.name) {
this.$notify({
title: '😮',
- text: this.$t('categories.form.name.error')
+ text: this.$t('categories.form.name.error'),
})
return false
}
@@ -200,7 +200,7 @@ export default {
if (this.categoryId !== categoryId) {
this.$notify({
title: '😮',
- text: this.$t('categories.form.name.exist')
+ text: this.$t('categories.form.name.exist'),
})
return false
}
@@ -208,7 +208,7 @@ export default {
else {
this.$notify({
title: '😮',
- text: this.$t('categories.form.name.exist')
+ text: this.$t('categories.form.name.exist'),
})
return false
}
@@ -216,8 +216,8 @@ export default {
}
return true
- }
- }
+ },
+ },
}
</script>
diff --git a/components/categories/Form.vue b/components/categories/Form.vue
index c14461c3..e61a5422 100644
--- a/components/categories/Form.vue
+++ b/components/categories/Form.vue
@@ -4,22 +4,22 @@ import generateId from '~/utils/id'
import colors from '~/assets/js/colors'
import icons from '~/assets/js/icons'
-function random (icons) {
+function random(icons) {
return icons[Math.floor(Math.random() * icons.length)]
}
export default {
- setup (_props, { emit }) {
+ setup(_props, { emit }) {
const closed = () => {
emit('onClose')
}
return {
- closed
+ closed,
}
},
- data () {
+ data() {
return {
originalParentId: null,
showParents: false,
@@ -33,34 +33,34 @@ export default {
parentId: 0,
showInLastUsed: true,
showInQuickSelector: false,
- showStat: true
- }
+ showStat: true,
+ },
}
},
computed: {
- categoryId () {
+ categoryId() {
return this.$store.state.categories.editId
- }
+ },
},
watch: {
categoryId: {
- handler (categoryId) {
+ handler(categoryId) {
if (categoryId) {
this.category = {
...this.category,
- ...this.$store.state.categories.items[this.categoryId]
+ ...this.$store.state.categories.items[this.categoryId],
}
this.originalParentId = this.category.parentId
}
},
- immediate: true
- }
+ immediate: true,
+ },
},
- created () {
+ created() {
this.colors = colors
this.icons = icons
if (!this.$store.state.categories.editId) {
@@ -69,22 +69,22 @@ export default {
}
},
- beforeDestroy () {
+ beforeUnmount() {
this.$store.commit('categories/setCategoryEditId', null)
},
methods: {
- handleColorSelect (color) {
+ handleColorSelect(color) {
this.category.color = color
this.showColors = false
},
- handleIconSelect (icon) {
+ handleIconSelect(icon) {
this.category.icon = icon
this.showIcons = false
},
- handleParenCategorySelect (categoryId) {
+ handleParenCategorySelect(categoryId) {
const parentCategory = this.$store.state.categories.items[categoryId]
if (parentCategory)
this.category.color = parentCategory.color
@@ -93,7 +93,7 @@ export default {
this.showParents = false
},
- handleSubmit () {
+ handleSubmit() {
if (this.validateForm()) {
const uid = this.$store.state.user.user.uid
const id = this.categoryId || generateId()
@@ -108,7 +108,7 @@ export default {
parentId: this.category.parentId,
showInLastUsed: this.category.showInLastUsed,
showInQuickSelector: this.category.showInQuickSelector,
- showStat: true
+ showStat: true,
}
// ad or remove from parent
@@ -119,7 +119,7 @@ export default {
if (originalParent) {
saveData(`users/${uid}/categories/${this.originalParentId}`, {
...originalParent,
- childIds: originalParent.childIds.filter(cId => cId !== id)
+ childIds: originalParent.childIds.filter(cId => cId !== id),
})
}
}
@@ -133,7 +133,7 @@ export default {
saveData(`users/${uid}/categories/${this.category.parentId}`, {
...parenCategory,
- childIds
+ childIds,
})
}
}
@@ -143,7 +143,7 @@ export default {
// update category
saveData(`users/${uid}/categories/${id}`, {
...categoriesValues,
- childIds
+ childIds,
})
// update child categories colors
@@ -152,7 +152,7 @@ export default {
const category = categories[childId]
saveData(`users/${uid}/categories/${childId}`, {
...category,
- color: categoriesValues.color
+ color: categoriesValues.color,
})
}
}
@@ -164,12 +164,12 @@ export default {
}
},
- validateForm () {
+ validateForm() {
const categories = this.$store.state.categories.items
if (!this.category.name) {
this.$notify({
title: '😮',
- text: this.$t('categories.form.name.error')
+ text: this.$t('categories.form.name.error'),
})
return false
}
@@ -180,7 +180,7 @@ export default {
if (this.categoryId !== categoryId) {
this.$notify({
title: '😮',
- text: this.$t('categories.form.name.exist')
+ text: this.$t('categories.form.name.exist'),
})
return false
}
@@ -188,7 +188,7 @@ export default {
else {
this.$notify({
title: '😮',
- text: this.$t('categories.form.name.exist')
+ text: this.$t('categories.form.name.exist'),
})
return false
}
@@ -196,8 +196,8 @@ export default {
}
return true
- }
- }
+ },
+ },
}
</script>
diff --git a/components/categories/Modal.vue b/components/categories/Modal.vue
index 725835de..ee8f5320 100644
--- a/components/categories/Modal.vue
+++ b/components/categories/Modal.vue
@@ -3,7 +3,7 @@ import { removeData } from '~/services/firebaseHelpers'
import useFilter from '~/modules/filter/useFilter'
export default {
- setup () {
+ setup() {
const { $store } = useNuxtApp()
const { setCategoryFilter } = useFilter()
@@ -14,47 +14,47 @@ export default {
return {
setCategoryFilter,
- closed
+ closed,
}
},
- data () {
+ data() {
return {
- showModalConfirm: false
+ showModalConfirm: false,
}
},
computed: {
- categoryId () {
+ categoryId() {
return this.$store.state.categories.modal.id
},
- category () {
+ category() {
return this.$store.state.categories.items[this.categoryId]
},
- deleteInfo () {
+ deleteInfo() {
if (this.trnsIds.length > 0)
return `It's also will delete ${this.trnsIds.length} trns in this category`
return null
},
- childCategoriesIds () {
+ childCategoriesIds() {
return this.$store.getters['categories/getChildCategoriesIds'](this.categoryId)
},
- trnsIds () {
+ trnsIds() {
const trns = this.$store.state.trns.items
const trnsIds = []
for (const trnId in trns)
if (trns[trnId].categoryId === this.categoryId) trnsIds.push(trnId)
return trnsIds
- }
+ },
},
methods: {
- handleSetFilterCategory () {
+ handleSetFilterCategory() {
this.setCategoryFilter(this.categoryId)
this.$store.commit('filter/setFilterDateNow')
@@ -64,7 +64,7 @@ export default {
this.$store.dispatch('ui/setActiveTabStat', 'details')
},
- handleEditClick () {
+ handleEditClick() {
const categoryId = this.categoryId
this.$store.commit('categories/hideCategoryModal')
this.$store.commit('categories/setCategoryModalId', null)
@@ -72,7 +72,7 @@ export default {
this.$store.dispatch('ui/setActiveTab', 'createCategory')
},
- handleDeleteClick () {
+ handleDeleteClick() {
const categories = this.$store.state.categories.items
const id = this.categoryId
let isChildCategories = false
@@ -81,7 +81,7 @@ export default {
if (categories[categoryId].parentId === id) {
this.$notify({
title: '👆',
- text: 'You can not delete category with child categories'
+ text: 'You can not delete category with child categories',
})
isChildCategories = true
break
@@ -91,7 +91,7 @@ export default {
if (!isChildCategories) this.showModalConfirm = true
},
- handleDeleteConfirm () {
+ handleDeleteConfirm() {
const trnsIds = this.trnsIds
const uid = this.$store.state.user.user.uid
const id = this.categoryId
@@ -105,12 +105,12 @@ export default {
this.$store.commit('categories/setCategoryModalId', null)
}
- setTimeout(async () => {
+ setTimeout(async() => {
await this.$store.dispatch('trns/deleteTrnsByIds', trnsIds)
removeData(`users/${uid}/categories/${id}`)
}, 200)
- }
- }
+ },
+ },
}
</script>
diff --git a/components/categories/item/CategoryItem.vue b/components/categories/item/CategoryItem.vue
index f561f790..9a5e98c7 100644
--- a/components/categories/item/CategoryItem.vue
+++ b/components/categories/item/CategoryItem.vue
@@ -6,10 +6,10 @@ export default defineComponent({
activeItemId: { type: String, default: null },
category: { type: Object, required: true },
id: { type: String, required: true },
- ui: { type: String, default: null }
+ ui: { type: String, default: null },
},
- setup ({ id, category }, { listeners }) {
+ setup({ id, category }, { listeners }) {
const { $store } = useNuxtApp()
const { setCategoryFilter } = useFilter()
@@ -17,12 +17,12 @@ export default defineComponent({
const childCategoriesIds = computed(() => $store.getters['categories/getChildCategoriesIds'](id))
const parentCategory = computed(() => $store.state.categories.items[category.parentId])
- function onClickItem () {
+ function onClickItem() {
if (listeners.onClick)
listeners.onClick(id)
}
- function onClickIcon () {
+ function onClickIcon() {
setCategoryFilter(id)
$store.commit('filter/setFilterDateNow')
$store.commit('categories/hideCategoryModal')
@@ -34,9 +34,9 @@ export default defineComponent({
childCategoriesIds,
parentCategory,
onClickItem,
- onClickIcon
+ onClickIcon,
}
- }
+ },
})
</script>
diff --git a/components/categories/list/CategoriesListSlot.vue b/components/categories/list/CategoriesListSlot.vue
index 6c4cfa3d..12a5679d 100644
--- a/components/categories/list/CategoriesListSlot.vue
+++ b/components/categories/list/CategoriesListSlot.vue
@@ -2,11 +2,11 @@
export default {
props: {
ids: { type: Array, required: true },
- limit: { type: Number, default: null }
+ limit: { type: Number, default: null },
},
computed: {
- categories () {
+ categories() {
const categores = {}
let ids = this.ids
@@ -21,13 +21,13 @@ export default {
categores[categoryId] = {
id: categoryId,
- ...category
+ ...category,
}
}
return categores
- }
- }
+ },
+ },
}
</script>
diff --git a/components/categories/list/CategoriesView.vue b/components/categories/list/CategoriesView.vue
index 1033e678..e37829c6 100644
--- a/components/categories/list/CategoriesView.vue
+++ b/components/categories/list/CategoriesView.vue
@@ -7,17 +7,17 @@ export default {
noPadding: { type: Boolean, default: false },
noPaddingBottom: { type: Boolean, default: false },
title: { type: String, default: null },
- ui: { type: String, default: null }
+ ui: { type: String, default: null },
},
computed: {
- categoresIds () {
+ categoresIds() {
if (this.limit)
return this.ids.slice(0, this.limit)
return this.ids
- }
- }
+ },
+ },
}
</script>
diff --git a/components/chart/StatChartBalance.vue b/components/chart/StatChartBalance.vue
index b201730e..d8df5e04 100644
--- a/components/chart/StatChartBalance.vue
+++ b/components/chart/StatChartBalance.vue
@@ -9,10 +9,10 @@ export default {
name: 'StatChartBalance',
components: {
- Chart
+ Chart,
},
- data () {
+ data() {
const vm = this
return {
date: this.$day().valueOf(),
@@ -24,17 +24,17 @@ export default {
...chartOptions,
chart: {
events: {
- click (e) {
+ click(e) {
const value = this.series[0].searchPoint(e, true) || this.series[1].searchPoint(e, true)
vm.$store.dispatch('filter/setDate', parseInt(value.date))
- }
- }
- }
- }
+ },
+ },
+ },
+ },
}
},
- mounted () {
+ mounted() {
const data = this.generateData(this.periodName)
const handlePerioSelect = date => this.$store.dispatch('filter/setDate', parseInt(date))
this.chartOptions.series = data.series
@@ -42,17 +42,17 @@ export default {
cursor: 'pointer',
point: {
events: {
- click () {
+ click() {
handlePerioSelect(this.date)
- }
- }
- }
+ },
+ },
+ },
}
this.chartOptions = {
...this.chartOptions,
xAxis: {
- categories: data.categories
+ categories: data.categories,
},
chart: {
@@ -62,13 +62,13 @@ export default {
spacing: [5, 0, 0, 0],
type: 'column',
panning: true,
- panKey: 'shift'
- }
+ panKey: 'shift',
+ },
}
},
methods: {
- changePeriod (name) {
+ changePeriod(name) {
if (this.periodName !== name) {
this.periodName = name
const data = this.generateData(this.periodName, this.chartOptions.series)
@@ -77,12 +77,12 @@ export default {
}
},
- formatAmount (amount) {
+ formatAmount(amount) {
const fixed = this.$store.state.currencies.base === 'RUB' ? 0 : 2
return baseAmountFormat(amount, ' ', fixed)
},
- generateData (periodName) {
+ generateData(periodName) {
const trns = this.$store.state.trns.items
const allTrnsIds = Object.keys(trns)
@@ -116,15 +116,15 @@ export default {
// return
incomesData.unshift({
date: periodDate,
- y: Number(`${periodTotal.incomes.toFixed()}`)
+ y: Number(`${periodTotal.incomes.toFixed()}`),
})
expensesData.unshift({
date: periodDate,
- y: Number(`${periodTotal.expenses.toFixed()}`)
+ y: Number(`${periodTotal.expenses.toFixed()}`),
})
totalData.unshift({
date: periodDate,
- y: Number(`${(totalStart.total + balanceTotal.total).toFixed()}`)
+ y: Number(`${(totalStart.total + balanceTotal.total).toFixed()}`),
})
categories.unshift(name)
}
@@ -137,8 +137,8 @@ export default {
color: 'var(--c-incomes-1)',
data: incomesData,
marker: {
- lineColor: 'var(--c-incomes-1)'
- }
+ lineColor: 'var(--c-incomes-1)',
+ },
}, {
visible: false,
type: 'spline',
@@ -146,8 +146,8 @@ export default {
color: 'var(--c-expenses-1)',
data: expensesData,
marker: {
- lineColor: 'var(--c-expenses-1)'
- }
+ lineColor: 'var(--c-expenses-1)',
+ },
}, {
visible: true,
type: 'areaspline',
@@ -155,13 +155,13 @@ export default {
color: '#c1c1c1',
data: totalData,
marker: {
- lineColor: '#c1c1c1'
- }
+ lineColor: '#c1c1c1',
+ },
}],
- categories
+ categories,
}
- }
- }
+ },
+ },
}
</script>
diff --git a/components/chart/StatChartLines.vue b/components/chart/StatChartLines.vue
index fbe68004..2f7c2261 100644
--- a/components/chart/StatChartLines.vue
+++ b/components/chart/StatChartLines.vue
@@ -12,10 +12,10 @@ export default defineComponent({
categoryId: { type: String, default: null },
disableCategoryFilter: { type: Boolean, default: false },
isShowExpenses: { type: Boolean, default: true },
- isShowIncomes: { type: Boolean, default: true }
+ isShowIncomes: { type: Boolean, default: true },
},
- setup () {
+ setup() {
const { $store } = useNuxtApp()
const { isShowDataLabels } = useChart()
const { filterPeriodNameAllReplacedToYear, scrollTop } = useFilter()
@@ -33,7 +33,7 @@ export default defineComponent({
const chartObj = ref({})
const chartCallback = (v) => { chartObj.value = v }
- const onClickChart = async (event) => {
+ const onClickChart = async(event) => {
const chart = chartObj.value
if (!chart)
return
@@ -52,7 +52,7 @@ export default defineComponent({
}, 100)
}
- watch(() => $store.state.filter.date, async () => {
+ watch(() => $store.state.filter.date, async() => {
await nextTick()
const chart = chartObj.value
@@ -65,8 +65,8 @@ export default defineComponent({
plotBands: [{
color: 'var(--c-item-bg-active)',
from: chartSeriesIdx + 0.5,
- to: chartSeriesIdx - 0.5
- }]
+ to: chartSeriesIdx - 0.5,
+ }],
})
}
}, { immediate: true })
@@ -77,12 +77,12 @@ export default defineComponent({
isShowDataLabels,
chartType,
filterPeriodNameAllReplacedToYear,
- scrollTop
+ scrollTop,
}
},
computed: {
- chartData () {
+ chartData() {
const periodName = this.filterPeriodNameAllReplacedToYear
const chartPeriods = this.$store.state.chart.periods
const trns = this.$store.state.trns.items
@@ -105,7 +105,7 @@ export default defineComponent({
date: periodDate,
periodName,
categoryId: null,
- disableCategoryFilter: this.disableCategoryFilter
+ disableCategoryFilter: this.disableCategoryFilter,
})
const periodTotal = this.$store.getters['trns/getTotalOfTrnsIds'](trnsIds)
@@ -119,17 +119,17 @@ export default defineComponent({
// Incomes
incomesData.unshift({
date: periodDate,
- y: Number(`${periodTotal.incomes.toFixed()}`)
+ y: Number(`${periodTotal.incomes.toFixed()}`),
})
// Expenses
expensesData.unshift({
date: periodDate,
- y: Number(`${periodTotal.expenses.toFixed()}`)
+ y: Number(`${periodTotal.expenses.toFixed()}`),
})
// Total
totalData.unshift({
date: periodDate,
- y: Number(`${(periodTotal.total).toFixed()}`)
+ y: Number(`${(periodTotal.total).toFixed()}`),
})
categories.unshift(name)
}
@@ -162,8 +162,8 @@ export default defineComponent({
color: 'var(--c-incomes-1)',
data: incomesData,
marker: {
- lineColor: 'var(--c-incomes-1)'
- }
+ lineColor: 'var(--c-incomes-1)',
+ },
}, {
zIndex: 2,
visible: periodsTotalExpenses > 0 && this.isShowExpenses,
@@ -172,8 +172,8 @@ export default defineComponent({
color: 'var(--c-expenses-1)',
data: expensesData,
marker: {
- lineColor: 'var(--c-expenses-1)'
- }
+ lineColor: 'var(--c-expenses-1)',
+ },
// Fake data to make good hover on bar chart
}, {
zIndex: 1,
@@ -191,17 +191,17 @@ export default defineComponent({
hover: {
fillColor: 'transparent',
lineColor: 'transparent',
- lineWidth: 0
- }
- }
+ lineWidth: 0,
+ },
+ },
},
dataLabels: {
- enabled: false
- }
+ enabled: false,
+ },
}],
categories,
averageIncomes: periodsTotalIncomes / periods,
- averageExpenses: periodsTotalExpenses / periodsExpenses
+ averageExpenses: periodsTotalExpenses / periodsExpenses,
}
const tooltip = this.$store.state.ui.pc ? { ...chartOptions.tooltip } : { enabled: false }
@@ -215,7 +215,7 @@ export default defineComponent({
xAxis: {
...chartOptions.xAxis,
- categories: data.categories
+ categories: data.categories,
},
yAxis: {
@@ -225,19 +225,19 @@ export default defineComponent({
color: 'var(--c-expenses-opacity)',
value: data.averageExpenses,
width: '2',
- zIndex: 1
+ zIndex: 1,
}, {
opacity: 0.5,
color: 'var(--c-incomes-opacity)',
value: data.averageIncomes,
width: '2',
- zIndex: 1
- }]
+ zIndex: 1,
+ }],
},
chart: {
...chartOptions.chart,
- height: '180'
+ height: '180',
},
plotOptions: {
@@ -246,13 +246,13 @@ export default defineComponent({
...chartOptions.plotOptions.series,
dataLabels: {
...chartOptions.plotOptions.series.dataLabels,
- enabled: this.isShowDataLabels
- }
- }
- }
+ enabled: this.isShowDataLabels,
+ },
+ },
+ },
}
- }
- }
+ },
+ },
})
</script>
diff --git a/components/chart/useChart.ts b/components/chart/useChart.ts
index 20cfefb0..4acd6990 100644
--- a/components/chart/useChart.ts
+++ b/components/chart/useChart.ts
@@ -2,20 +2,20 @@ import useFilter from '~/modules/filter/useFilter'
const isShowDataLabels = ref(false)
-export default function useChart () {
+export default function useChart() {
const { $store } = useNuxtApp()
const { filterPeriodNameAllReplacedToYear } = useFilter()
- function showDataLabels () {
+ function showDataLabels() {
isShowDataLabels.value = true
}
- function hideDataLabels () {
+ function hideDataLabels() {
isShowDataLabels.value = false
}
- function toogleChartsView () {
+ function toogleChartsView() {
$store.commit('chart/toogleChartPeriodView', {
- periodName: filterPeriodNameAllReplacedToYear.value
+ periodName: filterPeriodNameAllReplacedToYear.value,
})
$store.dispatch('ui/saveUiView')
}
@@ -25,6 +25,6 @@ export default function useChart () {
toogleChartsView,
showDataLabels,
- hideDataLabels
+ hideDataLabels,
}
}
diff --git a/components/currencies/Modal.vue b/components/currencies/Modal.vue
index b578928f..1cfdb017 100644
--- a/components/currencies/Modal.vue
+++ b/components/currencies/Modal.vue
@@ -1,11 +1,11 @@
<script>
export default {
methods: {
- handleCurrencySelect (currency) {
+ handleCurrencySelect(currency) {
this.$store.commit('currencies/hideBaseCurrenciesModal')
this.$store.dispatch('currencies/setBaseCurrency', currency)
- }
- }
+ },
+ },
}
</script>
diff --git a/components/icon/Icon.vue b/components/icon/Icon.vue
index 19170f24..a0ee071a 100644
--- a/components/icon/Icon.vue
+++ b/components/icon/Icon.vue
@@ -10,21 +10,21 @@ export default {
invert: { type: Boolean, default: false },
medium: { type: Boolean, default: false },
round: { type: Boolean, default: false },
- small: { type: Boolean, default: false }
+ small: { type: Boolean, default: false },
},
computed: {
- className () {
+ className() {
return {
_big: this.big,
_category: this.category,
_invert: this.invert,
_round: this.round,
_medium: this.medium,
- _small: this.small
+ _small: this.small,
}
- }
- }
+ },
+ },
}
</script>
diff --git a/components/icon/Icon2.vue b/components/icon/Icon2.vue
index c3dd1a08..2ee94e9f 100644
--- a/components/icon/Icon2.vue
+++ b/components/icon/Icon2.vue
@@ -2,8 +2,8 @@
export default {
props: {
background: { type: String, required: true },
- icon: { type: String, required: true }
- }
+ icon: { type: String, required: true },
+ },
}
</script>
diff --git a/components/lang/LangDropdown.vue b/components/lang/LangDropdown.vue
index e384395b..7422d03b 100644
--- a/components/lang/LangDropdown.vue
+++ b/components/lang/LangDropdown.vue
@@ -1,32 +1,32 @@
<script>
export default {
- data () {
+ data() {
return {
- visibleDropdown: false
+ visibleDropdown: false,
}
},
computed: {
- currentLanguageName () {
+ currentLanguageName() {
switch (this.$i18n.locale) {
case 'ru':
return '🇷🇺 Russian - Русский'
default:
return '🇺🇸 English - Английский'
}
- }
+ },
},
methods: {
- changeLang (lang) {
+ changeLang(lang) {
this.visibleDropdown = false
this.$store.dispatch('lang/setLang', lang)
},
- onClickOpener () {
+ onClickOpener() {
this.visibleDropdown = !this.visibleDropdown
- }
- }
+ },
+ },
}
</script>
diff --git a/components/layout/BaseWrap.vue b/components/layout/BaseWrap.vue
index 877ecfc4..3e6e3aa3 100644
--- a/components/layout/BaseWrap.vue
+++ b/components/layout/BaseWrap.vue
@@ -3,9 +3,9 @@ export default {
props: {
contentPadding: {
type: Boolean,
- default: true
- }
- }
+ default: true,
+ },
+ },
}
</script>
diff --git a/components/layout/BottomMenu.vue b/components/layout/BottomMenu.vue
index 01397592..03256d84 100644
--- a/components/layout/BottomMenu.vue
+++ b/components/layout/BottomMenu.vue
@@ -5,15 +5,15 @@ export default {
props: {
slider: {
type: Object,
- required: true
+ required: true,
},
stat2: {
type: Boolean,
- default: false
- }
+ default: false,
+ },
},
- setup () {
+ setup() {
const { $store, nuxt2Context: { i18n } } = useNuxtApp()
const route = useRoute()
const router = useRouter()
@@ -22,26 +22,26 @@ export default {
stat: {
icon: 'mdi mdi-poll',
id: 'stat',
- name: i18n.t('stat.shortTitle')
+ name: i18n.t('stat.shortTitle'),
},
wallets: {
icon: 'mdi mdi-credit-card-multiple',
id: 'wallets',
- name: i18n.t('wallets.name')
+ name: i18n.t('wallets.name'),
},
categories: {
icon: 'mdi mdi-folder-star',
id: 'categories',
- name: i18n.t('categories.shortTitle')
+ name: i18n.t('categories.shortTitle'),
},
menu: {
icon: 'mdi mdi-menu',
id: 'menu',
- name: i18n.t('trns.shortTitle')
- }
+ name: i18n.t('trns.shortTitle'),
+ },
}))
- function handleSetActiveTab (tabName) {
+ function handleSetActiveTab(tabName) {
if (tabName === 'menu') {
$store.dispatch('ui/setActiveTab', 'menu')
return
@@ -50,7 +50,7 @@ export default {
router.push(tabName)
}
- function getClassName (tabName) {
+ function getClassName(tabName) {
if (route.name === tabName)
return true
else if (tabName === 'stat' && route.name === 'index')
@@ -60,9 +60,9 @@ export default {
return {
menu,
handleSetActiveTab,
- getClassName
+ getClassName,
}
- }
+ },
}
</script>
diff --git a/components/layout/MenuModal.vue b/components/layout/MenuModal.vue
index cb189bc8..eeed42eb 100644
--- a/components/layout/MenuModal.vue
+++ b/components/layout/MenuModal.vue
@@ -1,13 +1,13 @@
<script>
export default {
- setup () {
+ setup() {
const { $store } = useNuxtApp()
const activeTab = computed(() => $store.state.ui.activeTab)
return {
- activeTab
+ activeTab,
}
- }
+ },
}
</script>
diff --git a/components/layout/MenuModalItems.vue b/components/layout/MenuModalItems.vue
index 4da82b1a..6675d835 100644
--- a/components/layout/MenuModalItems.vue
+++ b/components/layout/MenuModalItems.vue
@@ -2,16 +2,16 @@
import useMenuData from '~/modules/menu/useMenuData'
export default defineComponent({
- setup () {
+ setup() {
const { items, onClick, checkIsActive, checkIsShow } = useMenuData()
return {
items,
onClick,
checkIsActive,
- checkIsShow
+ checkIsShow,
}
- }
+ },
})
</script>
diff --git a/components/layout/Modals.vue b/components/layout/Modals.vue
index 4d4e7011..0575cac3 100644
--- a/components/layout/Modals.vue
+++ b/components/layout/Modals.vue
@@ -1,13 +1,13 @@
<script lang="ts">
export default defineComponent({
- setup () {
+ setup() {
const { $store } = useNuxtApp()
const activeTab = computed(() => $store.state.ui.activeTab)
return {
- activeTab
+ activeTab,
}
- }
+ },
})
</script>
diff --git a/components/layout/Sidebar.vue b/components/layout/Sidebar.vue
index 7dee023e..be762fe4 100644
--- a/components/layout/Sidebar.vue
+++ b/components/layout/Sidebar.vue
@@ -1,11 +1,11 @@
<script lang="ts">
export default defineComponent({
methods: {
- handleShowWalletsModalWalletModal (id) {
+ handleShowWalletsModalWalletModal(id) {
this.$store.commit('wallets/showWalletsModalWalletModal')
this.$store.commit('wallets/setWalletsModalWalletModalId', id)
- }
- }
+ },
+ },
})
</script>
diff --git a/components/layout/SidebarMenu.vue b/components/layout/SidebarMenu.vue
index 899f5f6d..a725aa0e 100644
--- a/components/layout/SidebarMenu.vue
+++ b/components/layout/SidebarMenu.vue
@@ -2,16 +2,16 @@
import useMenuData from '~/modules/menu/useMenuData'
export default defineComponent({
- setup () {
+ setup() {
const { items, onClick, checkIsActive, checkIsShow } = useMenuData()
return {
items,
onClick,
checkIsActive,
- checkIsShow
+ checkIsShow,
}
- }
+ },
})
</script>
diff --git a/components/layout/useBaseLayout.ts b/components/layout/useBaseLayout.ts
index 509cccbb..07d219d8 100644
--- a/components/layout/useBaseLayout.ts
+++ b/components/layout/useBaseLayout.ts
@@ -1,16 +1,16 @@
const isShowPeriodsNamesModal = ref(false)
-export default function useBaseLayout () {
- function showPeriodsNamesModal () {
+export default function useBaseLayout() {
+ function showPeriodsNamesModal() {
isShowPeriodsNamesModal.value = true
}
- function hidePeriodsNamesModal () {
+ function hidePeriodsNamesModal() {
isShowPeriodsNamesModal.value = false
}
return {
isShowPeriodsNamesModal,
showPeriodsNamesModal,
- hidePeriodsNamesModal
+ hidePeriodsNamesModal,
}
}
diff --git a/components/layout/useUIView.ts b/components/layout/useUIView.ts
index 738cdf13..587fdacf 100644
--- a/components/layout/useUIView.ts
+++ b/components/layout/useUIView.ts
@@ -7,26 +7,26 @@ const ui = reactive({
showCatsVerticalChart: true,
showMainChart: true,
showPieChart: false,
- showRoundCats: true
+ showRoundCats: true,
})
-export default function useUIView () {
- async function getLocalUI (): Promise<{}> {
+export default function useUIView() {
+ async function getLocalUI(): Promise<{}> {
const localUI: {} = await localforage.getItem(localName) || {}
return localUI
}
- async function setUI ({ name, value }) {
+ async function setUI({ name, value }) {
const localUI = await getLocalUI()
ui[name] = value
localforage.setItem(localName, {
...localUI,
- [name]: value
+ [name]: value,
})
}
- async function initUI () {
+ async function initUI() {
const localUI = await getLocalUI()
for (const key in localUI) {
if (ui[key])
@@ -37,6 +37,6 @@ export default function useUIView () {
return {
ui,
initUI,
- setUI
+ setUI,
}
}
diff --git a/components/modal/ModalBottom.vue b/components/modal/ModalBottom.vue
index 4c61574f..2653c799 100644
--- a/components/modal/ModalBottom.vue
+++ b/components/modal/ModalBottom.vue
@@ -7,26 +7,26 @@ export default {
props: {
isShow: {
type: Boolean,
- default: true
+ default: true,
},
center: {
type: Boolean,
- default: false
+ default: false,
},
title: {
type: String,
- default: null
+ default: null,
},
paddingless: {
type: Boolean,
- default: false
- }
+ default: false,
+ },
},
- setup (props, { listeners }) {
+ setup(props, { listeners }) {
const { isShow } = toRefs(props)
const { initTouchModal, closeModal } = useTouchClose()
@@ -35,7 +35,7 @@ export default {
content: ref(null),
handler: ref(null),
overflow: ref(null),
- wrap: ref(null)
+ wrap: ref(null),
})
watch(isShow, (value) => {
@@ -47,16 +47,16 @@ export default {
listeners.onClose()
if (listeners && listeners.afterClose)
listeners.afterClose()
- }
+ },
})
}, 10)
}, { immediate: true })
return {
...toRefs(wrappers),
- closeModal
+ closeModal,
}
- }
+ },
}
</script>
diff --git a/components/modal/ModalBottomConfirm.vue b/components/modal/ModalBottomConfirm.vue
index 9b1ff1ae..b6e4730d 100644
--- a/components/modal/ModalBottomConfirm.vue
+++ b/components/modal/ModalBottomConfirm.vue
@@ -3,13 +3,13 @@ export default {
props: {
description: {
type: String,
- default: null
+ default: null,
},
show: {
type: Boolean,
- default: false
- }
- }
+ default: false,
+ },
+ },
}
</script>
diff --git a/components/modal/ModalButton.vue b/components/modal/ModalButton.vue
index 1b773b78..5623e00d 100644
--- a/components/modal/ModalButton.vue
+++ b/components/modal/ModalButton.vue
@@ -3,8 +3,8 @@ export default {
props: {
icon: { type: String, required: true },
name: { type: String, required: true },
- isActive: { type: Boolean, default: false }
- }
+ isActive: { type: Boolean, default: false },
+ },
}
</script>
diff --git a/components/periods/usePeriods.ts b/components/periods/usePeriods.ts
index 78fc1046..dd8f83bc 100644
--- a/components/periods/usePeriods.ts
+++ b/components/periods/usePeriods.ts
@@ -1,27 +1,27 @@
-export default function usePeriods () {
+export default function usePeriods() {
const { nuxt2Context: { i18n } } = useNuxtApp()
const periodsNames = computed(() => [
{
slug: 'day',
icon: 'mdi mdi-weather-sunset-up',
- name: i18n.t('dates.day.simple')
+ name: i18n.t('dates.day.simple'),
}, {
slug: 'week',
icon: 'mdi mdi-calendar-week',
- name: i18n.t('dates.week.simple')
+ name: i18n.t('dates.week.simple'),
}, {
slug: 'month',
icon: 'mdi mdi-calendar',
- name: i18n.t('dates.month.simple')
+ name: i18n.t('dates.month.simple'),
}, {
slug: 'year',
icon: 'mdi mdi-calendar-star',
- name: i18n.t('dates.year.simple')
- }
+ name: i18n.t('dates.year.simple'),
+ },
])
return {
- periodsNames
+ periodsNames,
}
}
diff --git a/components/shared/Date.vue b/components/shared/Date.vue
index 5629fa2a..09b26d58 100644
--- a/components/shared/Date.vue
+++ b/components/shared/Date.vue
@@ -2,11 +2,11 @@
/* eslint-disable no-case-declarations */
export default {
props: {
- type: { type: Number, default: 3 }
+ type: { type: Number, default: 3 },
},
computed: {
- formatedDate () {
+ formatedDate() {
const today = this.$day()
const filterDate = this.$store.state.filter.date
const filterPeriod = this.$store.state.filter.period
@@ -46,8 +46,8 @@ export default {
const fDate = this.$day(filterDate).format(format)
return fDate[0].toUpperCase() + fDate.slice(1)
- }
- }
+ },
+ },
}
</script>
diff --git a/components/shared/button/Button.vue b/components/shared/button/Button.vue
index 533b4653..677bdc25 100644
--- a/components/shared/button/Button.vue
+++ b/components/shared/button/Button.vue
@@ -3,43 +3,43 @@ export default {
props: {
background: {
type: String,
- default: null
+ default: null,
},
icon: {
type: String,
- default: null
+ default: null,
},
className: {
type: String,
- default: null
+ default: null,
},
title: {
type: String,
- default: null
+ default: null,
},
showCheckbox: {
type: Boolean,
- default: false
+ default: false,
},
checkboxValue: {
type: Boolean,
- default: false
+ default: false,
},
size: {
type: String,
- default: 'md'
- }
+ default: 'md',
+ },
},
computed: {
- classNameComputed () {
+ classNameComputed() {
return {
[`_size_${this.size}`]: this.size,
- [this.className]: this.className
+ [this.className]: this.className,
}
- }
- }
+ },
+ },
}
</script>
diff --git a/components/shared/contextMenu/ContextMenu.vue b/components/shared/contextMenu/ContextMenu.vue
index bb0edf85..0d3634ae 100644
--- a/components/shared/contextMenu/ContextMenu.vue
+++ b/components/shared/contextMenu/ContextMenu.vue
@@ -2,23 +2,23 @@
export default {
props: {
visible: { type: Boolean, default: false },
- position: { type: Object, default: () => {} }
+ position: { type: Object, default: () => {} },
},
computed: {
- className () {
+ className() {
return {
_bottom: this.position && this.position.bottom,
_right: this.position && this.position.right,
- _top: this.position && this.position.top
+ _top: this.position && this.position.top,
}
},
- positionStyles () {
+ positionStyles() {
if (this.position && this.position.left && typeof this.position.left === 'string') {
return {
left: this.position.left,
- maxWidth: `${this.$store.state.ui.width - 24}px`
+ maxWidth: `${this.$store.state.ui.width - 24}px`,
}
}
if (this.position && this.position.right && typeof this.position.right === 'string') {
@@ -26,18 +26,18 @@ export default {
return {
right: this.position.right,
top: this.position.top,
- maxWidth: `${this.$store.state.ui.width - 24}px`
+ maxWidth: `${this.$store.state.ui.width - 24}px`,
}
}
return {
right: this.position.right,
- maxWidth: `${this.$store.state.ui.width - 24}px`
+ maxWidth: `${this.$store.state.ui.width - 24}px`,
}
}
return null
- }
- }
+ },
+ },
}
</script>
diff --git a/components/shared/contextMenu/ContextMenuItem.vue b/components/shared/contextMenu/ContextMenuItem.vue
index e7ef0df1..7b7d3e36 100644
--- a/components/shared/contextMenu/ContextMenuItem.vue
+++ b/components/shared/contextMenu/ContextMenuItem.vue
@@ -6,16 +6,16 @@ export default {
icon: { type: String, default: null },
selected: { type: Boolean, default: false },
showCheckbox: { type: Boolean, default: false },
- title: { type: String, required: true }
+ title: { type: String, required: true },
},
methods: {
- handleClick () {
+ handleClick() {
this.$emit('onClick')
if (this.$listeners.onClose)
this.$listeners.onClose()
- }
- }
+ },
+ },
}
</script>
diff --git a/components/shared/copyright/Copyright.vue b/components/shared/copyright/Copyright.vue
index 6ec224f6..540531bf 100644
--- a/components/shared/copyright/Copyright.vue
+++ b/components/shared/copyright/Copyright.vue
@@ -1,6 +1,6 @@
<script>
export default {
- name: 'SharedCopyright'
+ name: 'SharedCopyright',
}
</script>
diff --git a/components/shared/date/DateFormated.vue b/components/shared/date/DateFormated.vue
index cb03cd13..ecd2cbb0 100644
--- a/components/shared/date/DateFormated.vue
+++ b/components/shared/date/DateFormated.vue
@@ -5,17 +5,17 @@ export default {
props: {
date: {
type: Number,
- required: true
+ required: true,
},
periodName: {
type: String,
- required: true
- }
+ required: true,
+ },
},
computed: {
- formatedDate () {
+ formatedDate() {
const today = this.$day()
const filterDate = this.$day(this.date)
const filterPeriod = this.periodName
@@ -23,12 +23,12 @@ export default {
switch (filterPeriod) {
case 'day':
- if (today.isSame(filterDate, 'year')) {
+ if (today.isSame(filterDate, 'year'))
format = 'DD MMMM'
- }
- else {
+
+ else
format = 'DD MMMM YYYY'
- }
+
break
case 'week':
@@ -36,20 +36,19 @@ export default {
const endDate = this.$day(filterDate).endOf('week')
// this week
- if (today.isSame(filterDate, 'week')) {
+ if (today.isSame(filterDate, 'week'))
return this.$t('dates.week.current')
- }
+
// last week
- else if (today.subtract(1, filterPeriod).isSame(filterDate, 'week')) {
+ else if (today.subtract(1, filterPeriod).isSame(filterDate, 'week'))
return this.$t('dates.week.last')
- }
+
// same month in week
- else if (this.$day(startDate).isSame(endDate, 'month')) {
+ else if (this.$day(startDate).isSame(endDate, 'month'))
return `${this.$day(startDate).format('D')}-${this.$day(endDate).format('D MMMM')}`
- }
- else {
+
+ else
return `${this.$day(startDate).format('D MMMM')} - ${this.$day(endDate).format('D MMMM')}`
- }
case 'month':
if (today.isSame(filterDate, 'year')) {
@@ -65,8 +64,8 @@ export default {
}
return this.$day(filterDate).format(format)
- }
- }
+ },
+ },
}
</script>
diff --git a/components/shared/dropdown/Dropdown.vue b/components/shared/dropdown/Dropdown.vue
index a0c0de78..95f9db52 100644
--- a/components/shared/dropdown/Dropdown.vue
+++ b/components/shared/dropdown/Dropdown.vue
@@ -3,17 +3,17 @@ export default {
props: {
active: {
type: Boolean,
- default: false
+ default: false,
},
icon: {
type: String,
- default: null
+ default: null,
},
title: {
type: String,
- default: null
- }
- }
+ default: null,
+ },
+ },
}
</script>
diff --git a/components/shared/emptyData/EmptyData.vue b/components/shared/emptyData/EmptyData.vue
index 59c85d17..59c73da2 100644
--- a/components/shared/emptyData/EmptyData.vue
+++ b/components/shared/emptyData/EmptyData.vue
@@ -5,9 +5,9 @@ export default {
props: {
text: {
type: String,
- required: true
- }
- }
+ required: true,
+ },
+ },
}
</script>
diff --git a/components/shared/inputs/Checkbox.vue b/components/shared/inputs/Checkbox.vue
index 18c82399..80d7bd40 100644
--- a/components/shared/inputs/Checkbox.vue
+++ b/components/shared/inputs/Checkbox.vue
@@ -3,8 +3,8 @@
export default {
props: {
value: { type: Boolean, required: true },
- title: { type: String, default: null }
- }
+ title: { type: String, default: null },
+ },
}
</script>
diff --git a/components/shared/spiner/Spiner.vue b/components/shared/spiner/Spiner.vue
index ae99dcfb..bbc253da 100644
--- a/components/shared/spiner/Spiner.vue
+++ b/components/shared/spiner/Spiner.vue
@@ -3,23 +3,23 @@ export default {
props: {
theme: {
type: String,
- default: 'light'
+ default: 'light',
},
size: {
type: String,
- default: 'md'
- }
+ default: 'md',
+ },
},
computed: {
- className () {
+ className() {
return {
_dark: this.theme === 'dark',
- [`_size_${this.size}`]: this.size
+ [`_size_${this.size}`]: this.size,
}
- }
- }
+ },
+ },
}
</script>
diff --git a/components/stat/Chart.vue b/components/stat/Chart.vue
index 1523125d..32602b01 100644
--- a/components/stat/Chart.vue
+++ b/components/stat/Chart.vue
@@ -3,7 +3,7 @@ import useFilter from '~/modules/filter/useFilter'
import useStatChart from '~/components/stat/useStatChart'
export default {
- setup () {
+ setup() {
const { $store } = useNuxtApp()
const { filterPeriodNameAllReplacedToYear } = useFilter()
const { chartState } = useStatChart()
@@ -28,9 +28,9 @@ export default {
periods,
filter,
filterPeriod,
- chartType
+ chartType,
}
- }
+ },
}
</script>
diff --git a/components/stat/Date.vue b/components/stat/Date.vue
index c252ad82..42384cb1 100644
--- a/components/stat/Date.vue
+++ b/components/stat/Date.vue
@@ -3,7 +3,7 @@ import useFilter from '~/modules/filter/useFilter'
import usePeriods from '~/components/periods/usePeriods'
export default {
- setup () {
+ setup() {
const { $store } = useNuxtApp()
const { periodsNames } = usePeriods()
const { filterPeriodNameAllReplacedToYear } = useFilter()
@@ -20,9 +20,9 @@ export default {
onSelect: (value) => {
$store.commit('chart/setElementsToChart', {
period: filterPeriod.value,
- value
+ value,
})
- }
+ },
}
return {
@@ -31,9 +31,9 @@ export default {
filterPeriod,
visiblePeriodMenu,
onSelectPeriod,
- periodCounts
+ periodCounts,
}
- }
+ },
}
</script>
diff --git a/components/stat/Empty.vue b/components/stat/Empty.vue
index d2d382d7..5d1cabfc 100644
--- a/components/stat/Empty.vue
+++ b/components/stat/Empty.vue
@@ -2,13 +2,13 @@
import useStat from '~/modules/stat/useStat'
export default defineComponent({
- setup () {
+ setup() {
const { isEmptyStat } = useStat()
return {
- isEmptyStat
+ isEmptyStat,
}
- }
+ },
})
</script>
diff --git a/components/stat/Index.vue b/components/stat/Index.vue
index b789e655..99bf5183 100644
--- a/components/stat/Index.vue
+++ b/components/stat/Index.vue
@@ -5,7 +5,7 @@ import useStatPage from '~/components/stat/useStatPage'
import useUIView from '~/components/layout/useUIView'
export default {
- setup () {
+ setup() {
const { $store } = useNuxtApp()
const { statPage } = useStatPage()
const { ui } = useUIView()
@@ -15,20 +15,20 @@ export default {
onWatch()
const isShowGroup = (type) => {
- const p1 = statPage.activeTab === 'details' ||
- (statPage.activeTab === 'incomes' && type === 'incomes') ||
- (statPage.activeTab === 'expenses' && type === 'expenses')
- const p2 = statPage.current[type].total > 0 ||
- (statPage.average && statPage.average[type] !== 0) ||
- $store.state.filter.period === 'all'
+ const p1 = statPage.activeTab === 'details'
+ || (statPage.activeTab === 'incomes' && type === 'incomes')
+ || (statPage.activeTab === 'expenses' && type === 'expenses')
+ const p2 = statPage.current[type].total > 0
+ || (statPage.average && statPage.average[type] !== 0)
+ || $store.state.filter.period === 'all'
return p1 && p2
}
const isShowTrns = computed(() => {
- const proceed = statPage.activeTab === 'details' &&
- statPage.average?.incomes !== 0 &&
- statPage.average?.expenses !== 0 &&
- $store.getters['trns/selectedTrnsIdsWithDate'].length > 0
+ const proceed = statPage.activeTab === 'details'
+ && statPage.average?.incomes !== 0
+ && statPage.average?.expenses !== 0
+ && $store.getters['trns/selectedTrnsIdsWithDate'].length > 0
return proceed
})
@@ -45,9 +45,9 @@ export default {
moneyTypes,
statPage,
isEmptyStat,
- ui
+ ui,
}
- }
+ },
}
</script>
diff --git a/components/stat/Menu.vue b/components/stat/Menu.vue
index 5b729b14..18319804 100644
--- a/components/stat/Menu.vue
+++ b/components/stat/Menu.vue
@@ -2,19 +2,19 @@
export default {
name: 'StatDashboardMenu',
- setup () {
+ setup() {
const { $store } = useNuxtApp()
const activeTabStat = computed(() => $store.state.ui.activeTabStat)
- function onClickStatMenu (tabName) {
+ function onClickStatMenu(tabName) {
$store.dispatch('ui/setActiveTabStat', tabName)
}
return {
activeTabStat,
- onClickStatMenu
+ onClickStatMenu,
}
- }
+ },
}
</script>
diff --git a/components/stat/NoStatActions.vue b/components/stat/NoStatActions.vue
index 09b237dd..02b3b0f1 100644
--- a/components/stat/NoStatActions.vue
+++ b/components/stat/NoStatActions.vue
@@ -1,6 +1,6 @@
<script>
export default {
- name: 'StatNoStatActions'
+ name: 'StatNoStatActions',
}
</script>
diff --git a/components/stat/PeriodArrows.vue b/components/stat/PeriodArrows.vue
index 84c27c42..4b9e9297 100644
--- a/components/stat/PeriodArrows.vue
+++ b/components/stat/PeriodArrows.vue
@@ -1,6 +1,6 @@
<script>
export default {
- name: 'StatPeriodArrows'
+ name: 'StatPeriodArrows',
}
</script>
diff --git a/components/stat/Periods.vue b/components/stat/Periods.vue
index 81780438..85a01223 100644
--- a/components/stat/Periods.vue
+++ b/components/stat/Periods.vue
@@ -3,31 +3,31 @@ import useFilter from '~/modules/filter/useFilter'
import usePeriods from '~/components/periods/usePeriods'
export default {
- setup () {
+ setup() {
const { $store } = useNuxtApp()
// Filter
const { filterPeriodNameAllReplacedToYear } = useFilter()
- function saveChartsPeriodsToLocalStorage () {
+ function saveChartsPeriodsToLocalStorage() {
$store.dispatch('ui/saveUiView')
}
- function addPeriodOrGroup () {
+ function addPeriodOrGroup() {
$store.commit('chart/addElementsToChart', {
periodName: filterPeriodNameAllReplacedToYear.value,
- periodType: 'showedPeriods'
+ periodType: 'showedPeriods',
})
saveChartsPeriodsToLocalStorage()
}
- function removePeriodOrGroup () {
+ function removePeriodOrGroup() {
if ($store.state.chart.periods[filterPeriodNameAllReplacedToYear.value].showedPeriods <= 2)
return
$store.commit('chart/removeElementsFromChart', {
periodName: filterPeriodNameAllReplacedToYear.value,
- periodType: 'showedPeriods'
+ periodType: 'showedPeriods',
})
saveChartsPeriodsToLocalStorage()
}
@@ -39,9 +39,9 @@ export default {
addPeriodOrGroup,
removePeriodOrGroup,
filterPeriodNameAllReplacedToYear,
- periodsNames
+ periodsNames,
}
- }
+ },
}
</script>
diff --git a/components/stat/StatChartPie.vue b/components/stat/StatChartPie.vue
index 49f9077b..47431cb0 100644
--- a/components/stat/StatChartPie.vue
+++ b/components/stat/StatChartPie.vue
@@ -6,23 +6,23 @@ export default {
name: 'StatChartPie',
components: {
- Chart
+ Chart,
},
props: {
chartType: {
type: String,
- default: 'pie'
+ default: 'pie',
},
amountType: {
type: String,
- default: null
- }
+ default: null,
+ },
},
computed: {
- chartData () {
+ chartData() {
const statCurrentPeriodCategories = this.$store.getters['stat/statCurrentPeriod'].categories
const statCurrentPeriod = this.$store.getters['stat/statCurrentPeriod']
const data = []
@@ -35,14 +35,14 @@ export default {
categoryId,
color: category.color,
name: category.name,
- y: categoryAmountValues[this.amountType]
+ y: categoryAmountValues[this.amountType],
})
}
}
const series = [{
data,
- type: this.chartType
+ type: this.chartType,
}]
return {
@@ -55,12 +55,12 @@ export default {
height: '280',
events: {
- click (e) {
+ click(e) {
console.log(e)
// const value = this.series[0].searchPoint(e, true) || this.series[1].searchPoint(e, true)
// vm.$store.dispatch('filter/setDate', parseInt(value.date))
- }
- }
+ },
+ },
},
plotOptions: {
@@ -70,17 +70,17 @@ export default {
cursor: 'pointer',
point: {
events: {
- click (e) {
+ click(e) {
// console.log(e)
// vm.$store.dispatch('filter/setDate', parseInt(this.date))
- }
- }
- }
- }
- }
+ },
+ },
+ },
+ },
+ },
}
- }
- }
+ },
+ },
}
</script>
diff --git a/components/stat/StatItem.vue b/components/stat/StatItem.vue
index 70964291..cee6efc0 100644
--- a/components/stat/StatItem.vue
+++ b/components/stat/StatItem.vue
@@ -8,34 +8,34 @@ export default {
categoryId: { type: String, required: true },
currency: { type: String, required: true },
total: { type: Number, required: true },
- type: { type: Number, required: true }
+ type: { type: Number, required: true },
},
- setup () {
+ setup() {
const { setCategoryFilter } = useFilter()
return {
- setCategoryFilter
+ setCategoryFilter,
}
},
- data () {
+ data() {
return {
- isShowInside: false
+ isShowInside: false,
}
},
computed: {
- childCategoriesIds () {
+ childCategoriesIds() {
return this.$store.getters['categories/getChildCategoriesIds'](this.categoryId)
},
- showChildCategories () {
+ showChildCategories() {
const childCatsIdsWithTrns = []
for (const childCategoryId of this.childCategoriesIds) {
const trnsIds = this.$store.getters['trns/getTrnsIdsByFilter']({
categoryId: childCategoryId,
- type: this.type
+ type: this.type,
})
if (trnsIds.length > 0)
childCatsIdsWithTrns.push(childCategoryId)
@@ -47,14 +47,14 @@ export default {
return false
},
- styles () {
+ styles() {
return {
width: `${Math.abs(this.total) / Math.abs(this.biggest) * 100}%`,
- background: this.category.color
+ background: this.category.color,
}
},
- getCatgoryName () {
+ getCatgoryName() {
const cats = []
const categoriesIds = this.$store.getters['categories/getChildCategoriesIds'](this.categoryId)
@@ -73,14 +73,14 @@ export default {
}
return cats
- }
+ },
},
methods: {
- toogleShowInside () {
+ toogleShowInside() {
this.isShowInside = !this.isShowInside
- }
- }
+ },
+ },
}
</script>
diff --git a/components/stat/StatItemChildCats.vue b/components/stat/StatItemChildCats.vue
index b8e34303..ae984d24 100644
--- a/components/stat/StatItemChildCats.vue
+++ b/components/stat/StatItemChildCats.vue
@@ -6,16 +6,16 @@ export default {
props: {
categoryId: {
type: String,
- required: true
+ required: true,
},
type: {
type: Number,
- required: true
- }
+ required: true,
+ },
},
computed: {
- statCategories () {
+ statCategories() {
const categoriesIds = this.$store.getters['categories/getChildCategoriesIds'](this.categoryId)
let stat = []
@@ -36,13 +36,13 @@ export default {
return stat
},
- typeName () {
+ typeName() {
return this.type === 1 ? 'incomes' : 'expenses'
- }
+ },
},
methods: {
- getTrnsByCategoryId (categoryId) {
+ getTrnsByCategoryId(categoryId) {
const trns = this.$store.state.trns.items
let trnsIds = this.$store.getters['trns/selectedTrnsIdsWithDate']
trnsIds = trnsIds.filter(id => trns[id].categoryId === categoryId)
@@ -50,13 +50,13 @@ export default {
return trnsIds
},
- getCategoryStat ({ categoryId, trnsIds }) {
+ getCategoryStat({ categoryId, trnsIds }) {
return {
categoryId,
- ...this.$store.getters['trns/getTotalOfTrnsIds'](trnsIds)
+ ...this.$store.getters['trns/getTotalOfTrnsIds'](trnsIds),
}
- }
- }
+ },
+ },
}
</script>
diff --git a/components/stat/StatItemChildCatsItem.vue b/components/stat/StatItemChildCatsItem.vue
index 2387240a..dbcf7c3d 100644
--- a/components/stat/StatItemChildCatsItem.vue
+++ b/components/stat/StatItemChildCatsItem.vue
@@ -7,37 +7,37 @@ export default {
category: { type: Object, required: true },
categoryId: { type: String, required: true },
total: { type: Number, required: true },
- type: { type: Number, required: true }
+ type: { type: Number, required: true },
},
- setup () {
+ setup() {
const { setCategoryFilter } = useFilter()
return {
- setCategoryFilter
+ setCategoryFilter,
}
},
- data () {
+ data() {
return {
- isShowInside: false
+ isShowInside: false,
}
},
computed: {
- styles () {
+ styles() {
return {
width: `${Math.abs(this.total) / Math.abs(this.biggest) * 100}%`,
- background: this.category.color
+ background: this.category.color,
}
- }
+ },
},
methods: {
- toogleShowInside () {
+ toogleShowInside() {
this.isShowInside = !this.isShowInside
- }
- }
+ },
+ },
}
</script>
diff --git a/components/stat/StatItemRound.vue b/components/stat/StatItemRound.vue
index 18f85ab8..41e1c26e 100644
--- a/components/stat/StatItemRound.vue
+++ b/components/stat/StatItemRound.vue
@@ -7,27 +7,27 @@ export default {
props: {
category: {
type: Object,
- required: true
+ required: true,
},
categoryId: {
type: String,
- required: true
+ required: true,
},
currency: {
type: String,
- required: true
+ required: true,
},
total: {
type: Number,
- required: true
+ required: true,
},
type: {
type: Number,
- required: true
- }
+ required: true,
+ },
},
- setup (props) {
+ setup(props) {
const { categoryId, type } = toRefs(props)
const { $store } = useNuxtApp()
const { setCategoryFilter } = useFilter()
@@ -35,7 +35,7 @@ export default {
const trnsIds = computed(() => {
return $store.getters['trns/getTrns']({
categoryId: categoryId.value,
- type: type.value
+ type: type.value,
})
})
@@ -52,9 +52,9 @@ export default {
filterPeriod,
statCurrentPeriod,
item,
- isCategoryHasChildren
+ isCategoryHasChildren,
}
- }
+ },
}
</script>
diff --git a/components/stat/SummaryRowItemView.vue b/components/stat/SummaryRowItemView.vue
index f48ed828..684f3ca7 100644
--- a/components/stat/SummaryRowItemView.vue
+++ b/components/stat/SummaryRowItemView.vue
@@ -5,26 +5,26 @@ export default {
props: {
amount: {
type: Number,
- required: true
+ required: true,
},
type: {
type: Number,
- default: 3
+ default: 3,
},
title: {
type: String,
- required: true
- }
+ required: true,
+ },
},
computed: {
- className () {
+ className() {
return {
_expenses: this.type === 0,
- _incomes: this.type === 1
+ _incomes: this.type === 1,
}
- }
- }
+ },
+ },
}
</script>
diff --git a/components/stat/ViewConfig.vue b/components/stat/ViewConfig.vue
index dafc8bad..956e1a10 100644
--- a/components/stat/ViewConfig.vue
+++ b/components/stat/ViewConfig.vue
@@ -6,14 +6,14 @@ import useUIView from '~/components/layout/useUIView'
import useStatChart from '~/components/stat/useStatChart'
export default defineComponent({
- setup () {
+ setup() {
const { $store } = useNuxtApp()
const { chartState, toogleChart } = useStatChart()
const activeTabStat = computed(() => $store.state.ui.activeTabStat)
const { ui, setUI } = useUIView()
- function toogleView (name) {
+ function toogleView(name) {
setUI({ name, value: !ui[name] })
}
@@ -34,9 +34,9 @@ export default defineComponent({
ui,
isEmptyStat,
isShowDataLabels,
- toogleChartsView
+ toogleChartsView,
}
- }
+ },
})
</script>
diff --git a/components/stat/cats/PeriodCatsChart.vue b/components/stat/cats/PeriodCatsChart.vue
index 84c0760d..2da5d168 100644
--- a/components/stat/cats/PeriodCatsChart.vue
+++ b/components/stat/cats/PeriodCatsChart.vue
@@ -4,45 +4,45 @@ export default {
type: {
type: String,
required: true,
- validator (value) {
+ validator(value) {
return value === 'incomes' || value === 'expenses'
- }
- }
+ },
+ },
},
- data () {
+ data() {
return {
activeCategoryId: null,
- offset: 0
+ offset: 0,
}
},
computed: {
- className () {
+ className() {
return {
_incomes: this.type === 'incomes',
- _expenses: this.type === 'expenses'
+ _expenses: this.type === 'expenses',
}
},
- biggestAmount () {
+ biggestAmount() {
return this.$store.getters['stat/statCurrentPeriod'][this.type].biggest
},
- categories () {
+ categories() {
return this.$store.state.categories.items
},
- statCurrentPeriod () {
+ statCurrentPeriod() {
return this.$store.getters['stat/statCurrentPeriod']
- }
+ },
},
methods: {
- handleActiveCategoryChange ({ categoryId, offset }) {
+ handleActiveCategoryChange({ categoryId, offset }) {
if (offset) this.offset = offset
categoryId
? this.activeCategoryId = categoryId
: this.activeCategoryId = null
- }
- }
+ },
+ },
}
</script>
diff --git a/components/stat/cats/PeriodCatsChartItem.vue b/components/stat/cats/PeriodCatsChartItem.vue
index 58cdf974..e3c47009 100644
--- a/components/stat/cats/PeriodCatsChartItem.vue
+++ b/components/stat/cats/PeriodCatsChartItem.vue
@@ -3,43 +3,43 @@ export default {
props: {
category: {
type: Object,
- required: true
+ required: true,
},
categoryId: {
type: String,
- required: true
+ required: true,
},
total: {
type: Number,
- required: true
+ required: true,
},
biggest: {
type: Number,
- required: true
- }
+ required: true,
+ },
},
computed: {
- styles () {
+ styles() {
return {
height: `${Math.abs(this.total) / Math.abs(this.biggest) * 100}%`,
- background: this.category.color
+ background: this.category.color,
}
},
- amount () {
+ amount() {
if (this.total >= 1000000)
- return (this.total / 1000000).toFixed(2) + 'm'
+ return `${(this.total / 1000000).toFixed(2)}m`
else if (this.total >= 10000)
- return (this.total / 1000).toFixed() + 'k'
+ return `${(this.total / 1000).toFixed()}k`
else if (this.total > 999)
- return (this.total / 1000).toFixed(1) + 'k'
+ return `${(this.total / 1000).toFixed(1)}k`
return this.total.toFixed()
- }
+ },
},
methods: {
- handleMouseEnter (e) {
+ handleMouseEnter(e) {
if (this.$store.state.ui.pc) {
const parent = e.target.parentNode
const parentScrollLeft = parent.scrollLeft
@@ -50,11 +50,11 @@ export default {
}
},
- handleMouseLeave (e) {
+ handleMouseLeave(e) {
if (this.$store.state.ui.pc)
this.$emit('onActiveCategoryChange', { categoryId: null })
- }
- }
+ },
+ },
}
</script>
diff --git a/components/stat/cats/PeriodCatsChartItem2.vue b/components/stat/cats/PeriodCatsChartItem2.vue
index 84b20123..e62477c6 100644
--- a/components/stat/cats/PeriodCatsChartItem2.vue
+++ b/components/stat/cats/PeriodCatsChartItem2.vue
@@ -5,46 +5,45 @@ export default {
props: {
category: {
type: Object,
- required: true
+ required: true,
},
categoryId: {
type: String,
- required: true
+ required: true,
},
total: {
type: Number,
- required: true
+ required: true,
},
biggest: {
type: Number,
- required: true
- }
+ required: true,
+ },
},
computed: {
- styles () {
+ styles() {
return {
width: `${Math.abs(this.total) / Math.abs(this.biggest) * 100}%`,
- background: this.category.color
+ background: this.category.color,
}
},
- amount () {
- if (this.total >= 1000000) {
- return (this.total / 1000000).toFixed(2) + 'm'
- }
- else if (this.total >= 10000) {
- return (this.total / 1000).toFixed() + 'k'
- }
- else if (this.total > 999) {
- return (this.total / 1000).toFixed(1) + 'k'
- }
+ amount() {
+ if (this.total >= 1000000)
+ return `${(this.total / 1000000).toFixed(2)}m`
+
+ else if (this.total >= 10000)
+ return `${(this.total / 1000).toFixed()}k`
+
+ else if (this.total > 999)
+ return `${(this.total / 1000).toFixed(1)}k`
return this.total.toFixed()
- }
+ },
},
methods: {
- handleMouseEnter (e) {
+ handleMouseEnter(e) {
if (this.$store.state.ui.pc) {
const parent = e.target.parentNode
const parentScrollLeft = parent.scrollLeft
@@ -55,12 +54,11 @@ export default {
}
},
- handleMouseLeave (e) {
- if (this.$store.state.ui.pc) {
+ handleMouseLeave(e) {
+ if (this.$store.state.ui.pc)
this.$emit('onActiveCategoryChange', { categoryId: null })
- }
- }
- }
+ },
+ },
}
</script>
diff --git a/components/stat/cats/PeriodCatsChartPopup.vue b/components/stat/cats/PeriodCatsChartPopup.vue
index 80c56437..78555246 100644
--- a/components/stat/cats/PeriodCatsChartPopup.vue
+++ b/components/stat/cats/PeriodCatsChartPopup.vue
@@ -3,33 +3,33 @@ export default {
props: {
categoryId: {
type: String,
- default: null
+ default: null,
},
offset: {
type: Number,
- required: true
+ required: true,
},
type: {
type: String,
- required: true
- }
+ required: true,
+ },
},
computed: {
- amount () {
+ amount() {
if (this.$store.getters['stat/statCurrentPeriod'].categories[this.categoryId])
return this.$store.getters['stat/statCurrentPeriod'].categories[this.categoryId][this.type]
return null
},
- categoryName () {
+ categoryName() {
if (this.$store.state.categories.items[this.categoryId])
return this.$store.state.categories.items[this.categoryId].name
return null
- }
- }
+ },
+ },
}
</script>
diff --git a/components/stat/chartOptions.js b/components/stat/chartOptions.js
index 6f2fca52..4d815f82 100644
--- a/components/stat/chartOptions.js
+++ b/components/stat/chartOptions.js
@@ -6,7 +6,7 @@ export default {
spacing: [5, 0, 0, 0],
type: 'column',
panning: true,
- panKey: 'shift'
+ panKey: 'shift',
},
title: { text: null },
@@ -15,22 +15,22 @@ export default {
legend: {
itemHiddenStyle: {
fontWeight: 'normal',
- color: 'var(--c-font-5)'
+ color: 'var(--c-font-5)',
},
itemStyle: {
fontWeight: 'normal',
- color: 'var(--c-font-4)'
+ color: 'var(--c-font-4)',
},
itemHoverStyle: {
fontWeight: 'normal',
- color: 'var(--c-font-4)'
- }
+ color: 'var(--c-font-4)',
+ },
},
plotOptions: {
areaspline: {
fillOpacity: 0.3,
- borderWidth: 2
+ borderWidth: 2,
},
column: {
@@ -38,16 +38,16 @@ export default {
pointPadding: 0.1,
borderWidth: 0,
maxPointWidth: 10,
- borderRadius: 3
+ borderRadius: 3,
},
spline: {
lineWidth: 2,
states: {
hover: {
- lineWidth: 2
- }
- }
+ lineWidth: 2,
+ },
+ },
},
pie: {
@@ -58,17 +58,17 @@ export default {
filter: {
property: 'percentage',
operator: '>',
- value: 4
- }
+ value: 4,
+ },
},
- startAngle: 270
+ startAngle: 270,
},
series: {
states: {
inactive: {
- opacity: 1
- }
+ opacity: 1,
+ },
},
marker: {
@@ -76,7 +76,7 @@ export default {
fillColor: 'var(--c-bg-4)',
lineWidth: 2,
lineColor: 'var(--c-incomes-1)',
- symbol: 'circle'
+ symbol: 'circle',
},
dataLabels: {
@@ -94,10 +94,10 @@ export default {
fontSize: '10px',
fontFamily: 'var(--font-secondary)',
fontWeight: 400,
- textTransform: 'uppercase'
- }
- }
- }
+ textTransform: 'uppercase',
+ },
+ },
+ },
},
xAxis: {
@@ -116,9 +116,9 @@ export default {
color: 'var(--c-font-5)',
fontSize: '10px',
fontFamily: 'var(--font-secondary)',
- textTransform: 'uppercase'
- }
- }
+ textTransform: 'uppercase',
+ },
+ },
},
yAxis: {
@@ -134,9 +134,9 @@ export default {
color: 'var(--c-font-5)',
fontSize: '12px',
fontFamily: 'var(--font-secondary)',
- textTransform: 'uppercase'
- }
- }
+ textTransform: 'uppercase',
+ },
+ },
},
tooltip: {
@@ -154,7 +154,7 @@ export default {
style: {
color: 'var(--c-font-2)',
fontSize: '12px',
- fontFamily: 'var(--font-roboto)'
- }
- }
+ fontFamily: 'var(--font-roboto)',
+ },
+ },
}
diff --git a/components/stat/filter/Index.vue b/components/stat/filter/Index.vue
index d91ee991..cb63c7cf 100644
--- a/components/stat/filter/Index.vue
+++ b/components/stat/filter/Index.vue
@@ -2,7 +2,7 @@
import useFilter from '~/modules/filter/useFilter'
export default {
- setup () {
+ setup() {
const { $store } = useNuxtApp()
const { setCategoryFilter, setWalletFilter } = useFilter()
@@ -30,24 +30,24 @@ export default {
filterWallet,
onClearFilter,
- onClearCategory
+ onClearCategory,
}
},
methods: {
- clearCategoryFilter () {
+ clearCategoryFilter() {
const nextCategoryId = this.filterCategory.parentId !== 0 ? this.filterCategory.parentId : null
this.setCategoryFilter(nextCategoryId)
},
- clearParentCategoryFilter () {
+ clearParentCategoryFilter() {
this.setCategoryFilter(null)
},
- clearWalletFilter () {
+ clearWalletFilter() {
this.setWalletFilter(null)
- }
- }
+ },
+ },
}
</script>
diff --git a/components/stat/group/Chart.vue b/components/stat/group/Chart.vue
index 8b16ba3c..19087eea 100644
--- a/components/stat/group/Chart.vue
+++ b/components/stat/group/Chart.vue
@@ -8,7 +8,7 @@ export default {
name: 'StatChartLines',
components: {
- Chart
+ Chart,
},
props: {
@@ -16,10 +16,10 @@ export default {
disableCategoryFilter: { type: Boolean, default: false },
isShowExpenses: { type: Boolean, default: true },
categoryId: { type: String, default: null },
- amountType: { type: String, default: null }
+ amountType: { type: String, default: null },
},
- setup () {
+ setup() {
const { $store } = useNuxtApp()
const { isShowDataLabels } = useChart()
const { filterPeriodNameAllReplacedToYear, scrollTop } = useFilter()
@@ -37,7 +37,7 @@ export default {
const chartObj = ref({})
const chartCallback = (v) => { chartObj.value = v }
- const onClickChart = async (event) => {
+ const onClickChart = async(event) => {
const chart = chartObj.value
if (!chart)
return
@@ -56,7 +56,7 @@ export default {
}, 100)
}
- watch(() => $store.state.filter.date, async () => {
+ watch(() => $store.state.filter.date, async() => {
await nextTick()
const chart = chartObj.value
@@ -69,8 +69,8 @@ export default {
plotBands: [{
color: 'var(--c-item-bg-active)',
from: chartSeriesIdx + 0.5,
- to: chartSeriesIdx - 0.5
- }]
+ to: chartSeriesIdx - 0.5,
+ }],
})
}
}, { immediate: true })
@@ -81,12 +81,12 @@ export default {
isShowDataLabels,
chartType,
filterPeriodNameAllReplacedToYear,
- scrollTop
+ scrollTop,
}
},
computed: {
- chartData () {
+ chartData() {
const periodName = this.filterPeriodNameAllReplacedToYear
const chartPeriods = this.$store.state.chart.periods
const trns = this.$store.state.trns.items
@@ -109,7 +109,7 @@ export default {
date: periodDate,
periodName,
categoryId: null,
- disableCategoryFilter: this.disableCategoryFilter
+ disableCategoryFilter: this.disableCategoryFilter,
})
const periodTotal = this.$store.getters['trns/getTotalOfTrnsIds'](trnsIds)
@@ -123,17 +123,17 @@ export default {
// Incomes
incomesData.unshift({
date: periodDate,
- y: Number(`${periodTotal.incomes.toFixed()}`)
+ y: Number(`${periodTotal.incomes.toFixed()}`),
})
// Expenses
expensesData.unshift({
date: periodDate,
- y: Number(`${periodTotal.expenses.toFixed()}`)
+ y: Number(`${periodTotal.expenses.toFixed()}`),
})
// Total
totalData.unshift({
date: periodDate,
- y: Number(`${(periodTotal.total).toFixed()}`)
+ y: Number(`${(periodTotal.total).toFixed()}`),
})
categories.unshift(name)
}
@@ -166,8 +166,8 @@ export default {
color: 'var(--c-incomes-1)',
data: incomesData,
marker: {
- lineColor: 'var(--c-incomes-1)'
- }
+ lineColor: 'var(--c-incomes-1)',
+ },
}, {
zIndex: 2,
visible: periodsTotalExpenses > 0 && this.isShowExpenses,
@@ -176,8 +176,8 @@ export default {
color: 'var(--c-expenses-1)',
data: expensesData,
marker: {
- lineColor: 'var(--c-expenses-1)'
- }
+ lineColor: 'var(--c-expenses-1)',
+ },
// Fake data to make good hover on bar chart
}, {
zIndex: 1,
@@ -195,17 +195,17 @@ export default {
hover: {
fillColor: 'transparent',
lineColor: 'transparent',
- lineWidth: 0
- }
- }
+ lineWidth: 0,
+ },
+ },
},
dataLabels: {
- enabled: false
- }
+ enabled: false,
+ },
}],
categories,
averageIncomes: periodsTotalIncomes / periods,
- averageExpenses: periodsTotalExpenses / periodsExpenses
+ averageExpenses: periodsTotalExpenses / periodsExpenses,
}
const tooltip = this.$store.state.ui.pc ? { ...chartOptions.tooltip } : { enabled: false }
@@ -219,7 +219,7 @@ export default {
xAxis: {
...chartOptions.xAxis,
- categories: data.categories
+ categories: data.categories,
},
yAxis: {
@@ -229,19 +229,19 @@ export default {
color: 'var(--c-expenses-opacity)',
value: data.averageExpenses,
width: '2',
- zIndex: 1
+ zIndex: 1,
}, {
opacity: 0.5,
color: 'var(--c-incomes-opacity)',
value: data.averageIncomes,
width: '2',
- zIndex: 1
- }]
+ zIndex: 1,
+ }],
},
chart: {
...chartOptions.chart,
- height: '180'
+ height: '180',
},
plotOptions: {
@@ -250,13 +250,13 @@ export default {
...chartOptions.plotOptions.series,
dataLabels: {
...chartOptions.plotOptions.series.dataLabels,
- enabled: this.isShowDataLabels
- }
- }
- }
+ enabled: this.isShowDataLabels,
+ },
+ },
+ },
}
- }
- }
+ },
+ },
}
</script>
diff --git a/components/stat/group/Empty.vue b/components/stat/group/Empty.vue
index 6ee12690..c05c8053 100644
--- a/components/stat/group/Empty.vue
+++ b/components/stat/group/Empty.vue
@@ -3,19 +3,19 @@ import useStatPage from '~/components/stat/useStatPage'
export default defineComponent({
props: {
- typeText: { type: String, required: true }
+ typeText: { type: String, required: true },
},
- setup (props) {
+ setup(props) {
const { typeText } = toRefs(props)
const { statPage } = useStatPage()
const isShow = computed(() => statPage.current[typeText.value]?.categoriesIds?.length === 0)
return {
- isShow
+ isShow,
}
- }
+ },
})
</script>
diff --git a/components/stat/group/Sum.vue b/components/stat/group/Sum.vue
index c74a8722..c48ffded 100644
--- a/components/stat/group/Sum.vue
+++ b/components/stat/group/Sum.vue
@@ -4,10 +4,10 @@ import useStat from '~/modules/stat/useStat'
export default defineComponent({
props: {
- typeText: { type: String, required: true }
+ typeText: { type: String, required: true },
},
- setup (props) {
+ setup(props) {
const { typeText } = toRefs(props)
const { statPage } = useStatPage()
const { moneyTypes } = useStat()
@@ -15,9 +15,9 @@ export default defineComponent({
return {
statPage,
- typeNumber
+ typeNumber,
}
- }
+ },
})
</script>
diff --git a/components/stat/group/Trns.vue b/components/stat/group/Trns.vue
index b793023c..3581569a 100644
--- a/components/stat/group/Trns.vue
+++ b/components/stat/group/Trns.vue
@@ -2,13 +2,13 @@
import useStatPage from '~/components/stat/useStatPage'
export default defineComponent({
- setup () {
+ setup() {
const { statPage } = useStatPage()
return {
- statPage
+ statPage,
}
- }
+ },
})
</script>
diff --git a/components/stat/group/cats/Horizontal.vue b/components/stat/group/cats/Horizontal.vue
index 60dae0e5..b05f654b 100644
--- a/components/stat/group/cats/Horizontal.vue
+++ b/components/stat/group/cats/Horizontal.vue
@@ -5,10 +5,10 @@ import useUIView from '~/components/layout/useUIView'
export default defineComponent({
props: {
- typeText: { type: String, required: true }
+ typeText: { type: String, required: true },
},
- setup (props) {
+ setup(props) {
const { typeText } = toRefs(props)
const { statPage } = useStatPage()
const { ui } = useUIView()
@@ -20,9 +20,9 @@ export default defineComponent({
return {
statPage,
isShow,
- typeNumber
+ typeNumber,
}
- }
+ },
})
</script>
diff --git a/components/stat/group/cats/Pie.vue b/components/stat/group/cats/Pie.vue
index ab27c32c..1ef9dfdd 100644
--- a/components/stat/group/cats/Pie.vue
+++ b/components/stat/group/cats/Pie.vue
@@ -4,10 +4,10 @@ import useUIView from '~/components/layout/useUIView'
export default defineComponent({
props: {
- typeText: { type: String, required: true }
+ typeText: { type: String, required: true },
},
- setup (props) {
+ setup(props) {
const { typeText } = toRefs(props)
const { statPage } = useStatPage()
const { ui } = useUIView()
@@ -15,9 +15,9 @@ export default defineComponent({
const isShow = computed(() => ui.showPieChart && statPage.current[typeText.value]?.categoriesIds?.length)
return {
- isShow
+ isShow,
}
- }
+ },
})
</script>
diff --git a/components/stat/group/cats/Round.vue b/components/stat/group/cats/Round.vue
index a3fc0d23..d97b22fb 100644
--- a/components/stat/group/cats/Round.vue
+++ b/components/stat/group/cats/Round.vue
@@ -5,10 +5,10 @@ import useUIView from '~/components/layout/useUIView'
export default defineComponent({
props: {
- typeText: { type: String, required: true }
+ typeText: { type: String, required: true },
},
- setup (props) {
+ setup(props) {
const { typeText } = toRefs(props)
const { statPage } = useStatPage()
const { moneyTypes } = useStat()
@@ -49,9 +49,9 @@ export default defineComponent({
isShow,
typeNumber,
incomesRef,
- expensesRef
+ expensesRef,
}
- }
+ },
})
</script>
diff --git a/components/stat/group/cats/Vertical.vue b/components/stat/group/cats/Vertical.vue
index f51f89a3..15e98a82 100644
--- a/components/stat/group/cats/Vertical.vue
+++ b/components/stat/group/cats/Vertical.vue
@@ -4,10 +4,10 @@ import useUIView from '~/components/layout/useUIView'
export default defineComponent({
props: {
- typeText: { type: String, required: true }
+ typeText: { type: String, required: true },
},
- setup (props) {
+ setup(props) {
const { typeText } = toRefs(props)
const { statPage } = useStatPage()
const { ui } = useUIView()
@@ -15,9 +15,9 @@ export default defineComponent({
const isShow = computed(() => ui.showCatsVerticalChart && statPage.current[typeText.value]?.categoriesIds?.length)
return {
- isShow
+ isShow,
}
- }
+ },
})
</script>
diff --git a/components/stat/sum/Total.vue b/components/stat/sum/Total.vue
index e57ef8da..cc30bc4e 100644
--- a/components/stat/sum/Total.vue
+++ b/components/stat/sum/Total.vue
@@ -1,15 +1,15 @@
<script>
export default defineComponent({
- setup () {
+ setup() {
const { $store } = useNuxtApp()
const statCurrentPeriod = computed(() => $store.getters['stat/statCurrentPeriod'])
const statAverage = computed(() => $store.getters['stat/statAverage'])
return {
statCurrentPeriod,
- statAverage
+ statAverage,
}
- }
+ },
})
</script>
diff --git a/components/stat/useStatChart.ts b/components/stat/useStatChart.ts
index 1d6e13c6..25593afc 100644
--- a/components/stat/useStatChart.ts
+++ b/components/stat/useStatChart.ts
@@ -3,23 +3,23 @@ type MoneyType = 'incomes' | 'expenses'
const state = reactive({
show: {
incomes: true,
- expenses: true
- }
+ expenses: true,
+ },
})
-export default function useStatChart () {
+export default function useStatChart() {
const { $store } = useNuxtApp()
const activeTabStat = computed(() => $store.state.ui.activeTabStat)
- function setChart (type: MoneyType, value: boolean): void {
+ function setChart(type: MoneyType, value: boolean): void {
state.show[type] = value
}
- function toogle (type: MoneyType): void {
+ function toogle(type: MoneyType): void {
state.show[type] = !state.show[type]
}
- function onWatch () {
+ function onWatch() {
watch(activeTabStat, () => {
switch (activeTabStat.value) {
case 'incomes':
@@ -41,6 +41,6 @@ export default function useStatChart () {
return {
chartState: state,
toogleChart: toogle,
- onWatch
+ onWatch,
}
}
diff --git a/components/stat/useStatPage.ts b/components/stat/useStatPage.ts
index 2681e24a..92532217 100644
--- a/components/stat/useStatPage.ts
+++ b/components/stat/useStatPage.ts
@@ -1,4 +1,4 @@
-export default function useStatPage () {
+export default function useStatPage() {
const { $store } = useNuxtApp()
const activeTabStat = computed(() => $store.state.ui.activeTabStat)
@@ -21,10 +21,10 @@ export default function useStatPage () {
...filter,
isShow: isShowFilter,
period: filterPeriod,
- date: filterDate
+ date: filterDate,
},
- isHasTrns
- })
+ isHasTrns,
+ }),
}
}
diff --git a/components/summary/SummaryAverage.vue b/components/summary/SummaryAverage.vue
index 33011ead..75c74ba0 100644
--- a/components/summary/SummaryAverage.vue
+++ b/components/summary/SummaryAverage.vue
@@ -3,14 +3,14 @@ export default {
name: 'SummaryAverage',
computed: {
- statCurrentPeriod () {
+ statCurrentPeriod() {
return this.$store.getters['stat/statCurrentPeriod']
},
- statAverage () {
+ statAverage() {
return this.$store.getters['stat/statAverage']
- }
- }
+ },
+ },
}
</script>
diff --git a/components/summary/SummaryRowItem.vue b/components/summary/SummaryRowItem.vue
index 88fceec5..bd69a358 100644
--- a/components/summary/SummaryRowItem.vue
+++ b/components/summary/SummaryRowItem.vue
@@ -5,28 +5,28 @@ export default {
props: {
name: {
type: String,
- required: true
+ required: true,
},
amount: {
type: Number,
- required: true
+ required: true,
},
type: {
type: Number,
- required: true
- }
+ required: true,
+ },
},
computed: {
- className () {
+ className() {
return {
_expenses: this.type === 0,
- _incomes: this.type === 1
+ _incomes: this.type === 1,
}
- }
- }
+ },
+ },
}
</script>
diff --git a/components/themeEditor/ThemeEditor.vue b/components/themeEditor/ThemeEditor.vue
index 069f840c..d08c211c 100644
--- a/components/themeEditor/ThemeEditor.vue
+++ b/components/themeEditor/ThemeEditor.vue
@@ -4,7 +4,7 @@ import '@simonwep/pickr/dist/themes/classic.min.css'
export default {
name: 'ThemeEditor',
- data () {
+ data() {
return {
colors: [
'--c-bg-1',
@@ -20,21 +20,21 @@ export default {
'--c-bg-11',
'--c-bg-12',
'--c-bg-13',
- '--c-bg-14'
- ]
+ '--c-bg-14',
+ ],
}
},
- mounted () {
+ mounted() {
this.initPickrs()
},
methods: {
- setColor (name, color) {
+ setColor(name, color) {
document.documentElement.style.setProperty(name, color)
},
- initPickrs () {
+ initPickrs() {
for (const colorItem of this.colors) {
const colorIdx = this.colors.indexOf(colorItem)
const element = document.querySelector([`.initPickElement${colorIdx}`])
@@ -57,16 +57,16 @@ export default {
hsla: true,
hsva: true,
cmyk: true,
- input: true
- }
- }
+ input: true,
+ },
+ },
}).on('change', (color) => {
const hexColor = color.toHEXA().toString()
this.setColor(colorItem, hexColor)
})
}
- }
- }
+ },
+ },
}
</script>
diff --git a/components/trnForm/TrnForm.vue b/components/trnForm/TrnForm.vue
index 3e8f9f8a..3aae02cc 100644
--- a/components/trnForm/TrnForm.vue
+++ b/components/trnForm/TrnForm.vue
@@ -7,7 +7,7 @@ import generateId from '~/utils/id'
import useCalculator from '~/components/trnForm/calculator/useCalculator'
import useTrnFormValidate from '~/components/trnForm/useTrnFormValidate'
-import { successEmo, random } from '~/assets/js/emo'
+import { random, successEmo } from '~/assets/js/emo'
SwiperCore.use([Pagination])
@@ -15,10 +15,10 @@ export default {
name: 'TrnForm',
props: {
- show: { type: Boolean, default: true }
+ show: { type: Boolean, default: true },
},
- setup (props) {
+ setup(props) {
const { $store } = useNuxtApp()
/**
* Slider
@@ -28,7 +28,7 @@ export default {
const maxHeight = ref('550px')
const { clearExpression } = useCalculator()
- function setTrnFormHeight () {
+ function setTrnFormHeight() {
const el = document.querySelector('.getHeight')
const height = el.clientHeight
@@ -45,7 +45,7 @@ export default {
observer.observe(el)
}
- function init () {
+ function init() {
if (!sliderObj.value) {
sliderObj.value = new SwiperCore(slider.value, {
init: false,
@@ -59,8 +59,8 @@ export default {
longSwipesMs: 60,
pagination: {
el: '.trnForm__pagination',
- clickable: false
- }
+ clickable: false,
+ },
})
setTrnFormHeight()
sliderObj.value.init()
@@ -91,21 +91,21 @@ export default {
/**
* Click on category
*/
- function onCategoryClick (categoryId) {
+ function onCategoryClick(categoryId) {
$store.commit('trnForm/setTrnFormValues', { categoryId })
}
/**
* Click on wallet
*/
- function onClickWallet (walletId) {
+ function onClickWallet(walletId) {
$store.commit('trnForm/setTrnFormValues', { walletId })
}
/**
* Prepare values
*/
- function prepeareValues (): any {
+ function prepeareValues(): any {
let normalizedValues
const id = $store.state.trnForm.values.trnId || generateId(dayjs().valueOf())
@@ -120,7 +120,7 @@ export default {
description: $store.state.trnForm.values.description || null,
groups: $store.state.trnForm.values.groups || null,
type: Number($store.state.trnForm.values.amountType) || 0,
- walletId: $store.state.trnForm.values.walletId
+ walletId: $store.state.trnForm.values.walletId,
}
}
@@ -138,25 +138,25 @@ export default {
groups: $store.state.trnForm.values.groups || null,
expense: {
walletId: $store.state.trnForm.values.walletFromId,
- amount: getResult.value
+ amount: getResult.value,
},
income: {
walletId: $store.state.trnForm.values.walletToId,
- amount: getResult.value
- }
+ amount: getResult.value,
+ },
}
}
return {
id,
- values: normalizedValues
+ values: normalizedValues,
}
}
/**
* Submit form
*/
- function handleSubmitForm () {
+ function handleSubmitForm() {
try {
const { validate } = useTrnFormValidate()
const { id, values } = prepeareValues()
@@ -164,14 +164,14 @@ export default {
const validateStatus = validate({
...values,
walletFrom: $store.getters['wallets/getWalletWithId']($store.state.trnForm.values.walletFromId),
- walletTo: $store.getters['wallets/getWalletWithId']($store.state.trnForm.values.walletToId)
+ walletTo: $store.getters['wallets/getWalletWithId']($store.state.trnForm.values.walletToId),
})
if (validateStatus.error) {
Vue.notify({
type: 'error',
title: validateStatus.error.title,
- text: validateStatus.error.text
+ text: validateStatus.error.text,
})
return
}
@@ -179,7 +179,7 @@ export default {
Vue.notify({
type: 'success',
text: 'Excellent transaction!',
- title: random(successEmo)
+ title: random(successEmo),
})
$store.dispatch('trns/addTrn', { id, values })
@@ -201,9 +201,9 @@ export default {
onCategoryClick,
onClickWallet,
- handleSubmitForm
+ handleSubmitForm,
}
- }
+ },
}
</script>
diff --git a/components/trnForm/TrnFormAmount.vue b/components/trnForm/TrnFormAmount.vue
index 6bbb0bd9..b0871646 100644
--- a/components/trnForm/TrnFormAmount.vue
+++ b/components/trnForm/TrnFormAmount.vue
@@ -2,7 +2,7 @@
import useCalculator from '~/components/trnForm/calculator/useCalculator'
export default {
- setup () {
+ setup() {
const { $store } = useNuxtApp()
const { isSum, getResult, expression } = useCalculator()
const amountType = computed(() => $store.state.trnForm.values.amountType)
@@ -14,13 +14,13 @@ export default {
expression,
className: computed(() => ({
_expenses: amountType.value === 0,
- _incomes: amountType.value === 1
- }))
+ _incomes: amountType.value === 1,
+ })),
}
},
methods: {
- handleChangeAmountType () {
+ handleChangeAmountType() {
let nextAmountType = 0
switch (this.amountType) {
@@ -34,10 +34,10 @@ export default {
}
this.$store.commit('trnForm/setTrnFormValues', {
- amountType: nextAmountType
+ amountType: nextAmountType,
})
- }
- }
+ },
+ },
}
</script>
diff --git a/components/trnForm/TrnFormCalendar.vue b/components/trnForm/TrnFormCalendar.vue
index ff92b98f..d2a3e8ee 100644
--- a/components/trnForm/TrnFormCalendar.vue
+++ b/components/trnForm/TrnFormCalendar.vue
@@ -3,30 +3,30 @@ import { formatDate } from '~/utils/formatDate'
export default {
computed: {
- formatedDate () {
+ formatedDate() {
const date = formatDate(this.$store.state.trnForm.values.date, 'full')
return `${date.weekday}, ${date.day} ${date.month}`
},
- isToday () {
+ isToday() {
return this.$day().isSame(this.$store.state.trnForm.values.date, 'day')
- }
+ },
},
methods: {
- setPrevDay () {
+ setPrevDay() {
this.$store.commit('trnForm/setTrnFormValues', {
- date: this.$day(this.$store.state.trnForm.values.date).subtract(1, 'day').valueOf()
+ date: this.$day(this.$store.state.trnForm.values.date).subtract(1, 'day').valueOf(),
})
},
- setNextDay () {
+ setNextDay() {
if (!this.isToday) {
this.$store.commit('trnForm/setTrnFormValues', {
- date: this.$day(this.$store.state.trnForm.values.date).add(1, 'day').valueOf()
+ date: this.$day(this.$store.state.trnForm.values.date).add(1, 'day').valueOf(),
})
}
- }
- }
+ },
+ },
}
</script>
diff --git a/components/trnForm/TrnFormCategories.vue b/components/trnForm/TrnFormCategories.vue
index 71756553..02e78900 100644
--- a/components/trnForm/TrnFormCategories.vue
+++ b/components/trnForm/TrnFormCategories.vue
@@ -5,13 +5,13 @@ import 'swiper/swiper-bundle.css'
export default {
name: 'TrnFormCategories',
- data () {
+ data() {
return {
- slider: null
+ slider: null,
}
},
- mounted () {
+ mounted() {
const initialSlide = 1
this.slider = new Swiper(this.$refs.trnFormCategories, {
@@ -22,12 +22,12 @@ export default {
initialSlide,
shortSwipes: false,
longSwipesRatio: 0.1,
- longSwipesMs: 60
+ longSwipesMs: 60,
})
},
methods: {
- handleCategoryClick (categoryId) {
+ handleCategoryClick(categoryId) {
if (this.$store.getters['categories/isCategoryHasChildren'](categoryId)) {
this.$store.commit('trnForm/setTrnFormModalCategoryId', categoryId)
this.$store.commit('trnForm/showTrnFormModal', 'categoriesChild')
@@ -36,8 +36,8 @@ export default {
this.$emit('closeModal')
this.$store.commit('trnForm/setTrnFormValues', { categoryId })
}
- }
- }
+ },
+ },
}
</script>
diff --git a/components/trnForm/TrnFormHeader.vue b/components/trnForm/TrnFormHeader.vue
index fc0f37bc..01990d9e 100644
--- a/components/trnForm/TrnFormHeader.vue
+++ b/components/trnForm/TrnFormHeader.vue
@@ -1,6 +1,6 @@
<script>
export default {
- name: 'TrnFormHeader'
+ name: 'TrnFormHeader',
}
</script>
diff --git a/components/trnForm/TrnFormHeaderItemCategory.vue b/components/trnForm/TrnFormHeaderItemCategory.vue
index 6810bdee..a27a5bae 100644
--- a/components/trnForm/TrnFormHeaderItemCategory.vue
+++ b/components/trnForm/TrnFormHeaderItemCategory.vue
@@ -3,15 +3,15 @@ export default {
// TODO: add check for valid category
computed: {
- category () {
+ category() {
const categoryId = this.$store.state.trnForm.values.categoryId
return this.$store.state.categories.items[categoryId]
},
- parentCategory () {
+ parentCategory() {
return this.$store.state.categories.items[this.category.parentId]
- }
- }
+ },
+ },
}
</script>
diff --git a/components/trnForm/TrnFormHeaderItemWallet.vue b/components/trnForm/TrnFormHeaderItemWallet.vue
index 1d7fd70c..ebceed47 100644
--- a/components/trnForm/TrnFormHeaderItemWallet.vue
+++ b/components/trnForm/TrnFormHeaderItemWallet.vue
@@ -4,11 +4,11 @@ export default {
name: 'TrnFormHeaderItemWallet',
computed: {
- wallet () {
+ wallet() {
const walletId = this.$store.state.trnForm.values.walletId
return this.$store.state.wallets.items[walletId]
- }
- }
+ },
+ },
}
</script>
diff --git a/components/trnForm/TrnFormHeaderTransfer.vue b/components/trnForm/TrnFormHeaderTransfer.vue
index 98c8a789..d4c869a6 100644
--- a/components/trnForm/TrnFormHeaderTransfer.vue
+++ b/components/trnForm/TrnFormHeaderTransfer.vue
@@ -1,38 +1,38 @@
<script>
export default {
- fetch () {
+ fetch() {
if (this.$store.state.trnForm.values.amountType === 2) {
this.$store.commit('trnForm/setTrnFormValues', {
walletFromId: this.walletFromId,
- walletToId: this.walletToId
+ walletToId: this.walletToId,
})
}
else {
this.$store.commit('trnForm/setTrnFormTransfer', {
tranferType: 'from',
- walletId: this.walletFromId
+ walletId: this.walletFromId,
})
this.$store.commit('trnForm/setTrnFormTransfer', {
tranferType: 'to',
- walletId: this.walletToId
+ walletId: this.walletToId,
})
}
},
computed: {
- walletFromId () {
+ walletFromId() {
return this.$store.state.trnForm.values.walletFromId || this.$store.state.trnForm.values.walletId || this.$store.getters['wallets/walletsSortedIds'][0]
},
- walletFrom () {
+ walletFrom() {
return this.$store.state.wallets.items && this.$store.state.wallets.items[this.walletFromId]
},
- walletToId () {
+ walletToId() {
return this.$store.state.trnForm.values.walletToId || this.$store.getters['wallets/walletsSortedIds'][1] || this.$store.state.trnForm.values.walletId
},
- walletTo () {
+ walletTo() {
return this.$store.state.wallets.items && this.$store.state.wallets.items[this.walletToId]
- }
- }
+ },
+ },
}
</script>
diff --git a/components/trnForm/TrnFormTrns.vue b/components/trnForm/TrnFormTrns.vue
index 5862eb18..0a4ca737 100644
--- a/components/trnForm/TrnFormTrns.vue
+++ b/components/trnForm/TrnFormTrns.vue
@@ -4,28 +4,28 @@ export default defineComponent({
categoryId: { type: String, default: null },
limit: { type: Number, default: 0 },
size: { type: Number, required: false, default: 10 },
- slider: { type: Object, required: true }
+ slider: { type: Object, required: true },
},
- data () {
+ data() {
return {
pageNumber: 1,
sortByEditDate: false,
- filterBy: 'wallet'
+ filterBy: 'wallet',
}
},
computed: {
- isShowedAllTrns () {
+ isShowedAllTrns() {
return this.paginatedTrnsIds.length === this.trnsIds.length
},
- paginatedTrnsIds () {
+ paginatedTrnsIds() {
const end = this.pageNumber * this.size
return this.trnsIds.slice(0, end)
},
- filterTrns () {
+ filterTrns() {
const filter = {}
if (this.filterBy === 'wallet') {
filter.walletId = this.$store.state.trnForm.values.walletId
@@ -37,10 +37,10 @@ export default defineComponent({
return filter
},
- trnsIds () {
+ trnsIds() {
const trns = this.$store.state.trns.items
let trnsIds = this.$store.getters['trns/getTrnsIds']({
- ...this.filterTrns
+ ...this.filterTrns,
})
// from category
@@ -52,7 +52,7 @@ export default defineComponent({
return trnsIds
},
- groupedTrns () {
+ groupedTrns() {
const trns = this.$store.state.trns.items
const trnsIds = this.paginatedTrnsIds
const trnsList = {}
@@ -70,11 +70,11 @@ export default defineComponent({
trnsList[dayDate].push(trnId)
}
return trnsList
- }
+ },
},
methods: {
- showMoreTrns () {
+ showMoreTrns() {
this.pageNumber = this.pageNumber + 1
setTimeout(() => {
this.slider.update()
@@ -82,7 +82,7 @@ export default defineComponent({
}, 100)
},
- changeFilter (filterBy) {
+ changeFilter(filterBy) {
const trnForm = document.querySelector('.trnForm')
const trnsListScroll = trnForm.querySelector('.trnsListScroll')
trnsListScroll.scrollTop = 0
@@ -92,8 +92,8 @@ export default defineComponent({
setTimeout(() => {
this.slider.slideTo(0, 0)
}, 100)
- }
- }
+ },
+ },
})
</script>
diff --git a/components/trnForm/TrnFormTypes.vue b/components/trnForm/TrnFormTypes.vue
index f0d839fd..f07e26b7 100644
--- a/components/trnForm/TrnFormTypes.vue
+++ b/components/trnForm/TrnFormTypes.vue
@@ -2,22 +2,22 @@
export default {
name: 'TrnFormTypes',
- setup () {
+ setup() {
const { $store } = useNuxtApp()
const amountType = computed(() => $store.state.trnForm.values.amountType)
- function setAmountType (amountType) {
+ function setAmountType(amountType) {
$store.commit('trnForm/setTrnFormValues', {
- amountType
+ amountType,
})
}
return {
amountType,
- setAmountType
+ setAmountType,
}
- }
+ },
}
</script>
diff --git a/components/trnForm/calculator/TrnFormCalculator.vue b/components/trnForm/calculator/TrnFormCalculator.vue
index 1c842a0c..ff7d8b6b 100644
--- a/components/trnForm/calculator/TrnFormCalculator.vue
+++ b/components/trnForm/calculator/TrnFormCalculator.vue
@@ -5,7 +5,7 @@ import './long-press-event'
export default {
name: 'TrnFormCalculator',
- setup () {
+ setup() {
const { $store } = useNuxtApp()
const amountType = computed(() => $store.state.trnForm.values.amountType)
@@ -15,7 +15,7 @@ export default {
clearExpression,
handleTouch,
isSum,
- keyboardHandler
+ keyboardHandler,
} = useCalculator()
// Mounted
@@ -37,9 +37,9 @@ export default {
isSum,
deleteRef,
- handleTouch
+ handleTouch,
}
- }
+ },
}
</script>
diff --git a/components/trnForm/calculator/long-press-event.js b/components/trnForm/calculator/long-press-event.js
index 2c3b16f8..aae70cc7 100644
--- a/components/trnForm/calculator/long-press-event.js
+++ b/components/trnForm/calculator/long-press-event.js
@@ -5,7 +5,7 @@
* @author John Doherty <www.johndoherty.info>
* @license MIT
*/
-(function (window, document) {
+(function(window, document) {
'use strict'
// local timer object based on rAF
@@ -27,7 +27,7 @@
// patch CustomEvent to allow constructor creation (IE/Chrome)
if (typeof window.CustomEvent !== 'function') {
- window.CustomEvent = function (event, params) {
+ window.CustomEvent = function(event, params) {
params = params || { bubbles: false, cancelable: false, detail: undefined }
const evt = document.createEvent('CustomEvent')
@@ -39,12 +39,12 @@
}
// requestAnimationFrame() shim by Paul Irish
- window.requestAnimFrame = (function () {
- return window.requestAnimationFrame ||
- window.webkitRequestAnimationFrame ||
- window.mozRequestAnimationFrame ||
- window.oRequestAnimationFrame ||
- window.msRequestAnimationFrame || function (callback) {
+ window.requestAnimFrame = (function() {
+ return window.requestAnimationFrame
+ || window.webkitRequestAnimationFrame
+ || window.mozRequestAnimationFrame
+ || window.oRequestAnimationFrame
+ || window.msRequestAnimationFrame || function(callback) {
window.setTimeout(callback, 1000 / 60)
}
})()
@@ -55,24 +55,23 @@
* @param {int} delay The delay in milliseconds
* @returns {object} handle to the timeout object
*/
- function requestTimeout (fn, delay) {
- if (!window.requestAnimationFrame && !window.webkitRequestAnimationFrame &&
- !(window.mozRequestAnimationFrame && window.mozCancelRequestAnimationFrame) && // Firefox 5 ships without cancel support
- !window.oRequestAnimationFrame && !window.msRequestAnimationFrame) { return window.setTimeout(fn, delay) }
+ function requestTimeout(fn, delay) {
+ if (!window.requestAnimationFrame && !window.webkitRequestAnimationFrame
+ && !(window.mozRequestAnimationFrame && window.mozCancelRequestAnimationFrame) // Firefox 5 ships without cancel support
+ && !window.oRequestAnimationFrame && !window.msRequestAnimationFrame) return window.setTimeout(fn, delay)
const start = new Date().getTime()
const handle = {}
- const loop = function () {
+ const loop = function() {
const current = new Date().getTime()
const delta = current - start
- if (delta >= delay) {
+ if (delta >= delay)
fn.call()
- }
- else {
+
+ else
handle.value = requestAnimFrame(loop)
- }
}
handle.value = requestAnimFrame(loop)
@@ -85,7 +84,7 @@
* @param {object} handle The callback function
* @returns {void}
*/
- function clearRequestTimeout (handle) {
+ function clearRequestTimeout(handle) {
if (handle) {
window.cancelAnimationFrame ? window.cancelAnimationFrame(handle.value)
: window.webkitCancelAnimationFrame ? window.webkitCancelAnimationFrame(handle.value)
@@ -105,10 +104,9 @@
* @param {object} e - default browser event object
* @returns {object} regular event object
*/
- function normaliseEvent (e) {
- if (isTouch && e.touches && e.touches[0]) {
+ function normaliseEvent(e) {
+ if (isTouch && e.touches && e.touches[0])
return e.touches[0]
- }
return e
}
@@ -118,7 +116,7 @@
* @param {MouseEvent|TouchEvent} originalEvent The original event being fired
* @returns {void}
*/
- function fireLongPressEvent (originalEvent) {
+ function fireLongPressEvent(originalEvent) {
clearLongPressTimer()
originalEvent = normaliseEvent(originalEvent)
@@ -131,7 +129,7 @@
// custom event data (legacy)
detail: {
clientX: originalEvent.clientX,
- clientY: originalEvent.clientY
+ clientY: originalEvent.clientY,
},
// add coordinate data that would typically acompany a touch/click event
@@ -142,12 +140,12 @@
pageX: originalEvent.pageX,
pageY: originalEvent.pageY,
screenX: originalEvent.screenX,
- screenY: originalEvent.screenY
+ screenY: originalEvent.screenY,
}))
if (!allowClickEvent) {
// supress the next click event if e.preventDefault() was called in long-press handler
- document.addEventListener('click', function suppressEvent (e) {
+ document.addEventListener('click', function suppressEvent(e) {
document.removeEventListener('click', suppressEvent, true)
cancelEvent(e)
}, true)
@@ -159,7 +157,7 @@
* @param {event} e - event object
* @returns {void}
*/
- function startLongPressTimer (e) {
+ function startLongPressTimer(e) {
clearLongPressTimer(e)
const el = e.target
@@ -176,7 +174,7 @@
* @param {event} e - event object
* @returns {void}
*/
- function clearLongPressTimer (e) {
+ function clearLongPressTimer(e) {
clearRequestTimeout(timer)
timer = null
}
@@ -186,7 +184,7 @@
* @param {object} e - browser event object
* @returns {void}
*/
- function cancelEvent (e) {
+ function cancelEvent(e) {
e.stopImmediatePropagation()
e.preventDefault()
e.stopPropagation()
@@ -197,7 +195,7 @@
* @param {object} e - browser event object
* @returns {void}
*/
- function mouseDownHandler (e) {
+ function mouseDownHandler(e) {
startX = e.clientX
startY = e.clientY
startLongPressTimer(e)
@@ -208,15 +206,14 @@
* @param {object} e - browser event object
* @returns {void}
*/
- function mouseMoveHandler (e) {
+ function mouseMoveHandler(e) {
// calculate total number of pixels the pointer has moved
const diffX = Math.abs(startX - e.clientX)
const diffY = Math.abs(startY - e.clientY)
// if pointer has moved more than allowed, cancel the long-press timer and therefore the event
- if (diffX >= maxDiffX || diffY >= maxDiffY) {
+ if (diffX >= maxDiffX || diffY >= maxDiffY)
clearLongPressTimer(e)
- }
}
/**
@@ -226,14 +223,13 @@
* @param {any} defaultValue - default value to return if no match found
* @returns {any} attribute value or defaultValue
*/
- function getNearestAttribute (el, attributeName, defaultValue) {
+ function getNearestAttribute(el, attributeName, defaultValue) {
// walk up the dom tree looking for data-action and data-trigger
while (el && el !== document.documentElement) {
const attributeValue = el.getAttribute(attributeName)
- if (attributeValue) {
+ if (attributeValue)
return attributeValue
- }
el = el.parentNode
}
diff --git a/components/trnForm/calculator/useCalculator.ts b/components/trnForm/calculator/useCalculator.ts
index e9edcdaf..a495197f 100644
--- a/components/trnForm/calculator/useCalculator.ts
+++ b/components/trnForm/calculator/useCalculator.ts
@@ -3,18 +3,18 @@ import currency from 'currency.js'
const baseAmountFormat = (value: string, separator: string, symbol?: string) => currency(value, { symbol, precision: 0, pattern: '#', separator }).format()
// State
-const fixed: number = 2
+const fixed = 2
const expression = ref('0')
const separator = ref(' ')
const isKeysActive = ref(true)
-export default function useCalculator () {
+export default function useCalculator() {
/**
* Set separator
*
* @param {string} sep
*/
- function setSeparator (sep: string): void {
+ function setSeparator(sep: string): void {
separator.value = sep
expression.value = formatInput(expression.value)
}
@@ -24,7 +24,7 @@ export default function useCalculator () {
*
* @param {string} value
*/
- function setExpression (value: string): void {
+ function setExpression(value: string): void {
expression.value = formatInput(value)
}
@@ -33,7 +33,7 @@ export default function useCalculator () {
*
* @param {boolean} value
*/
- function setKeysActive (value: boolean): void {
+ function setKeysActive(value: boolean): void {
isKeysActive.value = value
}
@@ -43,7 +43,7 @@ export default function useCalculator () {
* @param {string} value
* @return {string[]}
*/
- function separateExpression (value: string): string[] {
+ function separateExpression(value: string): string[] {
return value
.split(/(\/|\*|-|\+)/)
.filter(i => i)
@@ -55,11 +55,11 @@ export default function useCalculator () {
* @param {string} value
* @return {string}
*/
- function removeSpaces (value:string): string {
+ function removeSpaces(value: string): string {
return String(value).replace(/[ ,]/g, '')
}
- function checkIsLastSimbolAction (lastSimbol:string): boolean {
+ function checkIsLastSimbolAction(lastSimbol: string): boolean {
return Number.isNaN(Number.parseInt(lastSimbol))
}
@@ -69,7 +69,7 @@ export default function useCalculator () {
* @param {string} value
* @return {(string | undefined)}
*/
- function makeCalculation (value: string) : string {
+ function makeCalculation(value: string): string {
try {
const clearedExpression = removeSpaces(value)
const lastSimbol = clearedExpression.slice(-1)
@@ -77,7 +77,7 @@ export default function useCalculator () {
const prepeatedExpression = isLastSimbolAction ? clearedExpression.slice(0, -1) : clearedExpression
// eslint-disable-next-line no-new-func
- const math = Function('"use strict";return (' + prepeatedExpression + ')')()
+ const math = Function(`"use strict";return (${prepeatedExpression})`)()
if (math <= Number.MAX_SAFE_INTEGER)
return String(Math.abs(math))
@@ -97,7 +97,7 @@ export default function useCalculator () {
* @param {string} value
* @return {string} expression
*/
- function createExpressionString (expression: string, value: string): string {
+ function createExpressionString(expression: string, value: string): string {
const inputIsAction = Number.isNaN(Number.parseInt(value))
// Last simbol of expression
@@ -135,7 +135,7 @@ export default function useCalculator () {
if (inputIsAction && isDotAction) {
if (Array.isArray(clearedExpression.split(/[/*\-+]/)) && (clearedExpression.split(/[/*\-+]/).slice(-1)[0].includes('.') || isLastSimbolAction)) {
if (isLastSimbolAction && lastSimbol !== '.')
- return clearedExpression + '0.'
+ return `${clearedExpression}0.`
return expression
}
@@ -182,7 +182,7 @@ export default function useCalculator () {
* @param {boolean} [isTrimFloatSpaces]
* @return {string} expression string
*/
- function formatInput (value: string, isTrimFloatSpaces?: boolean): string {
+ function formatInput(value: string, isTrimFloatSpaces?: boolean): string {
const formatedArray = separateExpression(String(value))
.map((item) => {
let formatedItem = ''
@@ -205,7 +205,7 @@ export default function useCalculator () {
formatedItem = baseAmountFormat(item, separator.value)
else
- formatedItem = baseAmountFormat(splitFloatValue[0], separator.value) + '.' + splitFloatValue[1]
+ formatedItem = `${baseAmountFormat(splitFloatValue[0], separator.value)}.${splitFloatValue[1]}`
}
return formatedItem
})
@@ -213,16 +213,16 @@ export default function useCalculator () {
return formatedArray.join('')
}
- function clearExpression (): void {
+ function clearExpression(): void {
expression.value = '0'
}
- function handleTouch (input: string): void {
+ function handleTouch(input: string): void {
const expressionValue = createExpressionString(expression.value, input)
expression.value = formatInput(expressionValue)
}
- function keyboardHandler (event: KeyboardEvent): void {
+ function keyboardHandler(event: KeyboardEvent): void {
if (!isKeysActive.value) return
const allowValue = (event.key).match(/[0-9%/*\-+=.,]|Backspace|Enter/)
@@ -262,6 +262,6 @@ export default function useCalculator () {
createExpressionString,
setSeparator,
handleTouch,
- removeSpaces
+ removeSpaces,
}
}
diff --git a/components/trnForm/modal/TrnFormModal.vue b/components/trnForm/modal/TrnFormModal.vue
index f04c2dfd..006333d1 100644
--- a/components/trnForm/modal/TrnFormModal.vue
+++ b/components/trnForm/modal/TrnFormModal.vue
@@ -1,14 +1,14 @@
<script lang="ts">
export default defineComponent({
- setup () {
+ setup() {
const documentHeight = ref('100%')
onMounted(() => {
documentHeight.value = `${document.documentElement.clientHeight}px`
})
return {
- documentHeight
+ documentHeight,
}
- }
+ },
})
</script>
diff --git a/components/trnForm/modal/TrnFormModalCalendar.vue b/components/trnForm/modal/TrnFormModalCalendar.vue
index 656ec857..41ace685 100644
--- a/components/trnForm/modal/TrnFormModalCalendar.vue
+++ b/components/trnForm/modal/TrnFormModalCalendar.vue
@@ -3,17 +3,17 @@ import Datepicker from 'vuejs-datepicker'
const calendarOptions = {
'use-utc': true,
- disabledDates: {
- from: new Date()
- }
+ 'disabledDates': {
+ from: new Date(),
+ },
}
export default {
components: {
- Datepicker
+ Datepicker,
},
- setup () {
+ setup() {
const { $store } = useNuxtApp()
const date = computed(() => $store.state.trnForm.values.date)
@@ -21,33 +21,33 @@ export default {
return {
date,
- closeModal
+ closeModal,
}
},
- created () {
+ created() {
this.calendarOptions = calendarOptions
},
methods: {
- handleSelectDate (date, close) {
+ handleSelectDate(date, close) {
this.$store.commit('trnForm/setTrnFormValues', {
- date: this.$day(date).valueOf()
+ date: this.$day(date).valueOf(),
})
close()
},
- handleSelectDateDaysAgo (daysAgo, close) {
+ handleSelectDateDaysAgo(daysAgo, close) {
this.$store.commit('trnForm/setTrnFormValues', {
- date: this.$day().subtract(daysAgo, 'day').valueOf()
+ date: this.$day().subtract(daysAgo, 'day').valueOf(),
})
close()
},
- afterClose () {
+ afterClose() {
this.$store.commit('trnForm/closeTrnFormModal', 'calendar')
- }
- }
+ },
+ },
}
</script>
diff --git a/components/trnForm/modal/TrnFormModalCats.vue b/components/trnForm/modal/TrnFormModalCats.vue
index 7b8757c3..83894fb6 100644
--- a/components/trnForm/modal/TrnFormModalCats.vue
+++ b/components/trnForm/modal/TrnFormModalCats.vue
@@ -3,10 +3,10 @@ export default {
name: 'TrnFormModalCats',
methods: {
- afterClose () {
+ afterClose() {
this.$store.commit('trnForm/closeTrnFormModal', 'categories')
- }
- }
+ },
+ },
}
</script>
diff --git a/components/trnForm/modal/TrnFormModalCatsChild.vue b/components/trnForm/modal/TrnFormModalCatsChild.vue
index b885f3e3..f374cd44 100644
--- a/components/trnForm/modal/TrnFormModalCatsChild.vue
+++ b/components/trnForm/modal/TrnFormModalCatsChild.vue
@@ -1,38 +1,38 @@
<script>
export default {
- data () {
+ data() {
return {
- childSelected: false
+ childSelected: false,
}
},
computed: {
- id () {
+ id() {
return this.$store.state.trnForm.showModalCategoryId
},
- category () {
+ category() {
return this.$store.state.categories.items[this.id]
},
- childCategoriesIds () {
+ childCategoriesIds() {
return this.$store.getters['categories/getChildCategoriesIds'](this.id)
- }
+ },
},
methods: {
- handleCategoryClick (categoryId, close) {
+ handleCategoryClick(categoryId, close) {
this.childSelected = true
this.$store.commit('trnForm/setTrnFormValues', { categoryId })
close()
},
- afterClose () {
+ afterClose() {
if (this.childSelected)
this.$store.commit('trnForm/closeTrnFormModal', 'categories')
this.$store.commit('trnForm/closeTrnFormModal', 'categoriesChild')
this.$store.commit('trnForm/setTrnFormModalCategoryId', null)
- }
- }
+ },
+ },
}
</script>
diff --git a/components/trnForm/modal/TrnFormModalDescription.vue b/components/trnForm/modal/TrnFormModalDescription.vue
index e3eb9959..2cb10ea6 100644
--- a/components/trnForm/modal/TrnFormModalDescription.vue
+++ b/components/trnForm/modal/TrnFormModalDescription.vue
@@ -4,7 +4,7 @@ import useCalculator from '~/components/trnForm/calculator/useCalculator'
export default {
name: 'TrnFormModalDescription',
- setup () {
+ setup() {
const { $store } = useNuxtApp()
const { setKeysActive } = useCalculator()
const description = ref('')
@@ -16,26 +16,26 @@ export default {
return {
description,
- setKeysActive
+ setKeysActive,
}
},
methods: {
- handleCancel (close) {
+ handleCancel(close) {
this.description = null
close()
},
- handleSave (close) {
+ handleSave(close) {
this.$store.commit('trnForm/setTrnFormValues', { description: this.description })
close()
},
- afterClose () {
+ afterClose() {
this.setKeysActive(true)
this.$store.commit('trnForm/closeTrnFormModal', 'description')
- }
- }
+ },
+ },
}
</script>
diff --git a/components/trnForm/modal/TrnFormModalTransferFrom.vue b/components/trnForm/modal/TrnFormModalTransferFrom.vue
index 4946b5b8..56947164 100644
--- a/components/trnForm/modal/TrnFormModalTransferFrom.vue
+++ b/components/trnForm/modal/TrnFormModalTransferFrom.vue
@@ -1,25 +1,25 @@
<script>
export default {
- setup () {
+ setup() {
const { $store } = useNuxtApp()
- function onClickWallet (walletId, close) {
+ function onClickWallet(walletId, close) {
$store.commit('trnForm/setTrnFormValues', {
walletFromId: walletId,
- walletId
+ walletId,
})
close()
}
- function afterClose () {
+ function afterClose() {
$store.commit('trnForm/closeTrnFormModal', 'transferFrom')
}
return {
onClickWallet,
- afterClose
+ afterClose,
}
- }
+ },
}
</script>
diff --git a/components/trnForm/modal/TrnFormModalTransferTo.vue b/components/trnForm/modal/TrnFormModalTransferTo.vue
index 383ca841..bbad0bf7 100644
--- a/components/trnForm/modal/TrnFormModalTransferTo.vue
+++ b/components/trnForm/modal/TrnFormModalTransferTo.vue
@@ -1,25 +1,25 @@
<script lang="ts">
export default {
- setup () {
+ setup() {
const { $store } = useNuxtApp()
- function onClickWallet (walletId, close) {
+ function onClickWallet(walletId, close) {
$store.commit('trnForm/setTrnFormValues', {
walletToId: walletId,
- walletId
+ walletId,
})
close()
}
- function afterClose () {
+ function afterClose() {
$store.commit('trnForm/closeTrnFormModal', 'transferTo')
}
return {
onClickWallet,
- afterClose
+ afterClose,
}
- }
+ },
}
</script>
diff --git a/components/trnForm/modal/TrnFormModalWallets.vue b/components/trnForm/modal/TrnFormModalWallets.vue
index 243ee4fb..fed8278f 100644
--- a/components/trnForm/modal/TrnFormModalWallets.vue
+++ b/components/trnForm/modal/TrnFormModalWallets.vue
@@ -1,15 +1,15 @@
<script>
export default {
methods: {
- handleSetWallet (walletId, close) {
+ handleSetWallet(walletId, close) {
this.$store.commit('trnForm/setTrnFormValues', { walletId })
close()
},
- afterClose () {
+ afterClose() {
this.$store.commit('trnForm/closeTrnFormModal', 'wallets')
- }
- }
+ },
+ },
}
</script>
diff --git a/components/trnForm/useTrnFormValidate.ts b/components/trnForm/useTrnFormValidate.ts
index 67be5640..0e390689 100644
--- a/components/trnForm/useTrnFormValidate.ts
+++ b/components/trnForm/useTrnFormValidate.ts
@@ -1,13 +1,13 @@
-export default function useTrnFormValidate () {
- function validate (values: any) {
+export default function useTrnFormValidate() {
+ function validate(values: any) {
const errorTitle = '😮'
if (!values.amount) {
return {
error: {
title: errorTitle,
- text: 'Amount can not be empty'
- }
+ text: 'Amount can not be empty',
+ },
}
}
@@ -15,8 +15,8 @@ export default function useTrnFormValidate () {
return {
error: {
title: errorTitle,
- text: 'Amount can not be negative number'
- }
+ text: 'Amount can not be negative number',
+ },
}
}
@@ -24,8 +24,8 @@ export default function useTrnFormValidate () {
return {
error: {
title: errorTitle,
- text: 'Amount can not be equal Zero'
- }
+ text: 'Amount can not be equal Zero',
+ },
}
}
@@ -33,8 +33,8 @@ export default function useTrnFormValidate () {
return {
error: {
title: errorTitle,
- text: 'Please select wallet'
- }
+ text: 'Please select wallet',
+ },
}
}
@@ -42,8 +42,8 @@ export default function useTrnFormValidate () {
return {
error: {
title: errorTitle,
- text: 'Please select category'
- }
+ text: 'Please select category',
+ },
}
}
@@ -53,8 +53,8 @@ export default function useTrnFormValidate () {
return {
error: {
title: errorTitle,
- text: 'Transfer in same wallet'
- }
+ text: 'Transfer in same wallet',
+ },
}
}
@@ -62,18 +62,18 @@ export default function useTrnFormValidate () {
return {
error: {
title: errorTitle,
- text: 'Sorry, transfer between wallets with different currency in development'
- }
+ text: 'Sorry, transfer between wallets with different currency in development',
+ },
}
}
}
return {
- valid: true
+ valid: true,
}
}
return {
- validate
+ validate,
}
}
diff --git a/components/trns/Modal.vue b/components/trns/Modal.vue
index 38a59bd4..a821fedc 100644
--- a/components/trns/Modal.vue
+++ b/components/trns/Modal.vue
@@ -3,7 +3,7 @@ import useFilter from '~/modules/filter/useFilter'
import useCalculator from '~/components/trnForm/calculator/useCalculator'
export default {
- setup () {
+ setup() {
const { $store } = useNuxtApp()
const { setCategoryFilter, setWalletFilter } = useFilter()
@@ -15,33 +15,33 @@ export default {
return {
setCategoryFilter,
setWalletFilter,
- closed
+ closed,
}
},
- data () {
+ data() {
return {
- showModalConfirm: false
+ showModalConfirm: false,
}
},
computed: {
- trnId () {
+ trnId() {
return this.$store.state.trns.modal.id
},
- trn () {
+ trn() {
return this.$store.state.trns.items[this.trnId]
},
- category () {
+ category() {
return this.$store.state.categories.items[this.$store.state.trns.items[this.trnId].categoryId]
},
- wallet () {
+ wallet() {
return this.$store.state.wallets.items[this.$store.state.trns.items[this.trnId].walletId]
- }
+ },
},
methods: {
- handleSetFilterCategory () {
+ handleSetFilterCategory() {
this.setCategoryFilter(this.$store.state.trns.items[this.trnId].categoryId)
this.$store.commit('filter/setFilterDateNow')
this.$store.commit('trns/hideTrnModal')
@@ -50,7 +50,7 @@ export default {
this.$store.dispatch('ui/setActiveTabStat', 'details')
},
- handleSetFilterWallet () {
+ handleSetFilterWallet() {
this.setWalletFilter(this.$store.state.trns.items[this.trnId].walletId)
this.$store.commit('trns/hideTrnModal')
this.$store.commit('trns/setTrnModalId', null)
@@ -58,7 +58,7 @@ export default {
this.$store.dispatch('ui/setActiveTabStat', 'details')
},
- handleDublicateTrn () {
+ handleDublicateTrn() {
const trnId = this.trnId
this.$store.dispatch('trnForm/openTrnForm', { action: 'duplicate', trnId })
this.$store.commit('trns/hideTrnModal')
@@ -66,7 +66,7 @@ export default {
this.$store.commit('stat/setCategoryModal', { id: null, type: null })
},
- handleEditClick () {
+ handleEditClick() {
const trn = this.trn
const trnId = this.trnId
this.$store.dispatch('trnForm/openTrnForm', { action: 'edit', trnId })
@@ -78,19 +78,19 @@ export default {
setExpression(trn.amount)
},
- handleDeleteClick () {
+ handleDeleteClick() {
this.showModalConfirm = true
},
- handleDeleteConfirm () {
+ handleDeleteConfirm() {
const trnId = this.trnId
setTimeout(() => { this.$store.dispatch('trns/deleteTrn', trnId) }, 100)
this.showModalConfirm = false
this.$store.commit('trns/hideTrnModal')
this.$store.commit('trns/setTrnModalId', null)
- }
- }
+ },
+ },
}
</script>
diff --git a/components/trns/item/Details.vue b/components/trns/item/Details.vue
index 452d1d49..ea29fe51 100644
--- a/components/trns/item/Details.vue
+++ b/components/trns/item/Details.vue
@@ -2,8 +2,8 @@
export default defineComponent({
props: {
trnId: { type: String, required: true },
- trnItem: { type: Object, required: true }
- }
+ trnItem: { type: Object, required: true },
+ },
})
</script>
diff --git a/components/trns/item/History.vue b/components/trns/item/History.vue
index 49f58aca..3188160b 100644
--- a/components/trns/item/History.vue
+++ b/components/trns/item/History.vue
@@ -5,10 +5,10 @@ import useFilter from '~/modules/filter/useFilter'
export default defineComponent({
props: {
- trnId: { type: String, required: true }
+ trnId: { type: String, required: true },
},
- setup ({ trnId }) {
+ setup({ trnId }) {
const { $store } = useNuxtApp()
const { setExpression } = useCalculator()
const { setCategoryFilter } = useFilter()
@@ -39,14 +39,14 @@ export default defineComponent({
$store.commit('trns/setTrnModalId', null)
$store.commit('stat/setCategoryModal', { id: null, type: null })
$store.dispatch('ui/setActiveTabStat', 'details')
- }
+ },
}
return {
actions,
- trnItem
+ trnItem,
}
- }
+ },
})
</script>
diff --git a/components/trns/item/TrnItem.vue b/components/trns/item/TrnItem.vue
index 0829a18b..f41a1201 100644
--- a/components/trns/item/TrnItem.vue
+++ b/components/trns/item/TrnItem.vue
@@ -10,30 +10,30 @@ export default {
trn: { type: Object, required: true },
trnId: { type: String, required: true },
ui: { type: String, default: 'history' },
- wallet: { type: Object, required: true }
+ wallet: { type: Object, required: true },
},
computed: {
- className () {
+ className() {
return {
_active: this.isActive,
_detailed: this.ui === 'detailed',
_history: this.ui === 'history' || (this.ui === 'stat' && this.showCategory),
- _stat: this.ui === 'stat'
+ _stat: this.ui === 'stat',
}
},
- formatedDate () {
+ formatedDate() {
const date = formatDate(this.trn.date, 'full')
return `${date.weekday}, ${date.day} ${date.month} ${date.year}`
},
- formatedDateDay () {
+ formatedDateDay() {
return formatDate(this.trn.date, 'trnItem')
},
- formatedDateDay2 () {
+ formatedDateDay2() {
return formatDate(this.trn.date, 'trnItem')
},
- filterTrnsDate () {
+ filterTrnsDate() {
const date = this.trn.date
const walletId = this.trn.walletId
@@ -43,11 +43,11 @@ export default {
const total = this.$store.getters['trns/getTotalOfTrnsIds'](trnsIds, true)
return total
- }
+ },
},
methods: {
- handleClick () {
+ handleClick() {
if (!this.$store.state.trns.modal.show) {
this.$store.commit('categories/hideCategoryModal')
this.$store.commit('trns/showTrnModal')
@@ -55,15 +55,15 @@ export default {
}
},
- setTrnEdit () {
+ setTrnEdit() {
const trnId = this.trnId
const { setExpression } = useCalculator()
setExpression(this.trn.amount)
this.$store.dispatch('trnForm/openTrnForm', { action: 'edit', trnId })
this.$store.commit('stat/setCategoryModal', { id: null, type: null })
this.$emit('onClickEdit', this.trnId)
- }
- }
+ },
+ },
}
</script>
diff --git a/components/trns/item/WithoutCat.vue b/components/trns/item/WithoutCat.vue
index e3718842..f12d34c0 100644
--- a/components/trns/item/WithoutCat.vue
+++ b/components/trns/item/WithoutCat.vue
@@ -5,13 +5,13 @@ import useTrn from '~/components/trns/item/useTrn'
export default defineComponent({
props: {
actions: { type: Object, required: false, default: () => ({}) },
- trnId: { type: String, required: true }
+ trnId: { type: String, required: true },
},
- setup ({ trnId, actions }) {
+ setup({ trnId, actions }) {
const { formatTrnItem, formatDate } = useTrn()
const trnItem = computed(() => formatTrnItem(trnId))
- // @ts-ignore
+ // @ts-expect-error
const { onOpenDetails, onOpenEdit, onSetFilter } = actions(trnItem.value)
return {
@@ -20,9 +20,9 @@ export default defineComponent({
onOpenEdit,
onSetFilter,
- formatDate
+ formatDate,
}
- }
+ },
})
</script>
diff --git a/components/trns/item/useTrn.ts b/components/trns/item/useTrn.ts
index 724ecbfe..11d23df6 100644
--- a/components/trns/item/useTrn.ts
+++ b/components/trns/item/useTrn.ts
@@ -1,9 +1,9 @@
import { formatDate } from '~/utils/formatDate'
-export default function useTrn () {
+export default function useTrn() {
const { $store } = useNuxtApp()
- function formatTrnItem (id) {
+ function formatTrnItem(id) {
try {
const { trns, wallets, categories } = $store.state
@@ -51,7 +51,7 @@ export default function useTrn () {
// Date
let dateFormated = formatDate(trn.date, 'full')
- // @ts-ignore
+ // @ts-expect-error
dateFormated = `${dateFormated.weekday}, ${dateFormated.day} ${dateFormated.month} ${dateFormated.year}`
return {
@@ -62,7 +62,7 @@ export default function useTrn () {
categoryParent,
walletFrom,
walletTo,
- wallet
+ wallet,
}
}
catch (error) {
@@ -72,6 +72,6 @@ export default function useTrn () {
return {
formatTrnItem,
- formatDate
+ formatDate,
}
}
diff --git a/components/trns/list/TrnsList.vue b/components/trns/list/TrnsList.vue
index 85df1786..6ac564ad 100644
--- a/components/trns/list/TrnsList.vue
+++ b/components/trns/list/TrnsList.vue
@@ -11,10 +11,10 @@ export default defineComponent({
limit: { type: Number, default: 0 },
size: { type: Number, required: false, default: 30 },
ui: { type: String, default: 'history' },
- classNames: { type: String, default: '' }
+ classNames: { type: String, default: '' },
},
- setup () {
+ setup() {
const { $store } = useNuxtApp()
const { setExpression } = useCalculator()
const { setCategoryFilter } = useFilter()
@@ -43,21 +43,21 @@ export default defineComponent({
$store.commit('trns/setTrnModalId', null)
$store.commit('stat/setCategoryModal', { id: null, type: null })
$store.dispatch('ui/setActiveTabStat', 'details')
- }
+ },
})
return { actions }
},
- data () {
+ data() {
return {
pageNumber: 1,
- isShowTrnsWithDesc: false
+ isShowTrnsWithDesc: false,
}
},
computed: {
- trnsIds () {
+ trnsIds() {
const trns = this.$store.state.trns.items
let trnsIds = this.$store.getters['trns/selectedTrnsIdsWithDate']
@@ -72,16 +72,16 @@ export default defineComponent({
return trnsIds
},
- isShowedAllTrns () {
+ isShowedAllTrns() {
return this.paginatedTrnsIds.length === this.trnsIdsWithLimit.length
},
- isTrnsWithDescription () {
+ isTrnsWithDescription() {
const trns = this.$store.state.trns.items
return this.trnsIds.filter(id => trns[id].description).length > 0
},
- trnsIdsWithLimit () {
+ trnsIdsWithLimit() {
const trns = this.$store.state.trns.items
if (this.isShowFilter && this.isShowTrnsWithDesc && this.isTrnsWithDescription)
@@ -93,12 +93,12 @@ export default defineComponent({
return this.trnsIds
},
- paginatedTrnsIds () {
+ paginatedTrnsIds() {
const end = this.pageNumber * this.size
return this.trnsIdsWithLimit.slice(0, end)
},
- groupedTrns () {
+ groupedTrns() {
const trns = this.$store.state.trns.items
const trnsList = {}
@@ -111,18 +111,18 @@ export default defineComponent({
}
return trnsList
- }
+ },
},
methods: {
- showMoreTrns () {
+ showMoreTrns() {
this.pageNumber = this.pageNumber + 1
},
- showTrnsWithDesc () {
+ showTrnsWithDesc() {
this.isShowTrnsWithDesc = !this.isShowTrnsWithDesc
- }
- }
+ },
+ },
})
</script>
diff --git a/components/trns/list/TrnsListDate.vue b/components/trns/list/TrnsListDate.vue
index 8a3f7bda..5b30efe5 100644
--- a/components/trns/list/TrnsListDate.vue
+++ b/components/trns/list/TrnsListDate.vue
@@ -5,15 +5,15 @@ export default {
props: {
date: {
type: String,
- required: true
- }
+ required: true,
+ },
},
computed: {
- formatedDate () {
+ formatedDate() {
return formatDate(this.date, 'full')
- }
- }
+ },
+ },
}
</script>
diff --git a/components/trns/list/TrnsListHistory.vue b/components/trns/list/TrnsListHistory.vue
index eebe9318..872ff82d 100644
--- a/components/trns/list/TrnsListHistory.vue
+++ b/components/trns/list/TrnsListHistory.vue
@@ -3,32 +3,32 @@ export default defineComponent({
props: {
isShowFilter: { type: Boolean, default: false },
limit: { type: Number, default: 0 },
- size: { type: Number, required: false, default: 30 }
+ size: { type: Number, required: false, default: 30 },
},
- data () {
+ data() {
return {
pageNumber: 1,
sortByEditDate: false,
- isShowTrnsWithDesc: false
+ isShowTrnsWithDesc: false,
}
},
computed: {
- trnsIds () {
+ trnsIds() {
return this.$store.getters['trns/selectedTrnsIds']
},
- isShowedAllTrns () {
+ isShowedAllTrns() {
return this.paginatedTrnsIds.length === this.trnsIdsWithLimit.length
},
- isTrnsWithDescription () {
+ isTrnsWithDescription() {
const trns = this.$store.state.trns.items
return this.trnsIds.filter(id => trns[id].description).length > 0
},
- trnsIdsWithLimit () {
+ trnsIdsWithLimit() {
const trns = this.$store.state.trns.items
if (this.isShowFilter && this.isShowTrnsWithDesc && this.isTrnsWithDescription)
@@ -40,12 +40,12 @@ export default defineComponent({
return this.trnsIds
},
- paginatedTrnsIds () {
+ paginatedTrnsIds() {
const end = this.pageNumber * this.size
return this.trnsIdsWithLimit.slice(0, end)
},
- groupedTrns () {
+ groupedTrns() {
const trns = this.$store.state.trns.items
const trnsList = {}
@@ -61,18 +61,18 @@ export default defineComponent({
}
return trnsList
- }
+ },
},
methods: {
- showMoreTrns () {
+ showMoreTrns() {
this.pageNumber = this.pageNumber + 1
},
- showTrnsWithDesc () {
+ showTrnsWithDesc() {
this.isShowTrnsWithDesc = !this.isShowTrnsWithDesc
- }
- }
+ },
+ },
})
</script>
diff --git a/components/wallets/Modal.vue b/components/wallets/Modal.vue
index 4dd511ec..0c0e2463 100644
--- a/components/wallets/Modal.vue
+++ b/components/wallets/Modal.vue
@@ -3,7 +3,7 @@ import { removeData } from '~/services/firebaseHelpers'
import useFilter from '~/modules/filter/useFilter'
export default {
- setup () {
+ setup() {
const { $store } = useNuxtApp()
const { setWalletFilter } = useFilter()
@@ -17,49 +17,49 @@ export default {
if (!id) return
return {
...$store.state.wallets.items[id],
- total: $store.getters['wallets/walletsTotal'][id].base
+ total: $store.getters['wallets/walletsTotal'][id].base,
}
})
return {
setWalletFilter,
closed,
- wallet
+ wallet,
}
},
- data () {
+ data() {
return {
- showModalConfirm: false
+ showModalConfirm: false,
}
},
computed: {
- deleteInfo () {
+ deleteInfo() {
if (this.trnsIds.length > 0)
return `It's also will delete ${this.trnsIds.length} trns in this wallet`
return null
},
- walletId () {
+ walletId() {
return this.$store.state.wallets.modal.id
},
- trnsIds () {
+ trnsIds() {
const trns = this.$store.state.trns.items
const trnsIds = []
for (const trnId in trns) {
- if (trns[trnId].walletId === this.walletId ||
- trns[trnId].walletFromId === this.walletId ||
- trns[trnId].walletToId === this.walletId)
+ if (trns[trnId].walletId === this.walletId
+ || trns[trnId].walletFromId === this.walletId
+ || trns[trnId].walletToId === this.walletId)
trnsIds.push(trnId)
}
return trnsIds
- }
+ },
},
methods: {
- handleSetFilterWallet () {
+ handleSetFilterWallet() {
this.setWalletFilter(this.walletId)
this.$store.commit('filter/setFilterDateNow')
@@ -69,7 +69,7 @@ export default {
this.$store.dispatch('ui/setActiveTabStat', 'details')
},
- handleEditClick () {
+ handleEditClick() {
const walletId = this.walletId
this.$store.commit('wallets/hideWalletsModalWalletModal')
this.$store.commit('wallets/setWalletsModalWalletModalId', null)
@@ -77,11 +77,11 @@ export default {
this.$store.dispatch('ui/setActiveTab', 'createWallet')
},
- handleDeleteClick () {
+ handleDeleteClick() {
this.showModalConfirm = true
},
- handleDeleteConfirm () {
+ handleDeleteConfirm() {
const trnsIds = this.trnsIds
const uid = this.$store.state.user.user.uid
const id = this.walletId
@@ -90,13 +90,13 @@ export default {
this.$store.commit('wallets/hideWalletsModalWalletModal')
this.$store.commit('wallets/setWalletsModalWalletModalId', null)
- setTimeout(async () => {
+ setTimeout(async() => {
await this.$store.dispatch('trns/deleteTrnsByIds', trnsIds)
removeData(`users/${uid}/accounts/${id}`)
.then(() => console.log('wallet deleted'))
}, 200)
- }
- }
+ },
+ },
}
</script>
diff --git a/components/wallets/form/WalletForm.vue b/components/wallets/form/WalletForm.vue
index 1e97ecd3..3ea129f3 100644
--- a/components/wallets/form/WalletForm.vue
+++ b/components/wallets/form/WalletForm.vue
@@ -3,7 +3,7 @@ import generateId from '~/utils/id'
import colors from '~/assets/js/colors'
export default {
- data () {
+ data() {
return {
showColors: false,
showCurrencies: false,
@@ -13,52 +13,52 @@ export default {
currency: 'RUB',
isCredit: false,
name: null,
- order: Object.keys(this.$store.state.wallets.items).length || 1
- }
+ order: Object.keys(this.$store.state.wallets.items).length || 1,
+ },
}
},
computed: {
- walletId () {
+ walletId() {
return this.$store.state.wallets.editId
- }
+ },
},
watch: {
walletId: {
- handler (walletId) {
+ handler(walletId) {
if (walletId) {
this.wallet = {
...this.wallet,
- ...this.$store.state.wallets.items[this.walletId]
+ ...this.$store.state.wallets.items[this.walletId],
}
}
},
- immediate: true
- }
+ immediate: true,
+ },
},
- created () {
+ created() {
this.colors = colors
if (!this.$store.state.wallets.editId)
this.wallet.color = colors[Math.floor(Math.random() * colors.length)]
},
- beforeDestroy () {
+ beforeUnmount() {
this.$store.commit('wallets/setWalletEditId', null)
},
methods: {
- handleColorSelect (color) {
+ handleColorSelect(color) {
this.wallet.color = color
this.showColors = false
},
- handleCurrencySelect (currency) {
+ handleCurrencySelect(currency) {
this.wallet.currency = currency
this.showCurrencies = false
},
- handleSubmit () {
+ handleSubmit() {
if (this.validateForm()) {
const id = this.walletId || generateId()
@@ -68,7 +68,7 @@ export default {
currency: this.wallet.currency,
isCredit: this.wallet.isCredit,
name: this.wallet.name,
- order: this.wallet.order
+ order: this.wallet.order,
}
this.$store.dispatch('wallets/addWallet', { id, values: walletsValues })
@@ -78,13 +78,13 @@ export default {
}
},
- validateForm () {
+ validateForm() {
const wallets = this.$store.state.wallets.items
// name
if (!this.wallet.name) {
this.$notify({
title: '😮',
- text: this.$t('wallets.form.name.error')
+ text: this.$t('wallets.form.name.error'),
})
return false
}
@@ -93,7 +93,7 @@ export default {
if (!this.wallet.currency) {
this.$notify({
title: '😮',
- text: this.$t('wallets.form.currency.error')
+ text: this.$t('wallets.form.currency.error'),
})
return false
}
@@ -104,7 +104,7 @@ export default {
if (this.walletId !== walletId) {
this.$notify({
title: '😮',
- text: this.$t('wallets.form.name.exist')
+ text: this.$t('wallets.form.name.exist'),
})
return false
}
@@ -112,7 +112,7 @@ export default {
else {
this.$notify({
title: '😮',
- text: this.$t('wallets.form.name.exist')
+ text: this.$t('wallets.form.name.exist'),
})
return false
}
@@ -120,8 +120,8 @@ export default {
}
return true
- }
- }
+ },
+ },
}
</script>
@@ -319,11 +319,11 @@ LayoutBaseWrap
<i18n lang="json5">
{
- en: {
- isCredit: 'Credit account'
+ "en": {
+ "isCredit": "Credit account"
},
- ru: {
- isCredit: 'Кредитный счёт'
+ "ru": {
+ "isCredit": "Кредитный счёт"
}
}
</i18n>
diff --git a/components/wallets/item/Simple.vue b/components/wallets/item/Simple.vue
index 05835268..c125eab6 100644
--- a/components/wallets/item/Simple.vue
+++ b/components/wallets/item/Simple.vue
@@ -5,24 +5,24 @@ export default defineComponent({
showBase: { type: Boolean, default: true },
vertical: { type: String, default: 'left' },
size: { type: String, default: null },
- activeItemId: { type: String, default: null }
+ activeItemId: { type: String, default: null },
},
computed: {
- wallet () {
+ wallet() {
return {
...this.$store.state.wallets.items[this.id],
- total: this.$store.getters['wallets/walletsTotal'][this.id].base
+ total: this.$store.getters['wallets/walletsTotal'][this.id].base,
}
- }
+ },
},
methods: {
- handleClick () {
+ handleClick() {
if (this.$listeners.onClick)
this.$listeners.onClick(this.id)
- }
- }
+ },
+ },
})
</script>
diff --git a/components/wallets/item/WalletItem.vue b/components/wallets/item/WalletItem.vue
index c266e083..947da725 100644
--- a/components/wallets/item/WalletItem.vue
+++ b/components/wallets/item/WalletItem.vue
@@ -5,24 +5,24 @@ export default defineComponent({
showBase: { type: Boolean, default: true },
vertical: { type: String, default: 'left' },
size: { type: String, default: null },
- activeItemId: { type: String, default: null }
+ activeItemId: { type: String, default: null },
},
computed: {
- wallet () {
+ wallet() {
return {
...this.$store.state.wallets.items[this.id],
- total: this.$store.getters['wallets/walletsTotal'][this.id].base
+ total: this.$store.getters['wallets/walletsTotal'][this.id].base,
}
- }
+ },
},
methods: {
- handleClick () {
+ handleClick() {
if (this.$listeners.onClick)
this.$listeners.onClick(this.id)
- }
- }
+ },
+ },
})
</script>
diff --git a/components/wallets/list/WalletsList.vue b/components/wallets/list/WalletsList.vue
index 89b897b0..b7a4cebf 100644
--- a/components/wallets/list/WalletsList.vue
+++ b/components/wallets/list/WalletsList.vue
@@ -2,36 +2,36 @@
export default {
props: {
limit: { type: [Number, Boolean], default: null },
- showToogle: { type: Boolean, default: false }
+ showToogle: { type: Boolean, default: false },
},
- data () {
+ data() {
return {
- stateLimit: 0
+ stateLimit: 0,
}
},
computed: {
- walletsIds () {
+ walletsIds() {
const walletsIds = this.$store.getters['wallets/walletsSortedIds']
if (this.stateLimit)
return walletsIds.slice(0, this.stateLimit)
return walletsIds
- }
+ },
},
- mounted () {
+ mounted() {
this.stateLimit = this.limit
},
methods: {
- toogleWallets () {
+ toogleWallets() {
this.stateLimit > 0
? this.stateLimit = 0
: this.stateLimit = this.limit
- }
- }
+ },
+ },
}
</script>
diff --git a/components/wallets/list/WalletsList2.vue b/components/wallets/list/WalletsList2.vue
index 4244d23b..3171b49c 100644
--- a/components/wallets/list/WalletsList2.vue
+++ b/components/wallets/list/WalletsList2.vue
@@ -3,24 +3,24 @@ export default {
props: {
limit: {
type: Number,
- default: null
- }
+ default: null,
+ },
},
computed: {
- wallets () {
+ wallets() {
const wallets = {}
for (const walletId of this.$store.getters['wallets/walletsSortedIds']) {
wallets[walletId] = {
...this.$store.state.wallets.items[walletId],
- total: this.$store.getters['wallets/walletsTotal'][walletId].base
+ total: this.$store.getters['wallets/walletsTotal'][walletId].base,
}
}
return wallets
- }
- }
+ },
+ },
}
</script>
diff --git a/components/wallets/list/WalletsList3.vue b/components/wallets/list/WalletsList3.vue
index 826aacbf..1d364a83 100644
--- a/components/wallets/list/WalletsList3.vue
+++ b/components/wallets/list/WalletsList3.vue
@@ -7,35 +7,35 @@ export default {
activeItemId: { type: String, default: null },
limit: { type: [Number, Boolean], default: null },
showBase: { type: Boolean, default: true },
- showToogle: { type: Boolean, default: false }
+ showToogle: { type: Boolean, default: false },
},
- data () {
+ data() {
return {
- stateLimit: 0
+ stateLimit: 0,
}
},
computed: {
- walletsIds () {
+ walletsIds() {
const walletsIds = this.$store.getters['wallets/walletsSortedIds']
if (this.stateLimit) return walletsIds.slice(0, this.stateLimit)
return walletsIds
- }
+ },
},
- mounted () {
+ mounted() {
this.stateLimit = this.limit
},
methods: {
- toogleWallets () {
+ toogleWallets() {
if (this.stateLimit > 0)
this.stateLimit = 0
else
this.stateLimit = this.limit
- }
- }
+ },
+ },
}
</script>
diff --git a/components/wallets/sort/WalletsSort.vue b/components/wallets/sort/WalletsSort.vue
index e99b7dae..09cc9d78 100644
--- a/components/wallets/sort/WalletsSort.vue
+++ b/components/wallets/sort/WalletsSort.vue
@@ -1,17 +1,17 @@
<script>
import draggable from 'vuedraggable'
-import { successEmo, random } from '~/assets/js/emo'
+import { random, successEmo } from '~/assets/js/emo'
export default {
name: 'WalletsSort',
components: {
- draggable
+ draggable,
},
- data () {
+ data() {
return {
- sortedWalletsIds: this.$store.getters['wallets/walletsSortedIds']
+ sortedWalletsIds: this.$store.getters['wallets/walletsSortedIds'],
}
},
@@ -21,7 +21,7 @@ export default {
* Convert them to objects with order value
* Push object with wallets to DB
*/
- async saveWalletsOrder () {
+ async saveWalletsOrder() {
const sortedWallets = {}
for (const [idx, walletId] of this.sortedWalletsIds.entries())
@@ -34,11 +34,11 @@ export default {
this.$notify({
type: 'success',
title: random(successEmo),
- text: 'Saved'
+ text: 'Saved',
})
}
- }
- }
+ },
+ },
}
</script>
diff --git a/components/wallets/total/WalletsTotal.vue b/components/wallets/total/WalletsTotal.vue
index cf13d851..8d835ae1 100644
--- a/components/wallets/total/WalletsTotal.vue
+++ b/components/wallets/total/WalletsTotal.vue
@@ -4,22 +4,22 @@ import useAmount from '~/components/amount/useAmount'
export default {
props: {
isShowCredits: { type: Boolean, default: false },
- isShowTotal: { type: Boolean, default: false }
+ isShowTotal: { type: Boolean, default: false },
},
- setup () {
+ setup() {
const { getAmountInBaseCurrency } = useAmount()
return { getAmountInBaseCurrency }
},
computed: {
- totalInWallets () {
+ totalInWallets() {
const walletsItems = this.$store.state.wallets.items
const walletsTotal = this.$store.getters['wallets/walletsTotal']
const total = {
counted: 0,
savings: 0,
- credits: 0
+ credits: 0,
}
for (const walletId in walletsItems) {
@@ -31,7 +31,7 @@ export default {
walletTotal = this.getAmountInBaseCurrency({
amount: walletsTotal[walletId].base,
currency: walletsItems[walletId].currency,
- noFormat: true
+ noFormat: true,
})
}
@@ -43,8 +43,8 @@ export default {
total.savings = total.savings + walletTotal
}
return total
- }
- }
+ },
+ },
}
</script>
@@ -127,17 +127,17 @@ export default {
<i18n lang="json5">
{
- en: {
- avaliable: 'Avaliable',
- credits: 'Credits',
- savings: 'Savings',
- total: 'Total'
+ "en": {
+ "avaliable": "Avaliable",
+ "credits": "Credits",
+ "savings": "Savings",
+ "total": "Total"
},
- ru: {
- avaliable: 'Доступные',
- credits: 'Кредиты',
- savings: 'Вложения',
- total: 'Всего'
+ "ru": {
+ "avaliable": "Доступные",
+ "credits": "Кредиты",
+ "savings": "Вложения",
+ "total": "Всего"
}
}
</i18n>
diff --git a/gulpfile.js b/gulpfile.js
index 4bed1fd2..6a7c7cf0 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -6,19 +6,19 @@ const log = require('fancy-log')
const notify = require('gulp-notify')
const plumber = require('gulp-plumber')
-function toaster (name, cb) {
+function toaster(name, cb) {
return plumber({
errorHandler: (error) => {
notify.onError({
title: name,
- message: '<%= error.message %>'
+ message: '<%= error.message %>',
})(error)
cb()
- }
+ },
})
}
-function uploadTask (path, cb) {
+function uploadTask(path, cb) {
if (fs.existsSync('./ftp.config.js')) {
const configFTP = require('./ftp.config.js')
const conn = ftp.create({
@@ -26,7 +26,7 @@ function uploadTask (path, cb) {
user: configFTP.user,
password: configFTP.password,
log,
- parallel: 10
+ parallel: 10,
})
return src(path)
@@ -37,17 +37,17 @@ function uploadTask (path, cb) {
else {
notifier.notify({
title: 'No ftp config',
- message: 'Read Readme "Setup upload task" section'
+ message: 'Read Readme "Setup upload task" section',
})
cb()
}
}
-function uploadAll (cb) {
+function uploadAll(cb) {
return uploadTask('dist/**/*.*', cb)
}
-function uploadMin (cb) {
+function uploadMin(cb) {
return uploadTask('dist/**/*.{css,js,html}', cb)
}
diff --git a/layouts/default.vue b/layouts/default.vue
index 7b617825..d1c327c6 100644
--- a/layouts/default.vue
+++ b/layouts/default.vue
@@ -1,14 +1,14 @@
<script lang="ts">
-import { ref, computed, useNuxtApp, onMounted, useLazyAsyncData, defineComponent } from '#app'
+import { computed, defineComponent, onMounted, ref, useLazyAsyncData, useNuxtApp } from '#app'
import debounce from '~/utils/debounce'
import detectTouch from '~/assets/js/isTouchDevice'
import useUIView from '~/components/layout/useUIView'
export default defineComponent({
- setup () {
+ setup() {
const { $store } = useNuxtApp()
- useLazyAsyncData('posts', async () => {
+ useLazyAsyncData('posts', async() => {
const { initUI } = useUIView()
await initUI()
})
@@ -19,7 +19,7 @@ export default defineComponent({
* Update modal
*/
const isShowUpdateApp = ref(false)
- onMounted(async () => {
+ onMounted(async() => {
const workbox = await window.$workbox
if (workbox) {
workbox.addEventListener('installed', (event) => {
@@ -36,16 +36,16 @@ export default defineComponent({
/**
* Page dimensions
*/
- function getPageDimensions () {
+ function getPageDimensions() {
const width = document.documentElement.clientWidth
const height = document.documentElement.clientHeight
- document.documentElement.style.setProperty('--height', height + 'px')
+ document.documentElement.style.setProperty('--height', `${height}px`)
$store.dispatch('ui/setAppDimensions', { width, height })
}
const touchClassNames = computed(() => ({
isNotTouchDevice: !isTouchDevice.value,
- isTouchDevice: isTouchDevice.value
+ isTouchDevice: isTouchDevice.value,
}))
onMounted(() => {
@@ -57,9 +57,9 @@ export default defineComponent({
return {
keepAliveInclude,
touchClassNames,
- isShowUpdateApp
+ isShowUpdateApp,
}
- }
+ },
})
</script>
diff --git a/layouts/error.vue b/layouts/error.vue
index 10ff7de0..8acbaba6 100644
--- a/layouts/error.vue
+++ b/layouts/error.vue
@@ -3,16 +3,16 @@ export default defineComponent({
// eslint-disable-next-line vue/require-prop-types
props: ['error'],
- fetch () {
+ fetch() {
if (Object.keys(this.$route.query).length > 0)
this.$router.replace({ query: null })
},
computed: {
- statusCode () {
+ statusCode() {
return (this.error && this.error.statusCode) || 500
- }
- }
+ },
+ },
})
</script>
diff --git a/layouts/login.vue b/layouts/login.vue
index 6da93e01..e85b8ae9 100644
--- a/layouts/login.vue
+++ b/layouts/login.vue
@@ -2,20 +2,20 @@
import detectTouch from '~/assets/js/isTouchDevice'
export default defineComponent({
- setup () {
+ setup() {
// Detect touch device
const isTouchDevice = ref(false)
onMounted(() => { isTouchDevice.value = detectTouch() })
const touchClassNames = computed(() => ({
isNotTouchDevice: !isTouchDevice.value,
- isTouchDevice: isTouchDevice.value
+ isTouchDevice: isTouchDevice.value,
}))
return {
- touchClassNames
+ touchClassNames,
}
- }
+ },
})
</script>
diff --git a/layouts/welcome.vue b/layouts/welcome.vue
index 91c0797b..cbbd6201 100644
--- a/layouts/welcome.vue
+++ b/layouts/welcome.vue
@@ -1,14 +1,14 @@
<script lang="ts">
-import { ref, computed, useNuxtApp, onMounted, useLazyAsyncData, defineComponent } from '#app'
+import { computed, defineComponent, onMounted, ref, useLazyAsyncData, useNuxtApp } from '#app'
import debounce from '~/utils/debounce'
import detectTouch from '~/assets/js/isTouchDevice'
import useUIView from '~/components/layout/useUIView'
export default defineComponent({
- setup () {
+ setup() {
const { $store } = useNuxtApp()
- useLazyAsyncData('posts', async () => {
+ useLazyAsyncData('posts', async() => {
const { initUI } = useUIView()
await initUI()
})
@@ -19,7 +19,7 @@ export default defineComponent({
* Update modal
*/
const isShowUpdateApp = ref(false)
- onMounted(async () => {
+ onMounted(async() => {
const workbox = await window.$workbox
if (workbox) {
workbox.addEventListener('installed', (event) => {
@@ -36,16 +36,16 @@ export default defineComponent({
/**
* Page dimensions
*/
- function getPageDimensions () {
+ function getPageDimensions() {
const width = document.documentElement.clientWidth
const height = document.documentElement.clientHeight
- document.documentElement.style.setProperty('--height', height + 'px')
+ document.documentElement.style.setProperty('--height', `${height}px`)
$store.dispatch('ui/setAppDimensions', { width, height })
}
const touchClassNames = computed(() => ({
isNotTouchDevice: !isTouchDevice.value,
- isTouchDevice: isTouchDevice.value
+ isTouchDevice: isTouchDevice.value,
}))
onMounted(() => {
@@ -57,9 +57,9 @@ export default defineComponent({
return {
keepAliveInclude,
touchClassNames,
- isShowUpdateApp
+ isShowUpdateApp,
}
- }
+ },
})
</script>
diff --git a/locales/en-US.js b/locales/en-US.js
index c684daf8..92f2c0aa 100644
--- a/locales/en-US.js
+++ b/locales/en-US.js
@@ -1,10 +1,10 @@
export default {
common: {
- date: 'Date'
+ date: 'Date',
},
analytics: {
- title: 'Analytics'
+ title: 'Analytics',
},
appName: 'Finapp',
@@ -12,12 +12,12 @@ export default {
for: 'for',
locale: {
- toogle: 'Toogle locale'
+ toogle: 'Toogle locale',
},
theme: {
title: 'Theme',
- change: 'Change theme'
+ change: 'Change theme',
},
backTo: 'Back to ',
@@ -38,14 +38,14 @@ export default {
lastUsedCats: 'Show last used categories',
description: {
title: 'Description',
- placeholder: 'Write description...'
+ placeholder: 'Write description...',
},
transfer: {
from: 'From',
fromLong: 'From wallet',
to: 'To',
- toLong: 'To wallet'
- }
+ toLong: 'To wallet',
+ },
},
app: {
@@ -55,17 +55,17 @@ export default {
lang: {
select: 'Choose language',
en: 'English',
- ru: 'Русский'
+ ru: 'Русский',
},
theme: {
select: 'Choose style',
dark: 'Dark',
- light: 'Light'
+ light: 'Light',
},
madeBy: {
text: 'Made with',
- name: 'by Ilya Komichev'
- }
+ name: 'by Ilya Komichev',
+ },
},
userLogout: 'Logout',
@@ -87,30 +87,30 @@ export default {
off: 'Off',
edit: 'Edit',
delete: 'Delete',
- filter: 'Filter'
+ filter: 'Filter',
},
filter: {
- clear: 'Clear filter'
+ clear: 'Clear filter',
},
welcome: {
firstRun: {
text: 'Start with create base configuration of application',
- btn: 'Start'
+ btn: 'Start',
},
create: {
text: 'Start creating your own wallets, categories',
- btn: 'Let\'s go'
+ btn: 'Let\'s go',
},
createFirstWallet: {
- text: "Let's start with create first Wallet",
- btn: 'Create wallet'
+ text: 'Let\'s start with create first Wallet',
+ btn: 'Create wallet',
},
createFirstCategory: {
- text: "Great! Now Let's create first category",
- btn: 'Create category'
- }
+ text: 'Great! Now Let\'s create first category',
+ btn: 'Create category',
+ },
},
settings: {
@@ -121,7 +121,7 @@ export default {
customize: 'Сustomize',
app: 'Application',
caution: 'With caution',
- deleteButton: 'Delete my data'
+ deleteButton: 'Delete my data',
},
wallets: {
@@ -138,29 +138,29 @@ export default {
label: 'Wallet name',
placeholder: 'Write wallet name...',
error: 'Write wallet name',
- exist: 'Wallet with same name is exist'
+ exist: 'Wallet with same name is exist',
},
color: {
label: 'Color',
placeholder: 'Select color',
error: 'Select color',
- custom: 'Custom color'
+ custom: 'Custom color',
},
currency: {
label: 'Currency',
placeholder: 'Select currency',
- error: 'Select currency'
+ error: 'Select currency',
},
total: {
- placeholder: 'Сash withdrawal'
+ placeholder: 'Сash withdrawal',
},
- save: 'Save'
- }
+ save: 'Save',
+ },
},
currency: {
title: 'Currency',
- selectBaseTitle: 'Select base currency'
+ selectBaseTitle: 'Select base currency',
},
categories: {
@@ -178,28 +178,28 @@ export default {
label: 'Category name',
placeholder: 'Write category name...',
error: 'Write category name',
- exist: 'Category with same name is exist'
+ exist: 'Category with same name is exist',
},
parent: {
no: 'No parent',
label: 'Parent category',
- placeholder: 'Select parent category'
+ placeholder: 'Select parent category',
},
color: {
label: 'Colors',
- custom: 'Custom color'
+ custom: 'Custom color',
},
icons: {
- label: 'Icons'
+ label: 'Icons',
},
data: {
- label: 'Data'
+ label: 'Data',
},
lastUsed: 'Show in last used categories',
quickSelector: 'Favorite category',
childColor: 'Apply color to all child categories',
- save: 'Save'
- }
+ save: 'Save',
+ },
},
stat: {
@@ -216,8 +216,8 @@ export default {
showCategorisChart: 'Show categories chart',
showCategorisList: 'Show categories list',
showcatsChartPie: 'Show categories pie chart',
- showPeriodsChart: 'Show periods chart'
- }
+ showPeriodsChart: 'Show periods chart',
+ },
},
chart: {
@@ -234,8 +234,8 @@ export default {
addGroupButton: 'Add group',
addPeriodButton: 'Add period',
removeGroupButton: 'Remove group',
- removePeriodButton: 'Remove period'
- }
+ removePeriodButton: 'Remove period',
+ },
},
trns: {
@@ -244,12 +244,12 @@ export default {
history: 'History',
more: 'Show more',
filter: {
- showTrnsWithDesc: 'Only with description'
- }
+ showTrnsWithDesc: 'Only with description',
+ },
},
create: {
- title: 'Create'
+ title: 'Create',
},
money: {
@@ -260,12 +260,12 @@ export default {
average: {
base: 'Average',
incomes: 'Average incomes',
- expenses: 'Average expenses'
+ expenses: 'Average expenses',
},
averageTotal: 'Average total',
also: 'Also',
wallets: 'Wallets',
- all: 'Total'
+ all: 'Total',
},
dates: {
@@ -276,42 +276,42 @@ export default {
current: 'Today',
today: 'Today',
yesterday: 'Yesterday',
- simple: 'Day'
+ simple: 'Day',
},
week: {
current: 'This week',
last: 'Last week',
- simple: 'Week'
+ simple: 'Week',
},
month: {
current: 'This month',
last: 'Last month',
- simple: 'Month'
+ simple: 'Month',
},
year: {
current: 'This year',
- simple: 'Year'
+ simple: 'Year',
},
all: {
- simple: 'All trns'
- }
+ simple: 'All trns',
+ },
},
alerts: {
- willDeleteEverything: 'This will delete all your wallets, categories and trns.'
+ willDeleteEverything: 'This will delete all your wallets, categories and trns.',
},
buttons: {
nextTitle: 'Next',
prevTitle: 'Prev',
- nextStep: 'Next step'
+ nextStep: 'Next step',
},
users: {
- title: 'Users'
+ title: 'Users',
},
colors: 'Colors',
palette: 'Palette',
- popularColors: 'Popular colors'
+ popularColors: 'Popular colors',
}
diff --git a/locales/ru-RU.js b/locales/ru-RU.js
index 96100525..bdb0f0a5 100644
--- a/locales/ru-RU.js
+++ b/locales/ru-RU.js
@@ -1,11 +1,11 @@
export default {
common: {
- date: 'Дата'
+ date: 'Дата',
},
analytics: {
- title: 'Аналитика'
+ title: 'Аналитика',
},
appName: 'Финапка',
@@ -13,12 +13,12 @@ export default {
for: 'за',
locale: {
- toogle: 'Сменить язык'
+ toogle: 'Сменить язык',
},
theme: {
title: 'Тема',
- change: 'Сменить цвет оформления'
+ change: 'Сменить цвет оформления',
},
backTo: 'Назад к ',
@@ -39,14 +39,14 @@ export default {
lastUsedCats: 'Показывать последние использованные категории',
description: {
title: 'Описание',
- placeholder: 'Напишите описание...'
+ placeholder: 'Напишите описание...',
},
transfer: {
from: 'Из',
fromLong: 'Из кошелька',
to: 'В',
- toLong: 'В кошелек'
- }
+ toLong: 'В кошелек',
+ },
},
app: {
@@ -56,18 +56,18 @@ export default {
lang: {
select: 'Выберите язык',
en: 'English',
- ru: 'Русский'
+ ru: 'Русский',
},
theme: {
change: 'Сменить тему',
select: 'Выберите тему',
dark: 'Темная',
- light: 'Светлая'
+ light: 'Светлая',
},
madeBy: {
text: 'Разработал',
- name: 'Илья Комичев'
- }
+ name: 'Илья Комичев',
+ },
},
userLogout: 'Выход',
@@ -89,30 +89,30 @@ export default {
off: 'Нет',
edit: 'Редактировать',
delete: 'Удалить',
- filter: 'Фильтровать'
+ filter: 'Фильтровать',
},
filter: {
- clear: 'Очистить фильтр'
+ clear: 'Очистить фильтр',
},
welcome: {
firstRun: {
text: 'Пройти первоначальную настройку приложения',
- btn: 'Начать'
+ btn: 'Начать',
},
create: {
text: 'Начнем с создания первого кошелька и категории',
- btn: 'Погнали'
+ btn: 'Погнали',
},
createFirstWallet: {
text: 'Создадим первый кошелек',
- btn: 'Создать'
+ btn: 'Создать',
},
createFirstCategory: {
text: 'Отлично! Теперь создадим категорию',
- btn: 'Создать'
- }
+ btn: 'Создать',
+ },
},
settings: {
@@ -123,7 +123,7 @@ export default {
customize: 'Внешний вид',
app: 'Приложение',
caution: 'C осторожностью',
- deleteButton: 'Удалить все мои данные'
+ deleteButton: 'Удалить все мои данные',
},
wallets: {
@@ -140,29 +140,29 @@ export default {
label: 'Имя кошелька',
placeholder: 'Напишите имя кошелька...',
error: 'Напишите имя кошелька',
- exist: 'Кошелек с таким именем уже существует'
+ exist: 'Кошелек с таким именем уже существует',
},
color: {
label: 'Цвет',
placeholder: 'Выберите цвет',
error: 'Выберите цвет',
- custom: 'Кастомный цвет'
+ custom: 'Кастомный цвет',
},
currency: {
label: 'Валюта',
placeholder: 'Выберите валюту',
- error: 'Выберите валюту'
+ error: 'Выберите валюту',
},
total: {
- placeholder: 'Деньги доступны для снятия'
+ placeholder: 'Деньги доступны для снятия',
},
- save: 'Сохранить'
- }
+ save: 'Сохранить',
+ },
},
currency: {
title: 'Валюта',
- selectBaseTitle: 'Выбрать основную валюту'
+ selectBaseTitle: 'Выбрать основную валюту',
},
categories: {
@@ -180,28 +180,28 @@ export default {
label: 'Имя категории',
placeholder: 'Напишите имя категории...',
error: 'Напишите имя категории',
- exist: 'Категория с таким именем уже существует'
+ exist: 'Категория с таким именем уже существует',
},
parent: {
no: 'Корневая категория',
label: 'Категория',
- placeholder: 'Выберите категрию'
+ placeholder: 'Выберите категрию',
},
color: {
label: 'Цвета',
- custom: 'Кастомный цвет'
+ custom: 'Кастомный цвет',
},
icons: {
- label: 'Иконки'
+ label: 'Иконки',
},
data: {
- label: 'Данные'
+ label: 'Данные',
},
lastUsed: 'Показывать в списке недавних категорий',
quickSelector: 'Любимая категория',
childColor: 'Применить цвет ко всем дочерним категориям',
- save: 'Сохранить'
- }
+ save: 'Сохранить',
+ },
},
stat: {
@@ -218,8 +218,8 @@ export default {
showCategorisChart: 'Показывать вертикальный график категорий',
showCategorisList: 'Показывать список категорий',
showcatsChartPie: 'Показывать статистику "пирог"',
- showPeriodsChart: 'Показывать график периодов'
- }
+ showPeriodsChart: 'Показывать график периодов',
+ },
},
chart: {
@@ -236,8 +236,8 @@ export default {
addGroupButton: 'Добавить группу',
addPeriodButton: 'Добавить период',
removeGroupButton: 'Удалить группу',
- removePeriodButton: 'Удалить период'
- }
+ removePeriodButton: 'Удалить период',
+ },
},
trns: {
@@ -246,12 +246,12 @@ export default {
history: 'История',
more: 'Показать еще',
filter: {
- showTrnsWithDesc: 'Только с описанием'
- }
+ showTrnsWithDesc: 'Только с описанием',
+ },
},
create: {
- title: 'Создать'
+ title: 'Создать',
},
money: {
@@ -262,12 +262,12 @@ export default {
average: {
base: 'Среднее',
incomes: 'Средний доход',
- expenses: 'Средний расход'
+ expenses: 'Средний расход',
},
averageTotal: 'Обычно',
also: 'Еще',
wallets: 'Кошельки',
- all: 'Всего'
+ all: 'Всего',
},
dates: {
@@ -278,42 +278,42 @@ export default {
current: 'Сегодня',
today: 'Сегодня',
yesterday: 'Вчера',
- simple: 'День'
+ simple: 'День',
},
week: {
current: 'Текущая неделя',
last: 'Прошлая неделя',
- simple: 'Неделя'
+ simple: 'Неделя',
},
month: {
current: 'Текущий месяц',
last: 'Прошлый месяц',
- simple: 'Месяц'
+ simple: 'Месяц',
},
year: {
current: 'Текущий год',
- simple: 'Год'
+ simple: 'Год',
},
all: {
- simple: 'Все транзакции'
- }
+ simple: 'Все транзакции',
+ },
},
alerts: {
- willDeleteEverything: 'Все кошельки, категории и транзакции будут удалены.'
+ willDeleteEverything: 'Все кошельки, категории и транзакции будут удалены.',
},
buttons: {
nextTitle: 'Следующий',
prevTitle: 'Прошлый',
- nextStep: 'Далее'
+ nextStep: 'Далее',
},
users: {
- title: 'Пользователи'
+ title: 'Пользователи',
},
colors: 'Цвета',
palette: 'Палитра',
- popularColors: 'Популярные'
+ popularColors: 'Популярные',
}
diff --git a/middleware/auth.js b/middleware/auth.js
index 45481032..14f47728 100755
--- a/middleware/auth.js
+++ b/middleware/auth.js
@@ -1,10 +1,9 @@
-export default function ({ store, redirect, route, app }) {
+export default function({ store, redirect, route, app }) {
const routeName = app.getRouteBaseName(route)
- if (store.state.user.user !== null && routeName === 'login') {
+ if (store.state.user.user !== null && routeName === 'login')
redirect(app.localePath('/'))
- }
- if (store.state.user.user === null && routeName !== 'login') {
+
+ if (store.state.user.user === null && routeName !== 'login')
redirect(app.localePath('login'))
- }
}
diff --git a/modules/filter/useFilter.ts b/modules/filter/useFilter.ts
index 32c1bb9c..5c9bbe43 100644
--- a/modules/filter/useFilter.ts
+++ b/modules/filter/useFilter.ts
@@ -1,16 +1,16 @@
-export default function useFilter () {
+export default function useFilter() {
const { $store } = useNuxtApp()
const route = useRoute()
const router = useRouter()
const filterPeriodNameAllReplacedToYear = computed(() => $store.state.filter.period === 'all' ? 'year' : $store.state.filter.period)
const isNeedToRedirect = computed(() => route.name !== 'index' && route.name !== 'history')
- function scrollTop () {
+ function scrollTop() {
const page = document.querySelector('.js_scroll_page')
if (page) page.scrollTop = 0
}
- function setCategoryFilter (id) {
+ function setCategoryFilter(id) {
if (isNeedToRedirect.value)
router.push('/')
@@ -18,7 +18,7 @@ export default function useFilter () {
scrollTop()
}
- function setWalletFilter (id) {
+ function setWalletFilter(id) {
if (isNeedToRedirect.value)
router.push('/')
@@ -30,6 +30,6 @@ export default function useFilter () {
scrollTop,
setCategoryFilter,
setWalletFilter,
- filterPeriodNameAllReplacedToYear
+ filterPeriodNameAllReplacedToYear,
}
}
diff --git a/modules/menu/useMenuData.ts b/modules/menu/useMenuData.ts
index 2784d517..a7edbc04 100644
--- a/modules/menu/useMenuData.ts
+++ b/modules/menu/useMenuData.ts
@@ -4,7 +4,7 @@ interface MenuItem {
private?: boolean
}
-export default function useMenuData () {
+export default function useMenuData() {
const { $store, nuxt2Context: { i18n } } = useNuxtApp()
const route = useRoute()
const router = useRouter()
@@ -12,36 +12,36 @@ export default function useMenuData () {
const items: Record<string, MenuItem> = {
trnForm: {
icon: 'mdi mdi-plus',
- name: i18n.t('createTrn')
+ name: i18n.t('createTrn'),
},
index: {
icon: 'mdi mdi-poll',
- name: i18n.t('stat.shortTitle')
+ name: i18n.t('stat.shortTitle'),
},
history: {
icon: 'mdi mdi-history',
- name: i18n.t('trns.history')
+ name: i18n.t('trns.history'),
},
wallets: {
icon: 'mdi mdi-credit-card-multiple',
- name: i18n.t('wallets.name')
+ name: i18n.t('wallets.name'),
},
categories: {
icon: 'mdi mdi-folder-star',
- name: i18n.t('categories.name')
+ name: i18n.t('categories.name'),
},
settings: {
icon: 'mdi mdi-cog-outline',
- name: i18n.t('settings.title')
+ name: i18n.t('settings.title'),
},
users: {
private: true,
icon: 'mdi mdi-account-multiple',
- name: i18n.t('users.title')
- }
+ name: i18n.t('users.title'),
+ },
}
- function onClick (menuId: string) {
+ function onClick(menuId: string) {
menuId === 'trnForm'
? $store.dispatch('trnForm/openTrnForm', { action: 'create' })
: router.push(menuId)
@@ -52,11 +52,11 @@ export default function useMenuData () {
$store.dispatch('ui/setActiveTab', null)
}
- function checkIsActive (menuId: string) {
+ function checkIsActive(menuId: string) {
return route.name === menuId
}
- function checkIsShow (item: MenuItem) {
+ function checkIsShow(item: MenuItem) {
return !item.private || (item.private && $store.getters['user/isTester'])
}
@@ -64,6 +64,6 @@ export default function useMenuData () {
items,
onClick,
checkIsShow,
- checkIsActive
+ checkIsActive,
}
}
diff --git a/modules/stat/getStat.ts b/modules/stat/getStat.ts
index 83de8754..287f1f00 100644
--- a/modules/stat/getStat.ts
+++ b/modules/stat/getStat.ts
@@ -6,7 +6,7 @@
* @param {*} typeName
* @return {*}
*/
-function getBiggestAmount (categoriesTotal, categoriesIds, typeName) {
+function getBiggestAmount(categoriesTotal, categoriesIds, typeName) {
const biggestAmount = categoriesIds[0]
return categoriesTotal[biggestAmount] && Math.abs(categoriesTotal[biggestAmount][typeName])
}
@@ -18,10 +18,10 @@ function getBiggestAmount (categoriesTotal, categoriesIds, typeName) {
* @param {*} [trnsIds=[]]
* @return {*}
*/
-export default function getStat () {
+export default function getStat() {
const { $store } = useNuxtApp()
- function getStatBy (trnsIds = []) {
+ function getStatBy(trnsIds = []) {
const categoriesWithTrnsIds = $store.getters['stat/getCategoriesIdsWithTrnsIds']({ trnsIds })
const totalAllTrns = $store.getters['trns/getTotalOfTrnsIds'](trnsIds)
@@ -53,19 +53,19 @@ export default function getStat () {
expenses: {
biggest: expensesBiggest,
categoriesIds: expensesCategoriesIds,
- total: totalAllTrns.expenses
+ total: totalAllTrns.expenses,
},
incomes: {
biggest: incomesBiggest,
categoriesIds: incomesCategoriesIds,
- total: totalAllTrns.incomes
- }
+ total: totalAllTrns.incomes,
+ },
}
return stat
}
return {
- getStatBy
+ getStatBy,
}
}
diff --git a/modules/stat/useStat.ts b/modules/stat/useStat.ts
index 7cd13c3c..d90aafc6 100644
--- a/modules/stat/useStat.ts
+++ b/modules/stat/useStat.ts
@@ -1,12 +1,12 @@
const moneyTypes = [{
id: 'expenses',
- type: 0
+ type: 0,
}, {
id: 'incomes',
- type: 1
+ type: 1,
}]
-export default function useStat () {
+export default function useStat() {
const { $store } = useNuxtApp()
const isEmptyStat = computed(() => {
const statCurrentPeriod = $store.getters['stat/statCurrentPeriod']
@@ -21,6 +21,6 @@ export default function useStat () {
return {
moneyTypes,
- isEmptyStat
+ isEmptyStat,
}
}
diff --git a/modules/trns/use/formatTrn.ts b/modules/trns/use/formatTrn.ts
index 15e0ed0c..818d0ff9 100644
--- a/modules/trns/use/formatTrn.ts
+++ b/modules/trns/use/formatTrn.ts
@@ -1,9 +1,9 @@
import { formatDate } from '~/utils/formatDate'
-export default function useFormatTrnFullItem () {
+export default function useFormatTrnFullItem() {
const { $store } = useNuxtApp()
- function formatTrnFullItem (id) {
+ function formatTrnFullItem(id) {
try {
const { trns, wallets, categories } = $store.state
@@ -51,7 +51,7 @@ export default function useFormatTrnFullItem () {
// Date
let dateFormated = formatDate(trn.date, 'full')
- // @ts-ignore
+ // @ts-expect-error dif types
dateFormated = `${dateFormated.weekday}, ${dateFormated.day} ${dateFormated.month} ${dateFormated.year}`
return {
@@ -62,7 +62,7 @@ export default function useFormatTrnFullItem () {
categoryParent,
walletFrom,
walletTo,
- wallet
+ wallet,
}
}
catch (error) {
@@ -71,6 +71,6 @@ export default function useFormatTrnFullItem () {
}
return {
- formatTrnFullItem
+ formatTrnFullItem,
}
}
diff --git a/modules/trns/useTrns.ts b/modules/trns/useTrns.ts
index 42f65972..15ed6def 100644
--- a/modules/trns/useTrns.ts
+++ b/modules/trns/useTrns.ts
@@ -1,6 +1,6 @@
import dayjs from 'dayjs'
-export default function useFilter () {
+export default function useFilter() {
const { $store } = useNuxtApp()
/**
@@ -14,7 +14,7 @@ export default function useFilter () {
/**
* Get trns with params
*/
- function getTrnsIds (params:any) {
+ function getTrnsIds(params: any) {
if (trnsIds.value.length === 0)
return trnsIds.value
@@ -24,9 +24,9 @@ export default function useFilter () {
// Wallet
if (walletId) {
ids = ids.filter(id =>
- trns.value[id].walletId === walletId ||
- trns.value[id].walletToId === walletId ||
- trns.value[id].walletFromId === walletId
+ trns.value[id].walletId === walletId
+ || trns.value[id].walletToId === walletId
+ || trns.value[id].walletFromId === walletId,
)
}
@@ -55,8 +55,8 @@ export default function useFilter () {
if (typeof date === 'object') {
ids = trnsIds.value
.filter(id =>
- trns.value[id].date >= dayjs(date.from).startOf('date') &&
- trns.value[id].date <= dayjs(date.to).endOf('date')
+ trns.value[id].date >= dayjs(date.from).startOf('date')
+ && trns.value[id].date <= dayjs(date.to).endOf('date'),
)
}
}
@@ -66,6 +66,6 @@ export default function useFilter () {
return {
trnsIds,
- getTrnsIds
+ getTrnsIds,
}
}
diff --git a/nuxt.config.js b/nuxt.config.js
index d49cb5ad..5d7145e8 100644
--- a/nuxt.config.js
+++ b/nuxt.config.js
@@ -3,7 +3,7 @@ import { defineNuxtConfig } from '@nuxt/bridge'
export default defineNuxtConfig({
bridge: {
nitro: false,
- vite: false
+ vite: false,
},
// Disable server-side rendering (https://go.nuxtjs.dev/ssr-mode)
@@ -24,8 +24,8 @@ export default defineNuxtConfig({
silent: true,
performance: false,
productionTip: false,
- devtools: process.env.NODE_ENV !== 'production'
- }
+ devtools: process.env.NODE_ENV !== 'production',
+ },
},
// Global page headers (https://go.nuxtjs.dev/config-head)
@@ -34,32 +34,32 @@ export default defineNuxtConfig({
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
- { hid: 'description', name: 'description', content: process.env.npm_package_description || '' }
+ { hid: 'description', name: 'description', content: process.env.npm_package_description || '' },
],
link: [{
rel: 'stylesheet',
- href: 'https://fonts.googleapis.com/css?family=Roboto:400,500,600,700|Roboto+Condensed:400,500,600,700|Unica+One|Nunito:400,700,800&display=swap&subset=cyrillic'
+ href: 'https://fonts.googleapis.com/css?family=Roboto:400,500,600,700|Roboto+Condensed:400,500,600,700|Unica+One|Nunito:400,700,800&display=swap&subset=cyrillic',
}, {
rel: 'stylesheet',
- href: 'https://cdn.materialdesignicons.com/5.9.55/css/materialdesignicons.min.css'
+ href: 'https://cdn.materialdesignicons.com/5.9.55/css/materialdesignicons.min.css',
}],
- noscript: [{ innerHTML: 'This website requires JavaScript.' }]
+ noscript: [{ innerHTML: 'This website requires JavaScript.' }],
},
// Global CSS (https://go.nuxtjs.dev/config-css)
styleResources: {
- stylus: ['~/assets/stylus/variables']
+ stylus: ['~/assets/stylus/variables'],
},
// Auto import components (https://go.nuxtjs.dev/config-components)
components: [{
path: '~/components/',
- extensions: ['vue']
+ extensions: ['vue'],
}, {
path: '~/modules/',
- extensions: ['vue']
+ extensions: ['vue'],
}],
// Loading
@@ -69,13 +69,13 @@ export default defineNuxtConfig({
plugins: [
{ src: '~/plugins/initAppFromCache' },
{ src: '~/plugins/dayjs' },
- { src: '~/plugins/notifications' }
+ { src: '~/plugins/notifications' },
],
// Color mode
colorMode: {
classSuffix: '',
- preference: 'dark'
+ preference: 'dark',
},
// Nuxt.js modules
@@ -83,7 +83,7 @@ export default defineNuxtConfig({
'@nuxtjs/color-mode',
'@nuxtjs/i18n',
'@nuxtjs/pwa',
- 'portal-vue/nuxt'
+ 'portal-vue/nuxt',
],
// Modules for dev and build (https://go.nuxtjs.dev/config-modules)
@@ -91,42 +91,42 @@ export default defineNuxtConfig({
'@nuxtjs/style-resources',
'@nuxtjs/pwa',
// https://tailwindcss.nuxtjs.org/
- '@nuxtjs/tailwindcss'
+ '@nuxtjs/tailwindcss',
],
alias: {
- tslib: 'tslib/tslib.es6.js'
+ tslib: 'tslib/tslib.es6.js',
},
tailwindcss: {
- viewer: false
+ viewer: false,
},
// Router middleware
router: {
- middleware: ['auth']
+ middleware: ['auth'],
},
i18n: {
locales: [{
code: 'en',
iso: 'en-US',
- file: 'en-US.js'
+ file: 'en-US.js',
}, {
code: 'ru',
iso: 'ru-RU',
- file: 'ru-RU.js'
+ file: 'ru-RU.js',
}],
strategy: 'no_prefix',
defaultLocale: 'en',
detectBrowserLanguage: {
useCookie: true,
- cookieKey: 'i18n_redirected'
+ cookieKey: 'i18n_redirected',
},
seo: false,
lazy: true,
vueI18nLoader: true,
- langDir: 'locales/'
+ langDir: 'locales/',
},
pwa: {
@@ -134,21 +134,21 @@ export default defineNuxtConfig({
name: 'Finapp',
short_name: 'Finapp',
background_color: '#171717',
- theme_color: '#171717'
+ theme_color: '#171717',
},
workbox: {
offlineStrategy: 'cacheFirst',
runtimeCaching: [{
urlPattern: 'https://fonts.googleapis.com/',
- handler: 'cacheFirst'
+ handler: 'cacheFirst',
}, {
urlPattern: 'https://fonts.gstatic.com/',
- handler: 'cacheFirst'
+ handler: 'cacheFirst',
}, {
urlPattern: 'https://cdn.materialdesignicons.com/',
- handler: 'cacheFirst'
- }]
- }
- }
+ handler: 'cacheFirst',
+ }],
+ },
+ },
})
diff --git a/package.json b/package.json
index 2f92bd4a..bf4aee9f 100644
--- a/package.json
+++ b/package.json
@@ -20,8 +20,8 @@
"currency.js": "2.0.4",
"dayjs": "1.10.7",
"firebase": "9.6.7",
- "highcharts-vue": "1.4.0",
"highcharts": "9.3.3",
+ "highcharts-vue": "1.4.0",
"localforage": "1.10.0",
"nuxt-edge": "latest",
"portal-vue": "2.1.7",
@@ -44,18 +44,18 @@
"@nuxtjs/tailwindcss": "^5.0.0-4",
"@vue/runtime-dom": "^3.2.31",
"cross-env": "7.0.3",
- "eslint-plugin-nuxt": "3.1.0",
"eslint": "^8.9.0",
+ "eslint-plugin-nuxt": "3.1.0",
"fancy-log": "^1.3.3",
+ "gulp": "4.0.2",
"gulp-notify": "4.0.0",
"gulp-plumber": "1.2.1",
- "gulp": "4.0.2",
"node-notifier": "10.0.1",
- "pug-plain-loader": "1.1.0",
"pug": "3.0.2",
+ "pug-plain-loader": "1.1.0",
"style-loader": "^2.0.0",
- "stylus-loader": "^3.0.2",
"stylus": "^0.56.0",
+ "stylus-loader": "^3.0.2",
"typescript": "4.5.5",
"unplugin-vue2-script-setup": "^0.9.3",
"vinyl-ftp": "0.6.1"
diff --git a/pages/_.vue b/pages/_.vue
index 53f85573..51ffe359 100644
--- a/pages/_.vue
+++ b/pages/_.vue
@@ -1,7 +1,7 @@
<script>
export default {
- asyncData ({ redirect }) {
+ asyncData({ redirect }) {
return redirect('/')
- }
+ },
}
</script>
diff --git a/pages/api.vue b/pages/api.vue
index e6856110..0679c5ef 100644
--- a/pages/api.vue
+++ b/pages/api.vue
@@ -19,63 +19,63 @@ const filterByDate = (trns, ids, date) => {
console.log(date)
return ids.filter(
trnId =>
- (trns[trnId].date >= date.start) &&
- (trns[trnId].date <= date.end))
+ (trns[trnId].date >= date.start)
+ && (trns[trnId].date <= date.end))
}
export default defineComponent({
components: { Datepicker },
- setup () {
+ setup() {
const { $store } = useNuxtApp()
const { setExpression } = useCalculator()
const { setCategoryFilter } = useFilter()
const period = reactive({
name: 'month',
- value: 1
+ value: 1,
})
// const today = dayjs().subtract(1, 'week').valueOf()
const today = dayjs().valueOf()
const date = {
- // @ts-ignore
+ // @ts-expect-error
end: dayjs(today).subtract(period.value, period.name).startOf(period.name).valueOf(),
- // @ts-ignore
- start: dayjs(today).endOf(period.name).valueOf()
+ // @ts-expect-error
+ start: dayjs(today).endOf(period.name).valueOf(),
}
- // @ts-ignore
+ // @ts-expect-error
const startDay = computed(() => dayjs().subtract(period.value, period.name).valueOf())
const endDay = computed(() => dayjs().valueOf())
const dateRange = reactive({
start: dayjs(startDay.value).startOf('day').valueOf(),
end: dayjs(endDay.value).endOf('day').valueOf(),
- // @ts-ignore
- count: computed(() => dayjs(dateRange.end).diff(dateRange.start, period.name) + 1)
+ // @ts-expect-error
+ count: computed(() => dayjs(dateRange.end).diff(dateRange.start, period.name) + 1),
})
- function onSelectDay (date, type) {
+ function onSelectDay(date, type) {
dateRange[type] = type === 'end' ? dayjs(date).endOf('day').valueOf() : dayjs(date).startOf('day').valueOf()
}
- function onChangePeriodName (name) {
+ function onChangePeriodName(name) {
period.name = name
selectPeriod()
}
- function selectPeriod (direction?: PeriodNavDirection) {
+ function selectPeriod(direction?: PeriodNavDirection) {
let selectedDate = dayjs(dateRange.end)
if (direction === 'next')
selectedDate = dayjs(selectedDate).add(1, period.name)
if (direction === 'prev')
selectedDate = dayjs(selectedDate).subtract(1, period.name)
- // @ts-ignore
+ // @ts-expect-error
dateRange.start = dayjs(selectedDate).startOf(period.name).valueOf()
- // @ts-ignore
+ // @ts-expect-error
dateRange.end = dayjs(selectedDate).endOf(period.name).valueOf()
}
@@ -114,11 +114,11 @@ export default defineComponent({
$store.commit('trns/setTrnModalId', null)
$store.commit('stat/setCategoryModal', { id: null, type: null })
$store.dispatch('ui/setActiveTabStat', 'details')
- }
+ },
})
const disabledDates = {
- from: new Date()
+ from: new Date(),
}
return {
@@ -132,9 +132,9 @@ export default defineComponent({
selectPeriod,
onChangePeriodName,
- period
+ period,
}
- }
+ },
})
</script>
diff --git a/pages/categories.vue b/pages/categories.vue
index 3233d996..566283bb 100644
--- a/pages/categories.vue
+++ b/pages/categories.vue
@@ -1,14 +1,14 @@
<script>
export default defineComponent({
- setup () {
+ setup() {
},
- head () {
+ head() {
return {
- title: this.$t('categories.title')
+ title: this.$t('categories.title'),
}
- }
+ },
})
</script>
diff --git a/pages/history.vue b/pages/history.vue
index 9bba598b..eed2a9b3 100644
--- a/pages/history.vue
+++ b/pages/history.vue
@@ -2,16 +2,16 @@
import useStatPage from '~/components/stat/useStatPage'
export default {
- setup () {
+ setup() {
const { statPage } = useStatPage()
return { statPage }
},
- head () {
+ head() {
return {
- title: this.$t('trns.history')
+ title: this.$t('trns.history'),
}
- }
+ },
}
</script>
diff --git a/pages/index.vue b/pages/index.vue
index cc74f826..d9f7e58e 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -1,10 +1,10 @@
<script>
export default {
- head () {
+ head() {
return {
- title: this.$t('stat.title')
+ title: this.$t('stat.title'),
}
- }
+ },
}
</script>
diff --git a/pages/login.vue b/pages/login.vue
index df7a2253..06c9d373 100644
--- a/pages/login.vue
+++ b/pages/login.vue
@@ -1,12 +1,12 @@
<script lang="ts">
-import { signInWithRedirect, GoogleAuthProvider } from 'firebase/auth'
+import { GoogleAuthProvider, signInWithRedirect } from 'firebase/auth'
import { useRoute } from '#imports'
import { auth } from '~/services/firebaseHelpers'
export default defineComponent({
layout: 'login',
- setup () {
+ setup() {
const isLoading = ref(false)
const route = useRoute()
@@ -16,17 +16,17 @@ export default defineComponent({
setTimeout(() => { isLoading.value = false }, 10000)
return {
- isLoading
+ isLoading,
}
},
- fetch ({ store, redirect }) {
+ fetch({ store, redirect }) {
if (store.state.user?.user)
redirect('/')
},
methods: {
- signInWithGoogle () {
+ signInWithGoogle() {
this.$router.push({ query: { loading: true } })
this.isLoading = true
@@ -35,20 +35,20 @@ export default defineComponent({
.catch(e => this.notifyAboutError(e))
},
- notifyAboutError (e) {
+ notifyAboutError(e) {
this.$notify({
duration: 6000,
text: e.message,
title: 'Error',
- type: 'error'
+ type: 'error',
})
this.isLoading = false
},
- onSetLocale (lang) {
+ onSetLocale(lang) {
this.$store.dispatch('lang/setLang', lang)
- }
- }
+ },
+ },
})
</script>
diff --git a/pages/settings.vue b/pages/settings.vue
index d4a432f8..f7a5307a 100644
--- a/pages/settings.vue
+++ b/pages/settings.vue
@@ -4,28 +4,28 @@ import pkg from '~/package'
export default {
name: 'SettingsPage',
- data () {
+ data() {
return {
confirmRemoveUserData: false,
- version: pkg.version
+ version: pkg.version,
}
},
- head () {
+ head() {
return {
- title: this.$t('settings.title')
+ title: this.$t('settings.title'),
}
},
methods: {
- removeUserData () {
+ removeUserData() {
this.confirmRemoveUserData = false
this.$store.dispatch('user/removeUserData')
if (this.$route.name !== 'welcome')
this.$router.push('/welcome')
- }
- }
+ },
+ },
}
</script>
@@ -143,12 +143,12 @@ LayoutBaseWrap(:contentPadding="false")
<i18n lang="json5">
{
- en: {
- user: 'User'
+ "en": {
+ "user": "User"
},
- ru: {
- user: 'Пользователь'
+ "ru": {
+ "user": "Пользователь"
}
}
</i18n>
diff --git a/pages/wallets.vue b/pages/wallets.vue
index 59b58fb9..5fd4f070 100644
--- a/pages/wallets.vue
+++ b/pages/wallets.vue
@@ -2,18 +2,18 @@
export default {
name: 'WalletsPage',
- head () {
+ head() {
return {
- title: this.$t('wallets.title')
+ title: this.$t('wallets.title'),
}
},
methods: {
- handleShowWalletsModalWalletModal (id) {
+ handleShowWalletsModalWalletModal(id) {
this.$store.commit('wallets/showWalletsModalWalletModal')
this.$store.commit('wallets/setWalletsModalWalletModalId', id)
- }
- }
+ },
+ },
}
</script>
diff --git a/pages/welcome.vue b/pages/welcome.vue
index 0ae3ad27..b7c0d13c 100644
--- a/pages/welcome.vue
+++ b/pages/welcome.vue
@@ -3,31 +3,31 @@ export default {
name: 'WelcomePage',
layout: 'welcome',
- data () {
+ data() {
return {
step: 1,
showCategoryForm: false,
- showWalletForm: false
+ showWalletForm: false,
}
},
computed: {
- newUserData () {
+ newUserData() {
if (!this.$store.getters['wallets/hasWallets'] || !this.$store.getters['categories/hasCategories'])
return true
return false
- }
+ },
},
watch: {
- newUserData (newUserData) {
+ newUserData(newUserData) {
if (!newUserData)
this.$router.push('/')
- }
+ },
},
- mounted () {
+ mounted() {
if (!this.newUserData)
this.$router.push('/')
@@ -36,14 +36,14 @@ export default {
},
methods: {
- categoryCreatedCallback () {
+ categoryCreatedCallback() {
this.showCategoryForm = false
},
- changeLang (lang) {
+ changeLang(lang) {
this.$store.dispatch('lang/setLang', lang)
- }
- }
+ },
+ },
}
</script>
diff --git a/plugins/dayjs.js b/plugins/dayjs.js
index a76d5776..5b222b40 100644
--- a/plugins/dayjs.js
+++ b/plugins/dayjs.js
@@ -14,7 +14,7 @@ export default (_, inject) => {
const locale = require('dayjs/locale/en.js')
dayjs.locale(locale)
dayjs.updateLocale(locale, {
- weekStart: 1
+ weekStart: 1,
})
inject('day', (val) => {
diff --git a/plugins/notifications.js b/plugins/notifications.js
index 8558d873..c62e8a54 100755
--- a/plugins/notifications.js
+++ b/plugins/notifications.js
@@ -4,6 +4,6 @@ import VueNotification from 'vue-notification'
// $notify
if (process.client) {
Vue.use(VueNotification, {
- componentName: 'Notifications'
+ componentName: 'Notifications',
})
}
diff --git a/services/firebaseConfig.js b/services/firebaseConfig.js
index edd85d21..5bc82f76 100755
--- a/services/firebaseConfig.js
+++ b/services/firebaseConfig.js
@@ -5,5 +5,5 @@ export const config = {
projectId: 'finapp-17474',
storageBucket: 'finapp-17474.appspot.com',
messagingSenderId: '1057184379213',
- appId: '1:1057184379213:web:8c728d0b7099f194'
+ appId: '1:1057184379213:web:8c728d0b7099f194',
}
diff --git a/services/firebaseHelpers.js b/services/firebaseHelpers.js
index da5a962e..8f7b23a3 100644
--- a/services/firebaseHelpers.js
+++ b/services/firebaseHelpers.js
@@ -1,5 +1,5 @@
import { initializeApp } from 'firebase/app'
-import { getDatabase, ref, get, onValue, child, set, update, remove, off } from 'firebase/database'
+import { child, get, getDatabase, off, onValue, ref, remove, set, update } from 'firebase/database'
import { getAuth } from 'firebase/auth'
import { config } from '~/services/firebaseConfig'
diff --git a/store/app/actions.js b/store/app/actions.js
index 6075a9da..f83edb6a 100644
--- a/store/app/actions.js
+++ b/store/app/actions.js
@@ -3,11 +3,11 @@ import { onAuthStateChanged } from 'firebase/auth'
import { auth } from '~/services/firebaseHelpers'
export default {
- initApp ({ rootGetters, commit, dispatch }) {
+ initApp({ rootGetters, commit, dispatch }) {
if (this.$router.currentRoute.name === 'login')
commit('setAppStatus', 'loading')
- onAuthStateChanged(auth, async (user) => {
+ onAuthStateChanged(auth, async(user) => {
if (this.$router.currentRoute.name === 'login')
commit('setAppStatus', 'loading')
@@ -41,7 +41,7 @@ export default {
})
},
- async initAppFromCache ({ commit, dispatch }, resolve) {
+ async initAppFromCache({ commit, dispatch }, resolve) {
dispatch('lang/initLocalLang', null, { root: true })
dispatch('ui/initUi', null, { root: true })
dispatch('chart/initChart', null, { root: true })
@@ -53,7 +53,7 @@ export default {
localforage.getItem('finapp.categories'),
localforage.getItem('finapp.wallets'),
localforage.getItem('finapp.trns'),
- localforage.getItem('finapp.filter.period')
+ localforage.getItem('finapp.filter.period'),
])
if (ativeTab) dispatch('ui/setActiveTab', ativeTab, { root: true })
@@ -77,7 +77,7 @@ export default {
commit('setAppStatus', 'ready')
},
- async clearUserData ({ commit, dispatch }) {
+ async clearUserData({ commit, dispatch }) {
commit('setAppStatus', 'loading')
dispatch('ui/setActiveTab', 'stat', { root: true })
await dispatch('user/setUser', null, { root: true })
@@ -87,5 +87,5 @@ export default {
setTimeout(() => {
commit('setAppStatus', 'ready')
}, 100)
- }
+ },
}
diff --git a/store/app/index.js b/store/app/index.js
index 092bf541..a41fff91 100644
--- a/store/app/index.js
+++ b/store/app/index.js
@@ -4,18 +4,18 @@ import mutations from './mutations'
export const initStatus = {
loading: true,
login: false,
- ready: false
+ ready: false,
}
const state = () => ({
status: {
...initStatus,
- loading: true
- }
+ loading: true,
+ },
})
export default {
state,
actions,
- mutations
+ mutations,
}
diff --git a/store/app/mutations.js b/store/app/mutations.js
index 5017e3f7..09da6bcd 100644
--- a/store/app/mutations.js
+++ b/store/app/mutations.js
@@ -1,12 +1,12 @@
import { initStatus } from './'
export default {
- setAppStatus (state, status) {
+ setAppStatus(state, status) {
if (!state.status[status]) {
state.status = {
...initStatus,
- [status]: true
+ [status]: true,
}
}
- }
+ },
}
diff --git a/store/categories/actions.js b/store/categories/actions.js
index 9cb77f01..800e6024 100644
--- a/store/categories/actions.js
+++ b/store/categories/actions.js
@@ -2,7 +2,7 @@ import localforage from 'localforage'
import { getDataAndWatch, unsubcribeData } from '~/services/firebaseHelpers'
export default {
- initCategories ({ dispatch, rootState }) {
+ initCategories({ dispatch, rootState }) {
const uid = rootState.user.user.uid
getDataAndWatch(`users/${uid}/categories`, (items) => {
// add child categories to root categories
@@ -21,7 +21,7 @@ export default {
items[categoryId] = {
...cat,
showInLastUsed: false,
- showInQuickSelector: false
+ showInQuickSelector: false,
}
}
}
@@ -30,18 +30,18 @@ export default {
})
},
- setCategories ({ commit }, items) {
+ setCategories({ commit }, items) {
commit('setCategories', items)
localforage.setItem('finapp.categories', items)
},
- unsubcribeCategories ({ rootState }) {
+ unsubcribeCategories({ rootState }) {
const uid = rootState.user.user.uid
unsubcribeData(`users/${uid}/categories`)
},
- showCategoryModal ({ commit }, id) {
+ showCategoryModal({ commit }, id) {
commit('showCategoryModal')
commit('setCategoryModalId', id)
- }
+ },
}
diff --git a/store/categories/getters.js b/store/categories/getters.js
index f51f91d8..9ab2857b 100644
--- a/store/categories/getters.js
+++ b/store/categories/getters.js
@@ -1,5 +1,5 @@
export default {
- hasCategories (state) {
+ hasCategories(state) {
if (state.items) {
// More than 1 because categories has 1 static category "Transfer"
if (Object.keys(state.items).length > 1)
@@ -8,12 +8,12 @@ export default {
return false
},
- categoriesIds (state, getters) {
+ categoriesIds(state, getters) {
if (!getters.hasCategories) return []
return Object.keys(state.items)
},
- categoriesRootIds (state, getters) {
+ categoriesRootIds(state, getters) {
if (!getters.hasCategories) return []
return Object.keys(state.items)
@@ -25,7 +25,7 @@ export default {
})
},
- categoriesForBeParent (state, getters, rootState) {
+ categoriesForBeParent(state, getters, rootState) {
const categories = state.items
const categoriesRootIds = getters.categoriesRootIds
const trns = rootState.trns.items
@@ -57,7 +57,7 @@ export default {
return category?.childIds || []
},
- lastUsedCategoriesIdsByDate (state, getters, rootState, rootGetters) {
+ lastUsedCategoriesIdsByDate(state, getters, rootState, rootGetters) {
if (!getters.hasCategories) return []
const trns = rootState.trns.items
@@ -89,7 +89,7 @@ export default {
}
},
- quickSelectorCategoriesIds (state, getters) {
+ quickSelectorCategoriesIds(state, getters) {
if (!getters.hasCategories) return []
return Object.keys(state.items)
@@ -101,10 +101,10 @@ export default {
})
},
- transferCategoryId (state, getters) {
+ transferCategoryId(state, getters) {
if (!getters.hasCategories) return null
return Object.keys(state.items)
.find(id => state.items[id].name === 'Перевод' || state.items[id].name === 'Transfer') || state.items.transfer || false
- }
+ },
}
diff --git a/store/categories/index.js b/store/categories/index.js
index 271f95ab..b035b455 100644
--- a/store/categories/index.js
+++ b/store/categories/index.js
@@ -7,13 +7,13 @@ const state = () => ({
editId: null,
modal: {
show: false,
- id: null
- }
+ id: null,
+ },
})
export default {
state,
actions,
getters,
- mutations
+ mutations,
}
diff --git a/store/categories/mutations.js b/store/categories/mutations.js
index 88c1d7de..8752d79c 100644
--- a/store/categories/mutations.js
+++ b/store/categories/mutations.js
@@ -1,5 +1,5 @@
export default {
- setCategories (state, items) {
+ setCategories(state, items) {
const freezedItems = {}
if (items) {
for (const itemId of Object.keys(items))
@@ -16,28 +16,28 @@ export default {
childIds: [],
showInLastUsed: false,
showInQuickSelector: false,
- showStat: false
- }
+ showStat: false,
+ },
}
},
- showCategoryModal (state) {
+ showCategoryModal(state) {
state.modal.show = true
},
- hideCategoryModal (state) {
+ hideCategoryModal(state) {
state.modal.show = false
},
- setCategoryModalId (state, id) {
+ setCategoryModalId(state, id) {
state.modal.id === id
? state.modal.id = null
: state.modal.id = id
},
- setCategoryEditId (state, id) {
+ setCategoryEditId(state, id) {
state.editId === id
? state.editId = null
: state.editId = id
- }
+ },
}
diff --git a/store/chart/actions.js b/store/chart/actions.js
index 601aa879..56fd3423 100644
--- a/store/chart/actions.js
+++ b/store/chart/actions.js
@@ -1,7 +1,7 @@
import localforage from 'localforage'
export default {
- async initChart ({ rootState, commit }) {
+ async initChart({ rootState, commit }) {
const localPeriods = await localforage.getItem('finapp.chart.periods')
let showedPeriods
@@ -16,10 +16,10 @@ export default {
const periodValues = {
...localPeriods[periodName],
- showedPeriods
+ showedPeriods,
}
commit('chart/setPeriodValues', { periodName, values: periodValues }, { root: true })
}
- }
+ },
}
diff --git a/store/chart/index.js b/store/chart/index.js
index 83cd00bc..4b5d30be 100644
--- a/store/chart/index.js
+++ b/store/chart/index.js
@@ -5,22 +5,22 @@ export const state = () => ({
day: {
groupedBy: 'month',
showedPeriods: 14,
- grouped: false
+ grouped: false,
},
week: {
groupedBy: 'month',
showedPeriods: 6,
- grouped: false
+ grouped: false,
},
month: {
groupedBy: 'year',
showedPeriods: 6,
- grouped: false
+ grouped: false,
},
year: {
groupedBy: 'year',
showedPeriods: 3,
- grouped: false
- }
- }
+ grouped: false,
+ },
+ },
})
diff --git a/store/chart/mutations.js b/store/chart/mutations.js
index b17eeb0a..6f0e7404 100644
--- a/store/chart/mutations.js
+++ b/store/chart/mutations.js
@@ -1,34 +1,34 @@
export default {
- setPeriodValues (state, { periodName, values }) {
+ setPeriodValues(state, { periodName, values }) {
state.periods[periodName] = {
...state.periods[periodName],
- ...values
+ ...values,
}
},
- toogleChartPeriodView (state, { periodName }) {
+ toogleChartPeriodView(state, { periodName }) {
state.periods[periodName].grouped = !state.periods[periodName].grouped
},
- addElementsToChart (state, { periodName, periodType }) {
+ addElementsToChart(state, { periodName, periodType }) {
state.periods[periodName][periodType] = state.periods[periodName][periodType] + 1
},
- removeElementsFromChart (state, { periodName, periodType }) {
+ removeElementsFromChart(state, { periodName, periodType }) {
state.periods[periodName][periodType] = state.periods[periodName][periodType] - 1
},
- setElementsToChart (state, { period, value }) {
+ setElementsToChart(state, { period, value }) {
state.periods[period].showedPeriods = value
},
- setHoveredPeriodValues (state, { values, offset }) {
+ setHoveredPeriodValues(state, { values, offset }) {
if (values) state.hoveredPeriod.values = values
if (offset) state.hoveredPeriod.offset = offset
},
- clearHoveredPeriodValues (state) {
+ clearHoveredPeriodValues(state) {
state.hoveredPeriod.values = null
state.hoveredPeriod.offset = null
- }
+ },
}
diff --git a/store/currencies/actions.js b/store/currencies/actions.js
index 82ac94f0..5b869642 100644
--- a/store/currencies/actions.js
+++ b/store/currencies/actions.js
@@ -4,7 +4,7 @@ import { getRatesOf } from './api'
import { getDataOnce, saveData } from '~/services/firebaseHelpers'
export default {
- async initCurrencies ({ rootState, commit }) {
+ async initCurrencies({ rootState, commit }) {
const uid = rootState.user.user.uid
// user base currency in DB
@@ -22,7 +22,7 @@ export default {
rates = await getRatesOf(userBaseCurrency)
saveData(`currencies/${userBaseCurrency}`, {
rates,
- date: today
+ date: today,
})
}
@@ -31,9 +31,9 @@ export default {
localforage.setItem('finapp.currencies', currencies)
},
- setBaseCurrency ({ rootState, dispatch }, baseCurrency) {
+ setBaseCurrency({ rootState, dispatch }, baseCurrency) {
const uid = rootState.user.user.uid
saveData(`users/${uid}/settings/baseCurrency`, baseCurrency)
dispatch('initCurrencies')
- }
+ },
}
diff --git a/store/currencies/api.js b/store/currencies/api.js
index 11a67dfd..c2ef0192 100644
--- a/store/currencies/api.js
+++ b/store/currencies/api.js
@@ -3,7 +3,7 @@ import axios from 'axios'
const key = '5976f9fadc5c46e285d764eae24d384b'
const serviceUrl = `https://openexchangerates.org/api/latest.json?app_id=${key}`
-export const getRatesOf = async (baseCurrency) => {
+export const getRatesOf = async(baseCurrency) => {
if (!baseCurrency) {
console.error('No base currency')
return
diff --git a/store/currencies/index.js b/store/currencies/index.js
index 84eca825..d6f915ff 100644
--- a/store/currencies/index.js
+++ b/store/currencies/index.js
@@ -6,6 +6,6 @@ export const state = () => ({
date: dayjs().valueOf(),
rates: {},
modal: {
- show: false
- }
+ show: false,
+ },
})
diff --git a/store/currencies/mutations.js b/store/currencies/mutations.js
index dc1aac50..7fd98af6 100644
--- a/store/currencies/mutations.js
+++ b/store/currencies/mutations.js
@@ -1,15 +1,15 @@
export default {
- setCurrencies (state, { base, date, rates }) {
+ setCurrencies(state, { base, date, rates }) {
state.base = base
state.date = date
state.rates = rates
},
- showBaseCurrenciesModal (state) {
+ showBaseCurrenciesModal(state) {
state.modal.show = true
},
- hideBaseCurrenciesModal (state) {
+ hideBaseCurrenciesModal(state) {
state.modal.show = false
- }
+ },
}
diff --git a/store/filter/actions.js b/store/filter/actions.js
index 38eb9ddd..de8985fc 100644
--- a/store/filter/actions.js
+++ b/store/filter/actions.js
@@ -2,7 +2,7 @@ import dayjs from 'dayjs'
import localforage from 'localforage'
export default {
- handleSetFilterCategory ({ rootState, dispatch }, categoryId) {
+ handleSetFilterCategory({ rootState, dispatch }, categoryId) {
const filterCategoryId = rootState.filter.categoryId
const filterCategory = rootState.categories.items[categoryId]
@@ -20,21 +20,21 @@ export default {
}
},
- setFilterCategoryId ({ state, commit }, categoryId) {
+ setFilterCategoryId({ state, commit }, categoryId) {
state.categoryId === categoryId
? commit('setFilterCategoryId', null)
: commit('setFilterCategoryId', categoryId)
// TODO: save to composition api
},
- setFilterWalletId ({ state, commit }, walletId) {
+ setFilterWalletId({ state, commit }, walletId) {
state.walletId === walletId
? commit('setFilterWalletId', null)
: commit('setFilterWalletId', walletId)
// TODO: save to composition api
},
- setPeriod ({ commit, dispatch }, period) {
+ setPeriod({ commit, dispatch }, period) {
if (period.custom) {
commit('setPeriod', period.name)
commit('setDate', dayjs().startOf(period.value).valueOf())
@@ -48,11 +48,11 @@ export default {
dispatch('ui/saveUiView', null, { root: true })
},
- setDate ({ commit }, date) {
+ setDate({ commit }, date) {
commit('setDate', dayjs(date).valueOf())
},
- setPeriodNext ({ state, commit, rootState, rootGetters }) {
+ setPeriodNext({ state, commit, rootState, rootGetters }) {
if (rootGetters['trns/hasTrns']) {
const trns = rootState.trns.items
const firstCreatedTrnIdFromSelectedTrns = rootGetters['trns/firstCreatedTrnIdFromSelectedTrns']
@@ -65,11 +65,11 @@ export default {
}
},
- setPeriodPrev ({ state, commit, rootGetters }) {
+ setPeriodPrev({ state, commit, rootGetters }) {
if (rootGetters['trns/hasTrns']) {
const filterDate = state.date
const nextDate = dayjs(filterDate).add(1, state.period).startOf(state.period).valueOf()
if (nextDate < dayjs().valueOf()) commit('setPeriodPrev', nextDate)
}
- }
+ },
}
diff --git a/store/filter/index.js b/store/filter/index.js
index 7f4a99a1..74a9c112 100644
--- a/store/filter/index.js
+++ b/store/filter/index.js
@@ -4,5 +4,5 @@ export const state = () => ({
categoryId: null,
walletId: null,
date: dayjs().startOf('month').valueOf(),
- period: 'month'
+ period: 'month',
})
diff --git a/store/filter/mutations.js b/store/filter/mutations.js
index a4041ed9..214a5452 100644
--- a/store/filter/mutations.js
+++ b/store/filter/mutations.js
@@ -1,31 +1,31 @@
import dayjs from 'dayjs'
export default {
- setDate (state, date) {
+ setDate(state, date) {
state.date = dayjs(date).valueOf()
},
- setFilterCategoryId (state, categoryId) {
+ setFilterCategoryId(state, categoryId) {
state.categoryId = categoryId
},
- setFilterDateNow (state) {
+ setFilterDateNow(state) {
state.date = dayjs().valueOf()
},
- setFilterWalletId (state, walletId) {
+ setFilterWalletId(state, walletId) {
state.walletId = walletId
},
- setPeriod (state, period) {
+ setPeriod(state, period) {
state.period = period
},
- setPeriodNext (state, date) {
+ setPeriodNext(state, date) {
state.date = date
},
- setPeriodPrev (state, date) {
+ setPeriodPrev(state, date) {
state.date = date
- }
+ },
}
diff --git a/store/lang/actions.js b/store/lang/actions.js
index a3509b01..f63ae3f7 100644
--- a/store/lang/actions.js
+++ b/store/lang/actions.js
@@ -1,8 +1,8 @@
import localforage from 'localforage'
-import { saveData, getDataOnce } from '~/services/firebaseHelpers'
+import { getDataOnce, saveData } from '~/services/firebaseHelpers'
export default {
- setLang ({ commit, rootGetters }, lang) {
+ setLang({ commit, rootGetters }, lang) {
const uid = rootGetters['user/userUid']
if (uid)
saveData(`users/${uid}/settings/lang`, lang)
@@ -16,12 +16,12 @@ export default {
}
},
- async initLocalLang ({ commit }) {
+ async initLocalLang({ commit }) {
const localLang = await localforage.getItem('finapp.lang')
if (localLang) commit('setLang', localLang)
},
- async initDbLang ({ commit, rootGetters }) {
+ async initDbLang({ commit, rootGetters }) {
const uid = rootGetters['user/userUid']
if (!uid) return
@@ -35,5 +35,5 @@ export default {
if (this.app.i18n.locale !== lang)
this.app.i18n.setLocale(lang)
}
- }
+ },
}
diff --git a/store/lang/index.js b/store/lang/index.js
index 70107d4d..58c69796 100644
--- a/store/lang/index.js
+++ b/store/lang/index.js
@@ -2,11 +2,11 @@ import actions from './actions'
import mutations from './mutations'
const state = () => ({
- lang: 'en'
+ lang: 'en',
})
export default {
state,
actions,
- mutations
+ mutations,
}
diff --git a/store/lang/mutations.js b/store/lang/mutations.js
index 3a7d40dd..cb78b8b5 100644
--- a/store/lang/mutations.js
+++ b/store/lang/mutations.js
@@ -1,5 +1,5 @@
export default {
- setLang (state, lang) {
+ setLang(state, lang) {
state.lang = lang
- }
+ },
}
diff --git a/store/stat/actions.js b/store/stat/actions.js
index 6f648018..b8a44611 100644
--- a/store/stat/actions.js
+++ b/store/stat/actions.js
@@ -1,6 +1,6 @@
export default {
- setDiffPeriods ({ commit, dispatch }, value) {
+ setDiffPeriods({ commit, dispatch }, value) {
commit('setDiffPeriods', value)
dispatch('ui/saveUiView', null, { root: true })
- }
+ },
}
diff --git a/store/stat/getters.js b/store/stat/getters.js
index c4245bab..480579a9 100644
--- a/store/stat/getters.js
+++ b/store/stat/getters.js
@@ -9,7 +9,7 @@ export default {
* @return {Number} return[date].expenses
* @return {Number} return[date].total
*/
- statAverage (_state, getters) {
+ statAverage(_state, getters) {
const statPeriods = getters.statByPeriods
let incomes = 0
@@ -18,7 +18,7 @@ export default {
const periodsCounter = {
incomes: 0,
expenses: 0,
- total: 0
+ total: 0,
}
for (const idx in statPeriods) {
@@ -38,7 +38,7 @@ export default {
return {
incomes: incomes !== 0 ? Math.ceil(incomes / periodsCounter.incomes) : 0,
expenses: expenses !== 0 ? Math.ceil(expenses / periodsCounter.expenses) : 0,
- total: total !== 0 ? Math.ceil(total / periodsCounter.total) : 0
+ total: total !== 0 ? Math.ceil(total / periodsCounter.total) : 0,
}
},
@@ -51,7 +51,7 @@ export default {
* @return {Number} return[date].expenses
* @return {Number} return[date].total
*/
- statByPeriods (_state, _getters, rootState, rootGetters) {
+ statByPeriods(_state, _getters, rootState, rootGetters) {
const trns = rootState.trns.items
const transferCategoryId = rootGetters['categories/transferCategoryId']
const trnsIds = rootGetters['trns/selectedTrnsIds']
@@ -72,21 +72,21 @@ export default {
const dateEndOfPeriod = dayjs().subtract(period, periodName).endOf(periodName)
const ids = trnsIds
.filter(trnId =>
- trns[trnId].date >= dateStartOfPeriod &&
- trns[trnId].date <= dateEndOfPeriod &&
- trns[trnId].categoryId !== transferCategoryId
+ trns[trnId].date >= dateStartOfPeriod
+ && trns[trnId].date <= dateEndOfPeriod
+ && trns[trnId].categoryId !== transferCategoryId,
)
stat[dateStartOfPeriod.valueOf()] = {
date: dateStartOfPeriod.valueOf(),
- ...rootGetters['trns/getTotalOfTrnsIds'](ids)
+ ...rootGetters['trns/getTotalOfTrnsIds'](ids),
}
}
return stat
},
- isFirstPeriodSelected (state, getters, rootState, rootGetters) {
+ isFirstPeriodSelected(state, getters, rootState, rootGetters) {
if (rootGetters['trns/hasTrns']) {
if (dayjs(rootState.filter.date).isSame(dayjs(), rootState.filter.period))
return true
@@ -96,7 +96,7 @@ export default {
}
},
- isLastPeriodSelected (state, getters, rootState, rootGetters) {
+ isLastPeriodSelected(state, getters, rootState, rootGetters) {
if (rootGetters['trns/hasTrns']) {
const trns = rootState.trns.items
const firstCreatedTrnIdFromSelectedTrns = rootGetters['trns/firstCreatedTrnIdFromSelectedTrns']
@@ -150,7 +150,7 @@ export default {
* { categiryId: [...trnId, trnId] }
*/
getCategoriesIdsWithTrnsIds: (state, getters, rootState, rootGetters) => ({
- trnsIds
+ trnsIds,
}) => {
const filterCategoryId = rootState.filter.categoryId
const trns = rootState.trns.items
@@ -214,7 +214,7 @@ export default {
}
// sort categories amount
- function sortCategoriesByTotal (categories, typeName) {
+ function sortCategoriesByTotal(categories, typeName) {
const categoriesIds = Object.keys(categories)
let sortedCategoriesIds = []
@@ -234,7 +234,7 @@ export default {
const expensesCategoriesIds = sortCategoriesByTotal(statExpenses, 'expenses')
// get first item in sorted catgories
- function getBiggestAmount (categoriesTotal, categoriesIds, typeName) {
+ function getBiggestAmount(categoriesTotal, categoriesIds, typeName) {
const biggestAmount = categoriesIds[0]
return categoriesTotal[biggestAmount] && Math.abs(categoriesTotal[biggestAmount][typeName])
}
@@ -249,21 +249,21 @@ export default {
expenses: {
biggest: expensesBiggest,
categoriesIds: expensesCategoriesIds,
- total: totalAllTrns.expenses
+ total: totalAllTrns.expenses,
},
incomes: {
biggest: incomesBiggest,
categoriesIds: incomesCategoriesIds,
- total: totalAllTrns.incomes
- }
+ total: totalAllTrns.incomes,
+ },
}
return stat
},
- statCurrentPeriod (_state, getters, rootState) {
+ statCurrentPeriod(_state, getters, rootState) {
const date = rootState.filter.date
const stat = getters.getStat({ date })
return stat
- }
+ },
}
diff --git a/store/stat/index.js b/store/stat/index.js
index 65c9d4e6..19e40a45 100644
--- a/store/stat/index.js
+++ b/store/stat/index.js
@@ -2,6 +2,6 @@ export const state = () => ({
showedPeriods: 10,
categoryModal: {
id: null,
- type: null
- }
+ type: null,
+ },
})
diff --git a/store/stat/mutations.js b/store/stat/mutations.js
index 58364a76..f88f70bd 100644
--- a/store/stat/mutations.js
+++ b/store/stat/mutations.js
@@ -1,11 +1,11 @@
export default {
- setDiffPeriods (state, value) {
+ setDiffPeriods(state, value) {
const number = parseInt(value) || 1
state.showedPeriods = number
},
- setCategoryModal (state, { id, type }) {
+ setCategoryModal(state, { id, type }) {
state.categoryModal.id = id
state.categoryModal.type = type
- }
+ },
}
diff --git a/store/trnForm/actions.js b/store/trnForm/actions.js
index f43276d2..55aa7f22 100644
--- a/store/trnForm/actions.js
+++ b/store/trnForm/actions.js
@@ -1,14 +1,14 @@
import dayjs from 'dayjs'
export default {
- closeTrnForm ({ commit }) {
+ closeTrnForm({ commit }) {
commit('closeTrnForm')
commit('setTrnFormValues', {
- trnId: null
+ trnId: null,
})
},
- openTrnForm ({ rootState, rootGetters, commit }, { action, trnId }) {
+ openTrnForm({ rootState, rootGetters, commit }, { action, trnId }) {
commit('openTrnForm')
switch (action) {
case 'create':
@@ -23,7 +23,7 @@ export default {
description: null,
groups: null,
trnId: null,
- walletId: lastTrn.walletId
+ walletId: lastTrn.walletId,
})
}
else {
@@ -40,7 +40,7 @@ export default {
description: null,
groups: null,
trnId: null,
- walletId
+ walletId,
})
}
break
@@ -62,7 +62,7 @@ export default {
trnId,
walletFromId: trn.walletFromId,
walletId: trn.walletId,
- walletToId: trn.walletToId
+ walletToId: trn.walletToId,
})
}
// Simple
@@ -76,7 +76,7 @@ export default {
description: trn.description || null,
groups: trn.groups || null,
trnId,
- walletId: trn.walletId
+ walletId: trn.walletId,
})
}
}
@@ -93,10 +93,10 @@ export default {
description: trn.description || null,
groups: null,
trnId: null,
- walletId: trn.walletId
+ walletId: trn.walletId,
})
}
break
}
- }
+ },
}
diff --git a/store/trnForm/index.js b/store/trnForm/index.js
index 774b27cd..4c10b5e0 100644
--- a/store/trnForm/index.js
+++ b/store/trnForm/index.js
@@ -8,7 +8,7 @@ export const baseModalState = {
transferFrom: false,
transferTo: false,
wallets: false,
- trn: false
+ trn: false,
}
export const state = () => ({
@@ -19,7 +19,7 @@ export const state = () => ({
transfer: {
from: null,
- to: null
+ to: null,
},
show: false,
@@ -33,6 +33,6 @@ export const state = () => ({
date: dayjs().valueOf(),
description: null,
trnId: null,
- walletId: null
- }
+ walletId: null,
+ },
})
diff --git a/store/trnForm/mutations.js b/store/trnForm/mutations.js
index 4ab4e995..0bbb5475 100644
--- a/store/trnForm/mutations.js
+++ b/store/trnForm/mutations.js
@@ -1,49 +1,49 @@
export default {
- setTrnFormValues (state, values) {
+ setTrnFormValues(state, values) {
state.values = {
...state.values,
- ...values
+ ...values,
}
},
- setTrnFormTransfer (state, { tranferType, walletId }) {
+ setTrnFormTransfer(state, { tranferType, walletId }) {
if (tranferType)
state.transfer[tranferType] = walletId
},
- setTrnFormHeight (state, height) {
+ setTrnFormHeight(state, height) {
state.height = height
},
- setTrnFormModalCategoryId (state, id) {
+ setTrnFormModalCategoryId(state, id) {
state.showModalCategoryId === id
? state.showModalCategoryId = null
: state.showModalCategoryId = id
},
- setTrnFormModalTrnId (state, id) {
+ setTrnFormModalTrnId(state, id) {
state.showModalTrnId === id
? state.showModalTrnId = null
: state.showModalTrnId = id
},
- closeTrnFormModal (state, modalName) {
+ closeTrnFormModal(state, modalName) {
state.modal[modalName] = false
},
- showTrnFormModal (state, modalName) {
+ showTrnFormModal(state, modalName) {
state.modal[modalName] = true
},
- closeTrnForm (state) {
+ closeTrnForm(state) {
state.show = false
},
- openTrnForm (state) {
+ openTrnForm(state) {
state.show = true
},
- toogleTrnForm (state) {
+ toogleTrnForm(state) {
state.show = !state.show
- }
+ },
}
diff --git a/store/trns/actions.js b/store/trns/actions.js
index fb5e7f5b..89fc5983 100644
--- a/store/trns/actions.js
+++ b/store/trns/actions.js
@@ -2,9 +2,9 @@ import localforage from 'localforage'
import dayjs from 'dayjs'
import {
removeTrnToAddLaterLocal,
- saveTrnToAddLaterLocal,
+ removeTrnToDeleteLaterLocal,
saveTrnIDforDeleteWhenClientOnline,
- removeTrnToDeleteLaterLocal
+ saveTrnToAddLaterLocal,
} from './helpers'
import useCalculator from '~/components/trnForm/calculator/useCalculator'
import {
@@ -12,17 +12,17 @@ import {
removeData,
saveData,
unsubcribeData,
- updateData
+ updateData,
} from '~/services/firebaseHelpers'
export default {
// init
- initTrns ({ rootGetters, dispatch }) {
+ initTrns({ rootGetters, dispatch }) {
const path = `users/${rootGetters['user/userUid']}/trns`
getDataAndWatch(path, items => dispatch('setTrns', items || {}))
},
- setTrns ({ commit }, items) {
+ setTrns({ commit }, items) {
commit('setTrns', items)
localforage.setItem('finapp.trns', items)
},
@@ -35,12 +35,12 @@ export default {
* @param id
* @param values
*/
- addTrn ({ commit, rootState }, { id, values }) {
+ addTrn({ commit, rootState }, { id, values }) {
const uid = rootState.user.user.uid
const trns = rootState.trns.items
const valuesWithEditDate = {
...values,
- edited: dayjs().valueOf()
+ edited: dayjs().valueOf(),
}
let isTrnSavedOnline = false
@@ -63,14 +63,14 @@ export default {
commit('trnForm/setTrnFormValues', {
trnId: null,
amount: '0',
- description: null
+ description: null,
}, { root: true })
return true
},
// delete
- deleteTrn ({ commit, rootState }, id) {
+ deleteTrn({ commit, rootState }, id) {
const uid = rootState.user.user.uid
const trns = { ...rootState.trns.items }
@@ -83,7 +83,7 @@ export default {
.then(() => removeTrnToDeleteLaterLocal(id))
},
- deleteTrnsByIds ({ rootState }, trnsIds) {
+ deleteTrnsByIds({ rootState }, trnsIds) {
const uid = rootState.user.user.uid
const trnsForDelete = {}
for (const trnId of trnsIds)
@@ -92,7 +92,7 @@ export default {
updateData(`users/${uid}/trns`, trnsForDelete)
},
- unsubcribeTrns ({ rootState }) {
+ unsubcribeTrns({ rootState }) {
const uid = rootState.user.user.uid
unsubcribeData(`users/${uid}/trns`)
},
@@ -104,8 +104,8 @@ export default {
* get trns from local storage
* and add trns to database
*/
- uploadOfflineTrns ({ dispatch, rootState }) {
- getDataAndWatch('.info/connected', async (isConnected) => {
+ uploadOfflineTrns({ dispatch, rootState }) {
+ getDataAndWatch('.info/connected', async(isConnected) => {
if (isConnected) {
const trnsArrayForDelete = await localforage.getItem('finapp.trns.offline.delete') || []
const trnsItemsForUpdate = await localforage.getItem('finapp.trns.offline.update') || {}
@@ -134,11 +134,11 @@ export default {
console.log('update', trnId, trnsItemsForUpdate[trnId])
dispatch('addTrn', {
id: trnId,
- values: trnsItemsForUpdate[trnId]
+ values: trnsItemsForUpdate[trnId],
})
}
}
}
})
- }
+ },
}
diff --git a/store/trns/getters.js b/store/trns/getters.js
index 11203a40..26fd4fac 100644
--- a/store/trns/getters.js
+++ b/store/trns/getters.js
@@ -1,7 +1,7 @@
import dayjs from 'dayjs'
export default {
- hasTrns (_state, _getters, rootState) {
+ hasTrns(_state, _getters, rootState) {
if (rootState.trns.items) {
if (Object.keys(rootState.trns.items).length > 0)
return true
@@ -60,7 +60,7 @@ export default {
return {
expenses: Math.abs(+expenses.toFixed(0)),
incomes: Math.abs(+incomes.toFixed(0)),
- total: parseInt(incomes - expenses)
+ total: parseInt(incomes - expenses),
}
},
@@ -75,7 +75,7 @@ export default {
return trnsIds
},
- lastCreatedTrnId (state, getters, rootState, rootGetters) {
+ lastCreatedTrnId(state, getters, rootState, rootGetters) {
if (getters.hasTrns) {
const trnsIds = getters.sortedTrnsIds
const trns = rootState.trns.items
@@ -90,21 +90,21 @@ export default {
}
},
- firstCreatedTrnId (state, getters) {
+ firstCreatedTrnId(state, getters) {
if (getters.hasTrns) {
const trnsIds = [...getters.sortedTrnsIds].reverse()
return trnsIds[0]
}
},
- firstCreatedTrnIdFromSelectedTrns (state, getters) {
+ firstCreatedTrnIdFromSelectedTrns(state, getters) {
const trnsIds = [...getters.selectedTrnsIds].reverse()
if (trnsIds.length)
return trnsIds[0]
},
// selectedTrnsIds
- selectedTrnsIds (_state, getters, rootState) {
+ selectedTrnsIds(_state, getters, rootState) {
if (!getters.hasTrns) return []
const categories = rootState.categories.items
@@ -144,7 +144,7 @@ export default {
return trnsIds
},
- selectedTrnsIdsWithDate (_state, getters, rootState) {
+ selectedTrnsIdsWithDate(_state, getters, rootState) {
if (!getters.hasTrns) return []
const trns = rootState.trns.items
@@ -158,8 +158,8 @@ export default {
if (filterPeriod !== 'all') {
trnsIds = trnsIds.filter(
trnId =>
- (trns[trnId].date >= startDateValue) &&
- (trns[trnId].date <= endDateValue))
+ (trns[trnId].date >= startDateValue)
+ && (trns[trnId].date <= endDateValue))
}
trnsIds = trnsIds
@@ -173,7 +173,7 @@ export default {
},
// sortedTrnsIds
- sortedTrnsIds (state, getters) {
+ sortedTrnsIds(state, getters) {
if (!getters.hasTrns) return []
const trns = state.items
@@ -310,5 +310,5 @@ export default {
})
return trnsIds || []
- }
+ },
}
diff --git a/store/trns/helpers.js b/store/trns/helpers.js
index 37b62645..648fed05 100644
--- a/store/trns/helpers.js
+++ b/store/trns/helpers.js
@@ -1,16 +1,16 @@
import localforage from 'localforage'
// save added trn to local
-export const saveTrnToAddLaterLocal = async ({ id, values }) => {
+export const saveTrnToAddLaterLocal = async({ id, values }) => {
const trns = await localforage.getItem('finapp.trns.offline.update')
await localforage.setItem('finapp.trns.offline.update', {
...trns,
- [id]: values
+ [id]: values,
})
}
// remove added trn from local
-export const removeTrnToAddLaterLocal = async (id) => {
+export const removeTrnToAddLaterLocal = async(id) => {
const trns = await localforage.getItem('finapp.trns.offline.update') || {}
// console.log('removeTrnToAddLaterLocal', trns)
if (trns[id]) {
@@ -21,24 +21,24 @@ export const removeTrnToAddLaterLocal = async (id) => {
}
// save deleted trn to local
-export const saveTrnIDforDeleteWhenClientOnline = async (id) => {
+export const saveTrnIDforDeleteWhenClientOnline = async(id) => {
const trnsIds = await localforage.getItem('finapp.trns.offline.delete') || []
if (trnsIds.includes(id)) return
await localforage.setItem('finapp.trns.offline.delete', [
...trnsIds,
- id
+ id,
])
}
// remove deleted trn from local
-export const removeTrnToDeleteLaterLocal = async (id) => {
+export const removeTrnToDeleteLaterLocal = async(id) => {
const trnsIds = await localforage.getItem('finapp.trns.offline.delete') || []
const trnId = trnsIds.find(trnId => trnId === id)
if (trnId) {
await localforage.setItem('finapp.trns.offline.delete', [
- ...trnsIds.filter(trnId => trnId !== id)
+ ...trnsIds.filter(trnId => trnId !== id),
])
}
}
diff --git a/store/trns/index.js b/store/trns/index.js
index 25f3d3d2..298dcff5 100644
--- a/store/trns/index.js
+++ b/store/trns/index.js
@@ -5,17 +5,17 @@ import mutations from './mutations'
const state = () => ({
items: {},
edit: {
- id: null
+ id: null,
},
modal: {
show: false,
- id: null
- }
+ id: null,
+ },
})
export default {
state,
actions,
getters,
- mutations
+ mutations,
}
diff --git a/store/trns/mutations.js b/store/trns/mutations.js
index 51b59247..ab05bf0d 100644
--- a/store/trns/mutations.js
+++ b/store/trns/mutations.js
@@ -1,28 +1,26 @@
export default {
- setTrns (state, items) {
+ setTrns(state, items) {
const freezedItems = {}
if (items) {
- for (const itemId of Object.keys(items)) {
+ for (const itemId of Object.keys(items))
freezedItems[itemId] = Object.freeze(items[itemId])
- }
}
state.items = freezedItems
},
- showTrnModal (state) {
+ showTrnModal(state) {
state.modal.show = true
},
- hideTrnModal (state) {
+ hideTrnModal(state) {
state.modal.show = false
},
- setTrnModalId (state, id) {
- if (state.modal.id === id) {
+ setTrnModalId(state, id) {
+ if (state.modal.id === id)
state.modal.id = null
- }
- else {
+
+ else
state.modal.id = id
- }
- }
+ },
}
diff --git a/store/ui/actions.js b/store/ui/actions.js
index 7f688e76..773e8d53 100644
--- a/store/ui/actions.js
+++ b/store/ui/actions.js
@@ -1,7 +1,7 @@
import localforage from 'localforage'
export default {
- async initUi ({ dispatch }) {
+ async initUi({ dispatch }) {
const uiLocalStore = await localforage.getItem('finapp.stat')
// ui
@@ -17,7 +17,7 @@ export default {
*
* @param {string} theme - New theme value (light, dark).
*/
- changeTheme (_, theme) {
+ changeTheme(_, theme) {
// eslint-disable-next-line no-undef
const currentTheme = $nuxt.$colorMode.value
let newTheme
@@ -36,7 +36,7 @@ export default {
* @param {number} height
* @param {number} width
*/
- setAppDimensions ({ commit }, { height, width }) {
+ setAppDimensions({ commit }, { height, width }) {
let view = 'mobile'
if (width >= 1300) view = 'pc'
@@ -44,7 +44,7 @@ export default {
mobile: view === 'mobile',
pc: view === 'pc',
width,
- height
+ height,
})
},
@@ -54,7 +54,7 @@ export default {
*
* @param {string} nextTab - Next tab name.
*/
- setActiveTab ({ commit, state }, nextTab) {
+ setActiveTab({ commit, state }, nextTab) {
if (state.activeTab !== nextTab) {
commit('setActiveTab', nextTab)
localforage.setItem('finapp.stat', state)
@@ -67,7 +67,7 @@ export default {
*
* @param {string} nextTab - Next tab name.
*/
- setActiveTabStat ({ commit, state }, nextTab) {
+ setActiveTabStat({ commit, state }, nextTab) {
commit('setActiveTabStat', nextTab)
localforage.setItem('finapp.stat', state)
},
@@ -75,7 +75,7 @@ export default {
/**
* Save ui view state to localStorage for selected filter
*/
- async saveUiView ({ rootState }) {
+ async saveUiView({ rootState }) {
const localName = 'finapp.statViewConfig'
const localFilterUi = await localforage.getItem(localName)
const walletName = rootState.filter.walletId || 'root'
@@ -87,11 +87,11 @@ export default {
...localFilterUi,
[uiItemName]: {
period: rootState.filter.period,
- totalChartPeriods: rootState.chart.periods
- }
+ totalChartPeriods: rootState.chart.periods,
+ },
})
const periods = rootState.chart.periods
localforage.setItem('finapp.chart.periods', periods)
- }
+ },
}
diff --git a/store/ui/index.js b/store/ui/index.js
index 52f7da30..16bbe2fb 100644
--- a/store/ui/index.js
+++ b/store/ui/index.js
@@ -10,11 +10,11 @@ const state = () => ({
mobile: false,
pc: false,
- defaultBgColor: '#455a64'
+ defaultBgColor: '#455a64',
})
export default {
state,
actions,
- mutations
+ mutations,
}
diff --git a/store/ui/mutations.js b/store/ui/mutations.js
index 33082c10..3c6b689f 100644
--- a/store/ui/mutations.js
+++ b/store/ui/mutations.js
@@ -1,16 +1,16 @@
export default {
- setActiveTab (state, tabName) {
+ setActiveTab(state, tabName) {
state.activeTab = tabName
},
- setActiveTabStat (state, tabName) {
+ setActiveTabStat(state, tabName) {
state.activeTabStat = tabName
},
- setAppDimensions (state, props) {
+ setAppDimensions(state, props) {
state.mobile = props.mobile
state.pc = props.pc
state.height = props.height
state.width = props.width
- }
+ },
}
diff --git a/store/user/actions.js b/store/user/actions.js
index 99c8164b..67ca5b8e 100644
--- a/store/user/actions.js
+++ b/store/user/actions.js
@@ -6,23 +6,23 @@ import { auth, getDataOnce, saveData } from '~/services/firebaseHelpers'
import pkg from '~/package'
export default {
- initUser ({ dispatch }, userParams) {
+ initUser({ dispatch }, userParams) {
const user = {
displayName: userParams.displayName,
email: userParams.email,
- uid: userParams.uid
+ uid: userParams.uid,
}
dispatch('setUser', user)
dispatch('saveUserInfo', user)
},
- setUser ({ commit }, user) {
+ setUser({ commit }, user) {
commit('setUser', user)
localforage.setItem('finapp.user', user)
},
- async signOut ({ rootGetters, dispatch }) {
+ async signOut({ rootGetters, dispatch }) {
const uid = rootGetters['user/userUid']
saveData(`users-info/${uid}/actions/${dayjs().valueOf()}`, 'signOut')
@@ -37,7 +37,7 @@ export default {
this.app.context.redirect('/login')
},
- async saveUserInfo ({ rootState }) {
+ async saveUserInfo({ rootState }) {
const user = rootState.user.user
const todayValueOf = dayjs().valueOf()
@@ -47,7 +47,7 @@ export default {
displayName: user.displayName,
email: user.email,
uid: user.uid,
- loginDate: todayValueOf
+ loginDate: todayValueOf,
}
saveData(`users/${user.uid}/user`, userData)
@@ -65,7 +65,7 @@ export default {
saveData(`users-info/${user.uid}/opensApp/${pkg.version.split('.').join('')}`, dayjs().valueOf())
},
- removeUserData ({ rootGetters, commit, dispatch }) {
+ removeUserData({ rootGetters, commit, dispatch }) {
commit('app/setAppStatus', 'loading', { root: true })
dispatch('ui/setActiveTab', null, { root: true })
const uid = rootGetters['user/userUid']
@@ -75,5 +75,5 @@ export default {
saveData(`users/${uid}/trns/`, null)
saveData(`users-info/${uid}/actions/${dayjs().valueOf()}`, 'removeUserData')
commit('app/setAppStatus', 'ready', { root: true })
- }
+ },
}
diff --git a/store/user/getters.js b/store/user/getters.js
index e130ff2a..ce21e9aa 100644
--- a/store/user/getters.js
+++ b/store/user/getters.js
@@ -1,6 +1,6 @@
export default {
- userUid (_state, _getters, rootState) {
+ userUid(_state, _getters, rootState) {
if (rootState.user && rootState.user.user && rootState.user.user)
return rootState.user.user.uid
- }
+ },
}
diff --git a/store/user/index.js b/store/user/index.js
index 70c9fe3d..c0c3e280 100644
--- a/store/user/index.js
+++ b/store/user/index.js
@@ -3,12 +3,12 @@ import getters from './getters'
import mutations from './mutations'
const state = () => ({
- user: null
+ user: null,
})
export default {
state,
actions,
getters,
- mutations
+ mutations,
}
diff --git a/store/user/mutations.js b/store/user/mutations.js
index 61114507..96d0a02d 100644
--- a/store/user/mutations.js
+++ b/store/user/mutations.js
@@ -1,5 +1,5 @@
export default {
- setUser (state, user) {
+ setUser(state, user) {
state.user = user
- }
+ },
}
diff --git a/store/wallets/actions.js b/store/wallets/actions.js
index 9191cab5..65bf5829 100644
--- a/store/wallets/actions.js
+++ b/store/wallets/actions.js
@@ -1,20 +1,20 @@
import localforage from 'localforage'
-import { saveData, getDataAndWatch, updateData, unsubcribeData } from '~/services/firebaseHelpers'
+import { getDataAndWatch, saveData, unsubcribeData, updateData } from '~/services/firebaseHelpers'
export default {
- initWallets ({ dispatch, rootState }) {
+ initWallets({ dispatch, rootState }) {
const uid = rootState.user.user.uid
getDataAndWatch(`users/${uid}/accounts`, (items) => {
dispatch('setWallets', Object.freeze(items || {}))
})
},
- setWallets ({ commit }, items) {
+ setWallets({ commit }, items) {
commit('setWallets', items)
localforage.setItem('finapp.wallets', items)
},
- addWallet ({ dispatch, rootState, getters }, { id, values }) {
+ addWallet({ dispatch, rootState, getters }, { id, values }) {
const uid = rootState.user.user.uid
const formatedValues = {
@@ -23,7 +23,7 @@ export default {
currency: values.currency,
isCredit: values.isCredit,
name: values.name,
- order: parseInt(values.order) || 1
+ order: parseInt(values.order) || 1,
}
// set default currency based on first created wallet
@@ -39,7 +39,7 @@ export default {
* Update only order field for each wallet
*
*/
- async saveWalletsOrder ({ rootGetters }, wallets) {
+ async saveWalletsOrder({ rootGetters }, wallets) {
const updates = {}
const result = {}
@@ -53,8 +53,8 @@ export default {
return result
},
- unsubcribeWallets ({ rootGetters }) {
+ unsubcribeWallets({ rootGetters }) {
const uid = rootGetters['user/userUid']
unsubcribeData(`users/${uid}/accounts`)
- }
+ },
}
diff --git a/store/wallets/getters.js b/store/wallets/getters.js
index 844d4b2e..67dccf5d 100644
--- a/store/wallets/getters.js
+++ b/store/wallets/getters.js
@@ -3,7 +3,7 @@
// walletsSortedIds
export default {
- hasWallets (state, getters, rootState) {
+ hasWallets(state, getters, rootState) {
if (rootState.wallets.items) {
if (Object.keys(rootState.wallets.items).length > 0)
return true
@@ -18,7 +18,7 @@ export default {
return total || 0
},
- walletsTotal (state, getters, rootState, rootGetters) {
+ walletsTotal(state, getters, rootState, rootGetters) {
if (!getters.hasWallets) return {}
const walletsTotal = {}
const wallets = rootState.wallets.items
@@ -32,14 +32,14 @@ export default {
Object.keys(wallets).forEach((id) => {
walletsTotal[id] = {
base: getWalletAmount(id),
- currency: wallets[id].currency
+ currency: wallets[id].currency,
}
})
return walletsTotal
},
- walletsSortedIds (state, getters) {
+ walletsSortedIds(state, getters) {
if (!getters.hasWallets) return []
return Object.keys(state.items).sort((a, b) => {
if (parseInt(state.items[a].order) < parseInt(state.items[b].order)) return -1
@@ -51,7 +51,7 @@ export default {
getWalletWithId: (state, getters, rootState, rootGetters) => (walletId) => {
return {
id: walletId,
- ...rootState.wallets.items[walletId]
+ ...rootState.wallets.items[walletId],
}
- }
+ },
}
diff --git a/store/wallets/index.js b/store/wallets/index.js
index e50c1c2f..a4836e63 100644
--- a/store/wallets/index.js
+++ b/store/wallets/index.js
@@ -3,6 +3,6 @@ export const state = () => ({
editId: null,
modal: {
show: false,
- id: null
- }
+ id: null,
+ },
})
diff --git a/store/wallets/mutations.js b/store/wallets/mutations.js
index f8802cd2..eb5970ec 100644
--- a/store/wallets/mutations.js
+++ b/store/wallets/mutations.js
@@ -1,37 +1,34 @@
export default {
- setWallets (state, items) {
+ setWallets(state, items) {
const freezedItems = {}
if (items) {
- for (const itemId of Object.keys(items)) {
+ for (const itemId of Object.keys(items))
freezedItems[itemId] = Object.freeze(items[itemId])
- }
}
state.items = freezedItems
},
- showWalletsModalWalletModal (state) {
+ showWalletsModalWalletModal(state) {
state.modal.show = true
},
- hideWalletsModalWalletModal (state) {
+ hideWalletsModalWalletModal(state) {
state.modal.show = false
},
- setWalletsModalWalletModalId (state, id) {
- if (state.modal.id === id) {
+ setWalletsModalWalletModalId(state, id) {
+ if (state.modal.id === id)
state.modal.id = null
- }
- else {
+
+ else
state.modal.id = id
- }
},
- setWalletEditId (state, id) {
- if (state.editId === id) {
+ setWalletEditId(state, id) {
+ if (state.editId === id)
state.editId = null
- }
- else {
+
+ else
state.editId = id
- }
- }
+ },
}
diff --git a/tailwind.config.js b/tailwind.config.js
index 4b16aa44..f3eec8c6 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -7,7 +7,7 @@ module.exports = {
'./components/**/*.{js,ts}',
'./layouts/**/*.{js,ts}',
'./modules/**/*.{js,ts}',
- './pages/**/*.{js,ts}'
+ './pages/**/*.{js,ts}',
],
theme: {
@@ -21,25 +21,25 @@ module.exports = {
white1: '#fdfdfd',
white2: '#fcfcfd',
blue1: '#58a6ff',
- blue2: '#0366d6'
+ blue2: '#0366d6',
},
fontSize: {
- '2xs': '10px'
+ '2xs': '10px',
},
fontFamily: {
nunito: ['Nunito', 'Roboto', 'sans-serif'],
roboto: ['Roboto', 'sans-serif'],
- unica: ['"Unica One"', '"Roboto Condensed"', 'sans-serif']
+ unica: ['"Unica One"', '"Roboto Condensed"', 'sans-serif'],
},
minWidth: {
- base: '320px'
- }
- }
+ base: '320px',
+ },
+ },
},
plugins: [
- plugin(function ({ addVariant }) {
+ plugin(({ addVariant }) => {
addVariant('hocus', ['.isNotTouchDevice &:hover', '&:active'])
- })
- ]
+ }),
+ ],
}
diff --git a/utils/debounce.js b/utils/debounce.js
index d4e277df..e0763c34 100755
--- a/utils/debounce.js
+++ b/utils/debounce.js
@@ -1,8 +1,8 @@
-export default function debounce (func, interval) {
+export default function debounce(func, interval) {
let timeout
- return function () {
+ return function() {
const context = this; const args = arguments
- const later = function () {
+ const later = function() {
timeout = null
func.apply(context, args)
}
diff --git a/utils/formatDate.js b/utils/formatDate.js
index 09245208..f8b7b302 100644
--- a/utils/formatDate.js
+++ b/utils/formatDate.js
@@ -4,7 +4,7 @@ const calendar = require('dayjs/plugin/calendar')
dayjs.extend(calendar)
dayjs.locale('en', {
- mondayFirst: true
+ mondayFirst: true,
})
export const formatDate = (value, type) => {
@@ -21,11 +21,11 @@ export const formatDate = (value, type) => {
nextWeek: 'dddd',
lastDay: `[${currentLocale === 'ru' ? 'Вчера' : 'Yesterday'}] dddd`,
lastWeek: 'dddd',
- sameElse: 'dddd'
+ sameElse: 'dddd',
}),
week: dayjs(+value).format('DD.MM'),
month: dayjs(+value).format('MMM'),
- year: dayjs(+value).format('YYYY')
+ year: dayjs(+value).format('YYYY'),
}
case 'number':
diff --git a/utils/id.js b/utils/id.js
index 0edbea61..7bf838cf 100644
--- a/utils/id.js
+++ b/utils/id.js
@@ -1,6 +1,6 @@
import dayjs from 'dayjs'
-export default function (date) {
+export default function(date) {
const string = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15)
return `${dayjs(date).format('YYMMDD')}_${string.slice(0, 6)}`
}