Skip to content

Open source personal finance application

update 3.3.7

ilkome82b072a0e8ce
diff --git a/assets/shame/toogleHeaderOnScroll.js b/assets/shame/toogleHeaderOnScroll.js
new file mode 100644
index 00000000..e0fdda63
--- /dev/null
+++ b/assets/shame/toogleHeaderOnScroll.js
@@ -0,0 +1,71 @@
+import debounce from '~/utils/debounce'
+
+export const initScroll = () => {
+ const doc = document.querySelector('.pageScrollerJsContent')
+ if (!doc) { return }
+
+ let curScroll
+ let prevScroll = doc.scrollY || doc.scrollTop
+ let curDirection = 0
+ let prevDirection = 0
+
+ /*
+ step 1: user scrolls down: curDirection 2, prevDirection 0 > hide header
+ step 2: user scrolls down again: curDirection 2, prevDirection 2 > already hidden, do nothing
+ step 3: user scrolls up: curDirection 1, prevDirection 2 > show header
+ */
+
+ const header = document.querySelector('.pageScrollerJsHeader')
+ const bottom = document.querySelector('.pageScrollerJsBottom')
+ const menu = document.querySelector('.pageScrollerJsMenu')
+ if (!menu || !header || !bottom) { return }
+
+ this.isScrollInited = true
+ // doc.style.paddingTop = `${header.clientHeight}px`
+ // doc.style.paddingBottom = `${bottom.clientHeight + menu.clientHeight}px`
+
+ let toggled
+ const threshold = 100
+
+ // scroll up - 1, scroll down - 2, initial - 0
+ const checkScroll = function () {
+ console.log(curScroll, prevScroll)
+ curScroll = doc.scrollY || doc.scrollTop
+ if (curScroll > prevScroll) {
+ // scrolled down
+ curDirection = 2
+ }
+ else {
+ // scrolled up
+ curDirection = 1
+ }
+
+ if (curDirection !== prevDirection) {
+ toggled = toggleHeader()
+ }
+
+ prevScroll = curScroll
+ if (toggled) {
+ prevDirection = curDirection
+ }
+ }
+
+ const toggleHeader = () => {
+ toggled = true
+ if (curDirection === 2 && curScroll > threshold) {
+ // header.classList.add('_hide')
+ // bottom.classList.add('_hide')
+ // menu.classList.add('_hide')
+ }
+ else if (curDirection === 1) {
+ // bottom.classList.remove('_hide')
+ // header.classList.remove('_hide')
+ // menu.classList.remove('_hide')
+ }
+ else {
+ toggled = false
+ }
+ return toggled
+ }
+ doc.addEventListener('scroll', debounce(checkScroll, 100))
+}
diff --git a/assets/stylus/common/animations.styl b/assets/stylus/common/animations.styl
index e201e29f..44c9a97d 100644
--- a/assets/stylus/common/animations.styl
+++ b/assets/stylus/common/animations.styl
@@ -50,7 +50,8 @@ $transition-style = cubic-bezier(.17, .04, .03, 1)
&-leave-active
&-leave-to
opacity 0
- transition none
+ transition opacity 200ms ease-out, transform 250ms ease-out
+ // transition none
.slide2
&-enter-active
diff --git a/assets/stylus/common/headers.styl b/assets/stylus/common/headers.styl
index 9fca790b..a939488e 100644
--- a/assets/stylus/common/headers.styl
+++ b/assets/stylus/common/headers.styl
@@ -1,2 +1,4 @@
-h1, h2, h3
+h1
+h2
+h3
typo-header()
diff --git a/assets/stylus/variables.styl b/assets/stylus/variables.styl
index dfff35c8..06ce6447 100644
--- a/assets/stylus/variables.styl
+++ b/assets/stylus/variables.styl
@@ -1 +1,7 @@
@import "variables/*"
+
+
+font-title-1()
+ font-size 16px
+ font-weight 500
+ font-roboto()
diff --git a/assets/stylus/variables/colors-dark.styl b/assets/stylus/variables/colors-dark.styl
index 8295dfe2..b4ea83c4 100644
--- a/assets/stylus/variables/colors-dark.styl
+++ b/assets/stylus/variables/colors-dark.styl
@@ -1,28 +1,32 @@
+html
+ --c-bg-15 rgba(27, 27, 27, .9)
+
html.dark-mode
// colors
// --------------------------------------------
- --c-red-1 rgba(184, 20, 20, 1)
+ --c-red-1 #b81414ff
--c-red-2 rgba(163, 41, 41, 1)
--c-red-3 rgba(69, 23, 25, 1)
- --c-blue-1 rgba(40, 60, 120, 1)
+ --c-blue-1 #3a7dff
--c-blue-2 rgba(40, 60, 120, .8)
--c-incomes-1 rgba(44, 173, 34, 1)
--c-expenses-1 rgba(249, 33, 52, 1)
+ // --c-expenses-1 rgb(244, 60, 117)
// backgrounds
// --------------------------------------------
- --c-bg-1 rgba(10, 10, 10, 1)
+ --c-bg-1 #0a0a0afc
--c-bg-2 rgba(17, 17, 17, 1)
--c-bg-3 rgba(23, 23, 23, 1)
- --c-bg-33 #161616
--c-bg-4 rgba(28, 28, 28, 1)
+ --c-bg-44 rgba(25, 25, 25, 1)
--c-bg-5 rgba(35, 35, 35, 1)
--c-bg-6 rgba(39, 39, 39, 1)
--c-bg-7 rgba(46, 46, 46, 1)
--c-bg-8 rgba(63, 63, 63, 1)
--c-bg-9 rgba(135, 135, 135, 1)
--c-bg-10 rgba(220, 220, 220, 1)
- --c-bg-overflow rgba(0, 0, 0, .8)
+ --c-bg-14 rgba(0, 0, 0, .8)
// fonts
// --------------------------------------------
diff --git a/assets/stylus/variables/colors-light.styl b/assets/stylus/variables/colors-light.styl
index 80d0e64b..d7f17c65 100644
--- a/assets/stylus/variables/colors-light.styl
+++ b/assets/stylus/variables/colors-light.styl
@@ -1,38 +1,39 @@
html
+ --c-incomes-opacity rgba(44, 173, 34, .5)
+ --c-expenses-opacity rgba(249, 33, 52, .5)
+
// colors
// --------------------------------------------
--c-red-1 rgba(184, 20, 20, 1)
--c-red-2 rgba(196, 75, 75, 1)
--c-red-3 rgba(255, 200, 200, 1)
- --c-blue-1 rgba(40, 60, 120, 1)
+ --c-blue-1 #3a7dff
--c-blue-2 rgba(40, 60, 120, .8)
--c-incomes-1 rgba(44, 173, 34, 1)
--c-expenses-1 rgba(249, 33, 52, 1)
// backgrounds
// --------------------------------------------
- --c-bg-1 rgba(229, 229, 229, 1)
- --c-bg-2 rgba(250, 250, 250, 1)
- --c-bg-33 rgba(244, 244, 244, 1)
- --c-bg-3 rgba(244, 244, 244, 1)
- --c-bg-4 rgba(240, 240, 240, 1)
+ --c-bg-1 rgba(240, 240, 240, 1)
+ --c-bg-2 rgba(235, 235, 235, 1)
+ --c-bg-3 #f5f5f5
+ --c-bg-4 #fafafa
--c-bg-5 rgba(220, 220, 220, 1)
--c-bg-6 rgba(210, 210, 210, 1)
--c-bg-7 rgba(215, 215, 215, 1)
- --c-bg-7-a rgba(250, 250, 250, 1)
+ --c-bg-14 rgba(250, 250, 250, 1)
--c-bg-8 rgba(190, 190, 190, 1)
--c-bg-9 rgba(190, 190, 190, 1)
--c-bg-10 rgba(230, 230, 230, 1)
--c-bg-11 rgba(0, 0, 0, .04)
--c-bg-12 rgba(100, 100, 100, 1)
--c-bg-13 rgba(120, 120, 120, 1)
- --c-bg-overflow rgba(0, 0, 0, .6)
+ --c-bg-14 rgba(0, 0, 0, .6)
// fonts
// --------------------------------------------
--c-font-1 rgba(250, 250, 250, 1)
--c-font-2 rgba(80, 80, 80, 1)
- --c-font-2-a rgba(250, 250, 250, 1)
--c-font-3 rgba(50, 50, 50, 1)
--c-font-4 rgba(110, 110, 110, 1)
--c-font-5 rgba(150, 150, 150, 1)
diff --git a/assets/stylus/variables/fonts.styl b/assets/stylus/variables/fonts.styl
index c7458857..536dc3ae 100644
--- a/assets/stylus/variables/fonts.styl
+++ b/assets/stylus/variables/fonts.styl
@@ -44,19 +44,9 @@ typo-small-upper($fs = 11px, $color = var(--c-font-4))
typo-header()
margin 0
color var(--c-font-2)
- font-size $font-size-nb
+ font-size 18px
font-weight 600
- letter-spacing 1px
- text-transform uppercase
- font-secondary()
-
-typo-header-normal()
- margin 0
- color var(--c-font-2)
- font-size 24px
- font-weight 500
- text-transform uppercase
- font-secondary()
+ fontFamilyNunito()
font-header-1()
color var(--c-font-2)
@@ -88,5 +78,4 @@ font-h1()
color var(--c-font-2)
font-size 24px
font-weight 600
- text-transform uppercase
- font-secondary()
+ fontFamilyNunito()
diff --git a/components/Metrica.vue b/components/Metrica.vue
index 44ca64f2..8429e866 100644
--- a/components/Metrica.vue
+++ b/components/Metrica.vue
@@ -23,16 +23,16 @@ export default {
<!-- /Yandex.Metrika counter -->
<!-- Hotjar Tracking Code for https://finapp.ilko.me -->
- <script>
- (function(h,o,t,j,a,r){
- h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
- h._hjSettings={hjid:1947029,hjsv:6};
- a=o.getElementsByTagName('head')[0];
- r=o.createElement('script');r.async=1;
- r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
- a.appendChild(r);
- })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
- </script>
</client-only>
+ <script>
+ (function(h,o,t,j,a,r){
+ h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
+ h._hjSettings={hjid:1947029,hjsv:6};
+ a=o.getElementsByTagName('head')[0];
+ r=o.createElement('script');r.async=1;
+ r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
+ a.appendChild(r);
+ })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
+ </script>
</div>
</template>
diff --git a/components/amount/Amount.vue b/components/amount/Amount.vue
index a8dba846..725ef681 100644
--- a/components/amount/Amount.vue
+++ b/components/amount/Amount.vue
@@ -91,13 +91,13 @@ export default {
<template lang="pug">
.amount(:class="className")
.amountItem._original(:class="className")
- .amountItem__prefix(v-if="isShowPrefix") {{ type === 0 ? '-' : '+' }}
+ .amountItem__prefix(v-if="isShowPrefix && value !== 0") {{ type === 0 ? '-' : '+' }}
.amountItem__value {{ formatAmount(value) }}
.amountItem__symbol {{ getCurrencySymbol(currency) }}
template(v-if="showBase && (value !== 0) && (currency !== $store.state.currencies.base)")
.amountItem._base(:class="className")
- .amountItem__prefix(v-if="isShowPrefix") {{ type === 0 ? '-' : '+' }}
+ .amountItem__prefix(v-if="isShowPrefix && value !== 0") {{ type === 0 ? '-' : '+' }}
.amountItem__value {{ amountInBaseCurrency }}
.amountItem__symbol {{ getCurrencySymbol($store.state.currencies.base) }}
</template>
@@ -167,20 +167,21 @@ export default {
&._base
opacity .6
- padding-top 5px
+ padding-top 0px
&__prefix
align-self center
padding-right $m2
+ font-weight 400
~/._size_xl &
padding-right $m4
font-size 26px
&__value
- font-size 15px
- font-weight 400
font-secondary()
+ font-size 14px
+ font-weight 400
~/._base &
font-size 12px
@@ -200,6 +201,7 @@ export default {
&__symbol
padding-bottom 0px
padding-left 2px
+ font-weight 400
~/._original &
padding-bottom 1px
diff --git a/components/analytics/AnalyticsChart.vue b/components/analytics/AnalyticsChart.vue
index 633fe532..6db62586 100644
--- a/components/analytics/AnalyticsChart.vue
+++ b/components/analytics/AnalyticsChart.vue
@@ -1,12 +1,7 @@
<script>
-import dayjs from 'dayjs'
import { Chart } from 'highcharts-vue'
-import Highcharts from 'highcharts'
-import borderRadius from 'highcharts-border-radius'
import chartOptions from '~/components/stat/chartOptions'
-borderRadius(Highcharts)
-
export default {
name: 'AnalyticsChart',
@@ -24,7 +19,7 @@ export default {
data () {
return {
average: 0,
- date: dayjs().valueOf(),
+ date: this.$day().valueOf(),
visiblePeriodMenu: false,
dateStart: null,
dateEnd: null,
@@ -126,8 +121,8 @@ export default {
const trns = this.$store.state.trns.items
// diff periods from oldest trn and today
- const oldestTrnDate = dayjs(trns[this.$store.getters['trns/firstCreatedTrnId']].date).endOf(periodName)
- let periodsToShow = dayjs().endOf(periodName).diff(oldestTrnDate, periodName) + 1
+ const oldestTrnDate = this.$day(trns[this.$store.getters['trns/firstCreatedTrnId']].date).endOf(periodName)
+ let periodsToShow = this.$day().endOf(periodName).diff(oldestTrnDate, periodName) + 1
periodsToShow = periodsToShow > this.showedPeriods ? this.showedPeriods : periodsToShow
const categories = []
@@ -142,8 +137,8 @@ export default {
for (let index = 0; index < periodsToShow; index++) {
// count total period
- const periodDate = dayjs().endOf(periodName).subtract(index, periodName).valueOf()
- const name = dayjs(periodDate).format(format)
+ const periodDate = this.$day().endOf(periodName).subtract(index, periodName).valueOf()
+ const name = this.$day(periodDate).format(format)
const trnsIds = this.$store.getters['trns/getTrns']({
categoryId: this.categoryId,
date: periodDate,
@@ -158,7 +153,7 @@ export default {
color: 'var(--c-font-1)',
marker: {
radius: 6,
- enabled: dayjs(periodDate).isSame(this.$store.state.filter.date, periodName)
+ enabled: this.$day(periodDate).isSame(this.$store.state.filter.date, periodName)
}
})
categories.unshift(name)
@@ -180,7 +175,7 @@ export default {
visible: true,
type: 'spline',
name: 'Data',
- color: '#c1c1c1',
+ color: 'var(--c-blue-1)',
data: incomesData
}],
categories
@@ -218,7 +213,7 @@ export default {
</template>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables"
+@import '~assets/stylus/variables'
.chart
z-index 3
diff --git a/components/analytics/AnalyticsChartTrns.vue b/components/analytics/AnalyticsChartTrns.vue
new file mode 100644
index 00000000..2eac7260
--- /dev/null
+++ b/components/analytics/AnalyticsChartTrns.vue
@@ -0,0 +1,299 @@
+<script>
+import { Chart } from 'highcharts-vue'
+import chartOptions from '~/components/stat/chartOptions'
+
+export default {
+ name: 'AnalyticsChartTrns',
+
+ components: {
+ Chart
+ },
+
+ props: {
+ periodName: {
+ type: String,
+ default: 'month'
+ },
+
+ isShowSummury: {
+ type: Boolean,
+ default: true
+ }
+ },
+
+ data () {
+ return {
+ biggest: 0,
+ average: 0,
+ date: this.$day().valueOf(),
+ visiblePeriodMenu: false,
+ dateStart: null,
+ dateEnd: null,
+ chartOptions: {
+ ...chartOptions,
+ legend: false,
+ tooltip: false
+ }
+ }
+ },
+
+ computed: {
+ activeTab () {
+ return this.$store.state.dashboard.activeTab === 'balance'
+ },
+
+ periods () {
+ return this.$store.state.chart.periods
+ },
+
+ statCurrentPeriod () {
+ return this.$store.getters['stat/statCurrentPeriod']
+ },
+
+ statAverage () {
+ return this.$store.getters['stat/statAverage']
+ },
+
+ filterDate () {
+ return this.$store.state.filter.date
+ },
+
+ filterCategory () {
+ return this.$store.state.filter.categoryId
+ },
+ filterWallet () {
+ return this.$store.state.filter.walletId
+ }
+ },
+
+ watch: {
+ showedPeriods () {
+ this.init()
+ },
+
+ filterDate () {
+ this.init()
+ },
+ filterCategory () {
+ this.init()
+ },
+ filterWallet () {
+ this.init()
+ },
+ periods () {
+ this.init()
+ }
+ },
+
+ mounted () {
+ this.init()
+ },
+
+ methods: {
+ init () {
+ const data = this.generateData(this.periodName)
+ const handlePerioSelect = (date) => {
+ this.$store.dispatch('filter/setPeriod', this.periodName)
+ this.$store.dispatch('filter/setDate', date)
+ }
+
+ this.chartOptions.series = data.series
+ this.chartOptions.plotOptions.series = {
+ cursor: 'pointer',
+ point: {
+ events: {
+ click () {
+ handlePerioSelect(this.date)
+ }
+ }
+ }
+ }
+
+ this.chartOptions = {
+ ...this.chartOptions,
+ tooltip: false,
+ xAxis: {
+ categories: data.categories
+ },
+
+ yAxis: {
+ plotLines: [{
+ color: 'var(--c-bg-8)',
+ value: this.average, // Insert your average here
+ width: '2',
+ zIndex: 1
+ }]
+ },
+
+ chart: {
+ backgroundColor: 'transparent',
+ with: '100%',
+ height: 160,
+ spacing: [5, 0, 0, 0],
+ type: 'column',
+ zoomType: 'x',
+ panning: true,
+ panKey: 'shift',
+
+ events: {
+ click (e) {
+ console.log('hy')
+ // console.log(this.series[0].searchPoint(e, true))
+ }
+ }
+ }
+ }
+ },
+
+ formatAmount (amount) {
+ const fixed = this.$store.state.currencies.base === 'RUB' ? 0 : 2
+ return Number(`${amount.toFixed(fixed)}`).toLocaleString('ru-RU')
+ },
+
+ 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' }
+
+ for (let index = 0; index < this.$store.state.chart.periods[periodName].showedPeriods; index++) {
+ // count total period
+ const periodDate = this.$day().endOf(periodName).subtract(index, periodName).valueOf()
+ const name = this.$day(periodDate).startOf(periodName).format(format)
+ const trnsIds = this.$store.getters['trns/getTrns']({
+ date: periodDate,
+ periodName
+ })
+ const periodTotal = this.$store.getters['trns/getTotalOfTrnsIds'](trnsIds)
+
+ let amount = Math.floor(Number(`${periodTotal.incomes.toFixed() - periodTotal.expenses.toFixed()}`))
+ if (!this.statAverage.total) {
+ amount = Math.abs(Number(`${periodTotal.incomes.toFixed() - periodTotal.expenses.toFixed()}`))
+ }
+
+ // return
+ incomesData.unshift({
+ date: periodDate,
+ y: amount,
+ color: 'var(--c-font-1)',
+ // marker: {
+ // radius: 6,
+ // color: this.$day(periodDate).isSame(this.$store.state.filter.date, periodName)
+ // }
+ })
+ categories.unshift(name)
+ }
+
+ let biggest = 0
+
+ let periods = 0
+ let periodsTotal = 0
+ for (const iterator of incomesData) {
+ if (iterator.y !== 0) {
+ periods = periods + 1
+ periodsTotal = periodsTotal + iterator.y
+ if (iterator.y > biggest) {
+ biggest = iterator.y
+ }
+ }
+ }
+
+ this.biggest = biggest
+
+ let amountAverage = Math.floor(Number(periodsTotal / periods).toFixed())
+ 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) {
+ color = 'var(--c-incomes-1)'
+ }
+ else if (this.statAverage.expenses > 0) {
+ color = 'var(--c-expenses-1)'
+ }
+ }
+
+ return {
+ series: [{
+ visible: true,
+ type: 'spline',
+ name: 'Data',
+ color,
+ data: incomesData,
+ marker: {
+ fillColor: 'var(--c-bg-4)',
+ lineWidth: 2,
+ lineColor: 'var(--c-blue-1)',
+ symbol: 'circle'
+ }
+ }],
+ categories
+ }
+ }
+ }
+}
+</script>
+
+<template lang="pug">
+.chart(ref="chart" :class="{ _height: isShowSummury }")
+ .columns(v-if="isShowSummury")
+ .item
+ .item__name {{ $t('stat.selectedPeriod') }}
+ .item__price
+ Amount(
+ v-if="chartOptions.series[0] && chartOptions.series[0].data.length"
+ :currency="$store.state.currencies.base"
+ :type="3"
+ :value="chartOptions.series[0].data[chartOptions.series[0].data.length - 1].y"
+ size="xl"
+ vertical="center"
+ )
+
+ .item
+ .item__name {{ $t('money.average') }}
+ .item__price
+ Amount(
+ :currency="$store.state.currencies.base"
+ :value="average || 0"
+ size="xl"
+ vertical="center"
+ )
+
+ Chart.swiper-no-swiping(:options="chartOptions")
+</template>
+
+<style lang="stylus" scoped>
+@import '~assets/stylus/variables'
+
+.chart
+ z-index 3
+ position relative
+ height 166px
+ padding $m5 0 0 0
+
+ &._height
+ height 236px
+
+.item
+ color var(--c-font-4)
+ font-size 12px
+ text-align center
+
+ &__name
+ padding-bottom $m5
+
+.columns
+ display grid
+ grid-template-columns repeat(2, 1fr)
+ grid-column-gap $m7
+ grid-row-gap $m7
+ padding-bottom $m7
+</style>
diff --git a/components/budgets/BudgetFormTrn.vue b/components/budgets/BudgetFormTrn.vue
index 6829707b..d33e790f 100644
--- a/components/budgets/BudgetFormTrn.vue
+++ b/components/budgets/BudgetFormTrn.vue
@@ -82,8 +82,7 @@ export default {
padding 11px 20px 10px 20px
background var(--c-bg-5)
border-color transparent
- /.light-mode &
- background var(--c-bg-5)
+
&:last-child
border-color transparent
diff --git a/components/budgets/BudgetItemTrn.vue b/components/budgets/BudgetItemTrn.vue
index c1484b7c..1dab52e9 100644
--- a/components/budgets/BudgetItemTrn.vue
+++ b/components/budgets/BudgetItemTrn.vue
@@ -76,8 +76,7 @@ export default {
padding 11px 20px 10px 20px
background var(--c-bg-5)
border-color transparent
- /.light-mode &
- background var(--c-bg-5)
+
&:last-child
border-color transparent
diff --git a/components/categories/CategoryStatModal.vue b/components/categories/CategoryStatModal.vue
deleted file mode 100644
index cda61a5d..00000000
--- a/components/categories/CategoryStatModal.vue
+++ /dev/null
@@ -1,73 +0,0 @@
-<script>
-export default {
- name: 'CategoryStatModal',
-
- data () {
- return {
- show: true
- }
- },
-
- computed: {
- categoryId () {
- return this.$store.state.stat.categoryModal.id
- },
-
- category () {
- return this.$store.state.categories.items[this.categoryId]
- },
-
- showChildCategories () {
- const childCategoriesIds = this.$store.getters['categories/getChildCategoriesIds'](this.categoryId)
-
- const childCatsIdsWithTrns = []
- for (const childCategoryId of childCategoriesIds) {
- const trnsIds = this.$store.getters['trns/getTrnsIdsByFilter']({
- categoryId: childCategoryId,
- type: this.type
- })
- if (trnsIds.length > 0) { childCatsIdsWithTrns.push(childCategoryId) }
- }
-
- if (childCatsIdsWithTrns.length > 0) { return true }
- return false
- }
- }
-}
-</script>
-
-<template lang="pug">
-Portal(
- v-if="$store.state.stat.categoryModal.show"
- to="modal"
-)
- ModalBottom(
- @onClose="$store.commit('stat/setCategoryModalShow', false)"
- @afterClose="$store.commit('stat/setCategoryModalId', null)"
- )
- template(#header)
- .modalBottom__header__title {{ category.name }}
- .modalBottom__icon
- Icon(
- :icon="category.icon"
- :background="category.color || $store.state.ui.defaultBgColor"
- :round="true"
- :big="true"
- )
-
- template(v-if="showChildCategories")
- StatItemChildCats(:categoryId="categoryId", :type="0")
- StatItemChildCats(:categoryId="categoryId", :type="1")
-
- template(v-else)
- TrnsList(
- ui="stat"
- :incomes="true"
- :expenses="false"
- :categoryId="categoryId"
- )
-</template>
-
-<style lang="stylus" scoped>
-// styles here...
-</style>
diff --git a/components/categories/form/CategoryForm.vue b/components/categories/form/CategoryForm.vue
index 2975a881..b640a0e0 100644
--- a/components/categories/form/CategoryForm.vue
+++ b/components/categories/form/CategoryForm.vue
@@ -323,7 +323,7 @@ ComponentWrap
margin (- $m7)
margin-top 0
padding $m7
- background var(--c-bg-1)
+ background var(--c-bg-3)
@media $media-laptop
margin (- $m9)
diff --git a/components/categories/item/CategoryItem.vue b/components/categories/item/CategoryItem.vue
index b2cde3b2..cdeec654 100644
--- a/components/categories/item/CategoryItem.vue
+++ b/components/categories/item/CategoryItem.vue
@@ -78,6 +78,7 @@ export default {
padding $m6
color var(--c-font-1)
background var(--c-bg-3)
+ border 1px solid var(--c-bg-5)
border-radius $m5
&._flat
@@ -125,8 +126,7 @@ export default {
text-align center
/.light-mode &
- color var(--c-font-2)
-
+ color var(--c-font-4)
&__dots
position absolute
diff --git a/components/categories/modal/CategoryModal.vue b/components/categories/modal/CategoryModal.vue
index 008c347d..7dfc1576 100644
--- a/components/categories/modal/CategoryModal.vue
+++ b/components/categories/modal/CategoryModal.vue
@@ -2,13 +2,6 @@
import { db } from '~/services/firebaseConfig'
export default {
- props: {
- slider: {
- type: Object,
- default: () => {}
- }
- },
-
data () {
return {
showModalConfirm: false
@@ -22,15 +15,18 @@ export default {
category () {
return this.$store.state.categories.items[this.categoryId]
},
+
deleteInfo () {
if (this.trnsIds.length > 0) {
return `It's also will delete ${this.trnsIds.length} trns in this category`
}
return null
},
+
childCategoriesIds () {
return this.$store.getters['categories/getChildCategoriesIds'](this.categoryId)
},
+
trnsIds () {
const trns = this.$store.state.trns.items
const trnsIds = []
@@ -50,8 +46,8 @@ export default {
this.$store.commit('categories/hideCategoryModal')
this.$store.commit('categories/setCategoryModalId', null)
- if (this.slider) {
- this.slider.slideTo(1)
+ if (this.$store.state.ui.mobile) {
+ this.$store.dispatch('ui/setActiveTabViewName', 'chart')
}
},
diff --git a/components/dashboard/DashboardNav.vue b/components/dashboard/DashboardNav.vue
index 3546da92..9fc41225 100644
--- a/components/dashboard/DashboardNav.vue
+++ b/components/dashboard/DashboardNav.vue
@@ -68,7 +68,7 @@ export default {
)
ContextMenuItem(
:selected="$store.state.filter.period === 'all'"
- :title="$t('dates.all')"
+ :title="$t('dates.all.simple')"
icon="mdi mdi-database"
@onClick="$store.dispatch('filter/setPeriod', 'all')"
@onClose="visiblePeriodMenu = !visiblePeriodMenu"
diff --git a/components/dashboard/DashboardStatControl.vue b/components/dashboard/DashboardStatControl.vue
index baf7794d..af682dc4 100644
--- a/components/dashboard/DashboardStatControl.vue
+++ b/components/dashboard/DashboardStatControl.vue
@@ -41,13 +41,12 @@ export default {
</template>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables/animations"
+@import '~assets/stylus/variables'
$background = var(--c-bg-3)
$border = var(--c-bg-1)
$text = var(--c-font-4)
$text-active = var(--c-font-1)
-$text-active_light = var(--c-font-2)
$text-disable = var(--c-font-5)
.component
@@ -68,9 +67,9 @@ $text-disable = var(--c-font-5)
cursor pointer
display flex
align-items center
+ margin-right 30px
color $text
font-size 16px
- margin-right 30px
anim()
&:last-child
@@ -79,8 +78,6 @@ $text-disable = var(--c-font-5)
&._active
&:hover
color $text-active
- /.light-mode &
- color $text-active_light
&._disable
color $text-disable
diff --git a/components/filter/FilterItem.vue b/components/filter/FilterItem.vue
index b56e487d..c1a42288 100644
--- a/components/filter/FilterItem.vue
+++ b/components/filter/FilterItem.vue
@@ -8,12 +8,17 @@ export default {
icon: {
type: String,
- required: true
+ default: null
},
name: {
type: String,
default: null
+ },
+
+ walletId: {
+ type: String,
+ default: null
}
},
@@ -23,6 +28,10 @@ export default {
_mobile: this.$store.state.ui.mobile,
_pc: this.$store.state.ui.pc
}
+ },
+
+ wallet () {
+ return this.$store.state.wallets.items[this.walletId]
}
}
}
@@ -31,43 +40,89 @@ export default {
<template lang="pug">
.filterItem(
:class="className"
- :style="{ background: color }"
@click="$emit('onClick')"
)
- .filterItem__icon
- Icon(
- :icon="icon"
- :medium="true"
- :background="color")
- .filterItem__name {{ name }}
- .filterItem__close: .mdi.mdi-close
+ //- Wallet
+ template(v-if="walletId && wallet")
+ .filterItemWallet__line(:style="{ background: wallet.color || $store.state.ui.defaultBgColor }")
+ .filterItemWallet
+ .filterItemWallet__amount
+ Amount(
+ :alwaysShowSymbol="false"
+ :currency="wallet.currency"
+ :showBase="false"
+ :value="$store.getters['wallets/walletsTotal'][walletId].base"
+ vertical="center"
+ )
+ .filterItem__name {{ wallet.name }}
+
+ //- Category
+ template(v-if="!walletId")
+ .filterItem__icon
+ Icon(
+ :color="color"
+ :icon="icon"
+ )
+ .filterItem__name {{ name }}
</template>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables/animations"
-@import "~assets/stylus/variables/margins"
-@import "~assets/stylus/variables/media"
+@import '~assets/stylus/variables/animations'
+@import '~assets/stylus/variables/margins'
+@import '~assets/stylus/variables/media'
+
+.filterItemWallet
+ display flex
+ display flex
+ flex-flow column
+ justify-content center
+ padding-bottom $m3
+
+ &__amount
+ padding-top $m3
+ padding-bottom $m3
+
+ &__line
+ position absolute
+ top 0
+ left 0
+ width 100%
+ height 2px
.filterItem
+ overflow hidden
cursor pointer
position relative
display flex
- flex-flow row
- align-items center
- padding 6px 12px
+ flex-flow column
+ justify-content center
+ flex-grow 0
+ margin 0 $m4
+ padding $m5 $m7
color var(--c-font-1)
white-space nowrap
- border-radius $m4
+ background var(--c-bg-6)
+ border-radius $m5
+
+ +media-tablet()
+ background var(--c-bg-5)
&._pc
- margin-right 20px
+ margin-right $m6
- &._mobile
- flex 1 1 50%
- margin-right 10px
+ &:active
+ background var(--c-bg-5)
&:last-child
- margin-right 0
+ +media-tablet('less')
+ margin-right auto
+
+ &:first-child
+ +media-tablet('less')
+ margin-left auto
+
+ &:last-child&:after
+ display none
&._clear
margin-right 0
@@ -81,7 +136,7 @@ export default {
&__icon
opacity .8
- padding-right $m6
+ padding-bottom $m4
color var(--c-font-1)
.icon
@@ -97,9 +152,13 @@ export default {
&__name
overflow hidden
text-overflow ellipsis
- font-size 14px
+ color var(--c-font-4)
+ font-size 13px
text-align center
+ ~/:hover &
+ color var(--c-font-2)
+
&__close
margin-left auto
padding-left 10px
@@ -116,10 +175,6 @@ export default {
border-radius $m3
anim()
- /.light-mode &
- color var(--c-font-2)
- background var(--c-bg-10)
-
^[0]:hover:not(._clear) &
@media $media-laptop
opacity 1
diff --git a/components/filter/FilterRow.vue b/components/filter/FilterRow.vue
new file mode 100644
index 00000000..f3ea83e8
--- /dev/null
+++ b/components/filter/FilterRow.vue
@@ -0,0 +1,77 @@
+<script>
+export default {
+ name: 'FilterRow',
+
+ computed: {
+ filterCategory () {
+ return this.$store.state.categories.items[this.$store.state.filter.categoryId]
+ },
+
+ filterCategoryParent () {
+ return this.$store.state.categories.items[this.filterCategory.parentId]
+ },
+
+ filterWallet () {
+ return this.$store.state.wallets.items[this.$store.state.filter.walletId]
+ }
+ },
+
+ methods: {
+ clearCategoryFilter () {
+ const nextCategory = this.filterCategory.parentId !== 0 ? this.filterCategory.parentId : null
+ this.$store.dispatch('filter/setFilterCategoryId', nextCategory)
+ },
+
+ clearParentCategoryFilter () {
+ this.$store.dispatch('filter/setFilterCategoryId', null)
+ },
+
+ clearWalletFilter () {
+ this.$store.dispatch('filter/setFilterWalletId', null)
+ }
+ }
+}
+</script>
+
+<template lang="pug">
+.filterRow.swiper-no-swiping(v-if="$store.state.filter.categoryId || $store.state.filter.walletId")
+ //- Wallet
+ template(v-if="$store.state.filter.walletId")
+ FilterItem(
+ :walletId="$store.state.filter.walletId"
+ @onClick="clearWalletFilter"
+ )
+
+ //- Category
+ template(v-if="$store.state.filter.categoryId")
+ //- Parent
+ template(v-if="filterCategory.parentId !== 0")
+ FilterItem(
+ :color="filterCategoryParent.color || $store.state.ui.defaultBgColor"
+ :icon="filterCategoryParent.icon"
+ :name="filterCategoryParent.name"
+ @onClick="clearParentCategoryFilter"
+ )
+ //- Child
+ FilterItem(
+ :color="filterCategory.color || $store.state.ui.defaultBgColor"
+ :icon="filterCategory.icon"
+ :name="filterCategory.name"
+ @onClick="clearCategoryFilter"
+ )
+</template>
+
+<style lang="stylus" scoped>
+@import '~assets/stylus/variables'
+
+.filterRow
+ overflow hidden
+ overflow-x scroll
+ display flex
+ align-items center
+ width 100%
+ scrollbar()
+
+ +media-tablet('less')
+ justify-content safe center
+</style>
diff --git a/components/icon/Icon.vue b/components/icon/Icon.vue
index f54ff5a1..19e10670 100644
--- a/components/icon/Icon.vue
+++ b/components/icon/Icon.vue
@@ -85,7 +85,7 @@ export default {
width 32px
height 32px
color var(--c-font-1)
- border-radius 3px
+ border-radius $m5
&._invert
color var(--c-font-5)
background var(--c-bg-10)
@@ -122,7 +122,8 @@ export default {
&__abbr
font-size 12px
- font-weight 500
+ font-weight 400
+
^[0]._small &
- font-size 11px
+ font-size 10px
</style>
diff --git a/components/layout/LayoutMobile.vue b/components/layout/LayoutMobile.vue
index c21c61ca..80504bb5 100644
--- a/components/layout/LayoutMobile.vue
+++ b/components/layout/LayoutMobile.vue
@@ -1,183 +1,536 @@
<script>
-import Swiper from 'swiper'
-import 'swiper/swiper-bundle.min.css'
-
export default {
- name: 'LayoutMobile',
+ name: 'LayoutMobileWrap',
data () {
return {
- slider: null,
+ isShowModalMenu: false,
+ isScrollInited: false,
+ key: 0,
+ headerBlockHeight: 0,
+ period: 'daily',
+ isShowPeriodsNames: false,
- periods: [{
+ periodsNames: [{
slug: 'day',
+ icon: 'mdi mdi-weather-sunset-up',
name: this.$t('dates.day.simple')
}, {
slug: 'week',
+ icon: 'mdi mdi-calendar-week',
name: this.$t('dates.week.simple')
}, {
slug: 'month',
+ icon: 'mdi mdi-calendar',
name: this.$t('dates.month.simple')
}, {
slug: 'year',
+ icon: 'mdi mdi-calendar-star',
name: this.$t('dates.year.simple')
}]
}
},
computed: {
+ activeTabViewName () {
+ return this.$store.state.ui.activeTabViewName
+ },
+
activeTab () {
return this.$store.state.ui.activeTab
},
+ activeTabStat () {
+ return this.$store.state.ui.stat.activeTab
+ },
+
statCurrentPeriod () {
return this.$store.getters['stat/statCurrentPeriod']
},
- periodName () {
+ statAverage () {
+ return this.$store.getters['stat/statAverage']
+ },
+
+ filterPeriod () {
return this.$store.state.filter.period
+ },
+
+ isShowFilter () {
+ return !!this.$store.state.filter.categoryId || !!this.$store.state.filter.walletId
+ },
+
+ periods () {
+ return this.$store.state.chart.periods
+ },
+
+ periodsSummariesItems () {
+ if (this.filterPeriod === 'all') { return }
+ const values = {}
+ for (let period = 0; period < this.$store.state.chart.periods[this.filterPeriod].showedPeriods; period++) {
+ const periodStartDate = this.$day().subtract(period, this.filterPeriod).startOf('day')
+ const trnsIds = this.$store.getters['trns/getTrns']({
+ date: periodStartDate,
+ periodName: this.filterPeriod
+ })
+
+ values[periodStartDate.valueOf()] = {
+ date: periodStartDate.valueOf(),
+ ...this.$store.getters['trns/getTotalOfTrnsIds'](trnsIds)
+ }
+ }
+
+ return values
+ },
+
+ periodsSummariesTotal () {
+ if (this.filterPeriod === 'all') { return }
+ const total = {
+ incomes: 0,
+ expenses: 0,
+ total: 0
+ }
+
+ for (const id in this.periodsSummariesItems) {
+ total.incomes += this.periodsSummariesItems[id].incomes
+ total.expenses += this.periodsSummariesItems[id].expenses
+ total.total += this.periodsSummariesItems[id].total
+ }
+
+ return total
}
},
mounted () {
- this.slider = this.slider = new Swiper(this.$refs.slider, {
- slidesPerView: 'auto',
- initialSlide: 1,
- resistanceRatio: 0,
- touchReleaseOnEdges: true,
- shortSwipes: false,
- longSwipesRatio: 0.1,
- longSwipesMs: 60
- })
+ const headerBlock = document.querySelector('.pageScrollerJsHeader')
+ if (headerBlock) {
+ this.headerBlockHeight = `${headerBlock.clientHeight}px`
+ }
},
methods: {
- clickHandler () {
- const index = this.slider.activeIndex
- index === 0 && this.slider.slideNext()
+ onClickTopMenu (tabViewName) {
+ this.$store.dispatch('ui/setActiveTabViewName', tabViewName)
+ if (tabViewName === 'incomes' || tabViewName === 'expenses') {
+ this.$store.dispatch('ui/setActiveTabStat', tabViewName)
+ }
+ },
+
+ dayjs (value) {
+ let format = 'MMM'
+ if (this.filterPeriod === 'day') { format = 'DD.MM' }
+ if (this.filterPeriod === 'week') { format = 'DD.MM' }
+ if (this.filterPeriod === 'month') { format = 'MMMM' }
+ if (this.filterPeriod === 'year') { format = 'YYYY' }
+
+ return this.$day(value).format(format)
+ },
+
+ addPeriodToStat (periodName) {
+ this.key = this.key + 1
+ this.$store.commit('chart/addElementsToChart', { periodName, periodType: 'showedPeriods' })
+ this.saveChartsPeriodsToLocalStorage()
},
- handleShowWalletModal (id) {
- this.$store.commit('wallets/showWalletModal')
- this.$store.commit('wallets/setWalletModalId', id)
+ removePeriodOfStat (periodName) {
+ this.$store.commit('chart/removeElementsFromChart', { periodName, periodType: 'showedPeriods' })
+ this.saveChartsPeriodsToLocalStorage()
+ },
+
+ saveChartsPeriodsToLocalStorage () {
+ this.$store.dispatch('ui/saveUiView')
+ },
+
+ addPeriodOrGroup () {
+ if (this.periods[this.filterPeriod].grouped) {
+ this.$store.commit('chart/toogleChartPeriodView', { periodName: this.filterPeriod })
+ }
+
+ this.periods[this.filterPeriod].grouped
+ ? this.$store.commit('chart/addElementsToChart', { periodName: this.filterPeriod, periodType: 'showedGroups' })
+ : this.$store.commit('chart/addElementsToChart', { periodName: this.filterPeriod, periodType: 'showedPeriods' })
+ this.saveChartsPeriodsToLocalStorage()
+ },
+
+ removePeriodOrGroup () {
+ if (this.periods[this.filterPeriod].grouped) {
+ this.$store.commit('chart/toogleChartPeriodView', { periodName: this.filterPeriod })
+ }
+
+ this.periods[this.filterPeriod].grouped
+ ? this.$store.commit('chart/removeElementsFromChart', { periodName: this.filterPeriod, periodType: 'showedGroups' })
+ : this.$store.commit('chart/removeElementsFromChart', { periodName: this.filterPeriod, periodType: 'showedPeriods' })
+ this.saveChartsPeriodsToLocalStorage()
},
- changePeriod (period) {
- this.$store.dispatch('filter/setPeriod', period)
+ weekActiveStatus (date) {
+ const filterDate = this.$store.state.filter.date
+ const filterPeriod = this.$store.state.filter.period
+
+ return this.$day(parseInt(date)).isSame(filterDate, filterPeriod)
}
}
}
</script>
<template lang="pug">
-.wrap
- .layoutMobile
- .layoutMobile__content
- .swiper-container(ref="slider")
- .swiper-wrapper
- //- Wallets
- .swiper-slide
- ComponentWrap(:contentPadding="false")
- template(slot="content")
- WalletsTotal
- WalletsList3(
- :limit="6"
- showToogle
- @onClick="(id) => handleShowWalletModal(id)"
+.layoutMobile
+ .layoutMobile__content(ref="scroll")
+ //- Categories
+ //---------------------------------------------------------------------------
+ template(v-if="activeTabViewName === 'categories'")
+ ComponentWrap(:contentPadding="false")
+ template(slot="headerLeft") {{ $t('categories.name') }}
+
+ template(slot="content")
+ CategoriesList(
+ :style="{ paddingTop: '16px' }"
+ @onClick="(id) => $store.dispatch('categories/showCategoryModal', id)"
+ )
+
+ template(slot="bottom")
+ .flex
+ .col
+ Button(
+ :title="$t('categories.new')"
+ className="_inline _small"
+ @onClick="$store.dispatch('ui/setActiveTab', 'createCategory')"
+ )
+
+ //- Wallets
+ //---------------------------------------------------------------------------
+ template(v-if="activeTabViewName === 'wallets'")
+ WalletsPageMobile
+
+ //- Categories
+ //---------------------------------------------------------------------------
+ template(v-if="activeTabViewName === 'wallets'")
+ ComponentWrap(:contentPadding="false")
+ template(slot="headerLeft") {{ $t('categories.name') }}
+
+ template(slot="content")
+ CategoriesList(
+ :style="{ paddingTop: '16px' }"
+ @onClick="(id) => $store.dispatch('categories/showCategoryModal', id)"
+ )
+
+ template(slot="bottom")
+ .flex
+ .col
+ Button(
+ :title="$t('categories.new')"
+ className="_inline _small"
+ @onClick="$store.dispatch('ui/setActiveTab', 'createCategory')"
+ )
+
+ //- Stat
+ //---------------------------------------------------------------------------
+ .page(v-show="activeTabViewName === 'chart' || activeTabViewName === 'incomes' || activeTabViewName === 'expenses' || activeTabViewName === 'history'")
+ .page__content
+
+ //- Daily & History
+ //-----------------------------------------------------------------------
+ .page__block.pageScrollerJsHeader
+ .box._nobd.boxSwitcher
+ .switcher2._bg
+ .switcher2__item(
+ :class="{ _active: activeTabViewName === 'chart' }"
+ @click="onClickTopMenu('chart')"
+ ) {{ $t('stat.periods') }}
+ .switcher2__item(
+ v-if="statAverage.incomes !== 0 || statCurrentPeriod.incomes.total !== 0"
+ :class="{ _active: activeTabViewName === 'incomes' }"
+ @click="onClickTopMenu('incomes')"
+ ) {{ $t('money.incomes') }}
+ .switcher2__item(
+ v-if="statAverage.expenses !== 0 || statCurrentPeriod.expenses.total !== 0"
+ :class="{ _active: activeTabViewName === 'expenses' }"
+ @click="onClickTopMenu('expenses')"
+ ) {{ $t('money.expenses') }}
+ .switcher2__item(
+ :class="{ _active: activeTabViewName === 'history' }"
+ @click="onClickTopMenu('history')"
+ ) {{ $t('trns.history') }}
+
+ //- Chart Nav
+ //-----------------------------
+ .box._periods
+ .periods
+ .periodItem(
+ v-if="filterPeriod !== 'all'"
+ @click="removePeriodOrGroup"
+ ): .mdi.mdi-minus
+
+ .periodItem(
+ v-for="periodItem in periodsNames"
+ :key="periodItem.slug"
+ :class="{ _active: $store.state.filter.period === periodItem.slug }"
+ @click="$store.dispatch('filter/setPeriod', periodItem.slug)"
+ )
+ .periodItem__name {{ periodItem.name }}
+ .periodItem__count(
+ v-if="filterPeriod !== 'all'"
+ ) {{ $store.state.chart.periods[periodItem.slug].showedPeriods }}
+
+ .periodItem(
+ v-if="filterPeriod !== 'all'"
+ @click="addPeriodOrGroup"
+ ): .mdi.mdi-plus
+
+ //- Chart Content
+ //-----------------------------
+ .box._h272(
+ v-if="filterPeriod !== 'all'"
+ v-show="activeTabViewName !== 'history' && activeTabViewName !== 'chart'"
+ )
+ StatChartDonut2(
+ v-if="filterPeriod !== 'all'"
+ :isShowIncomes="activeTabViewName === 'incomes' || activeTabViewName === 'chart'"
+ :isShowExpenses="activeTabViewName === 'expenses' || activeTabViewName === 'chart'"
+ :key="activeTabViewName + period + filterPeriod + $store.state.chart.periods[filterPeriod].showedPeriods + this.$store.state.filter.categoryId + this.$store.state.filter.walletId"
+ )
+ ChartMenu2
+
+ //- History
+ //-----------------------------
+ template(v-if="activeTabViewName === 'history'")
+ .box
+ TrnsList3
+
+ //- Incomes / Expenses
+ //-----------------------------
+ template(v-if="activeTabViewName === 'chart'")
+ .page__grid
+ .box._h272(
+ v-if="filterPeriod !== 'all'"
+ v-show="activeTabViewName !== 'history'"
+ )
+ ChartMenu2
+ StatChartDonut2(
+ v-if="filterPeriod !== 'all'"
+ :isShowIncomes="activeTabViewName === 'incomes' || activeTabViewName === 'chart'"
+ :isShowExpenses="activeTabViewName === 'expenses' || activeTabViewName === 'chart'"
+ :key="activeTabViewName + period + filterPeriod + $store.state.chart.periods[filterPeriod].showedPeriods + this.$store.state.filter.categoryId + this.$store.state.filter.walletId"
+ )
+
+ .boxFlew2
+ .boxFlew2Item
+ PeriodCatsChart2(type="incomes")
+ .boxFlew2Item
+ PeriodCatsChart2(type="expenses")
+
+ .box._line(
+ v-if="statCurrentPeriod.expenses.categoriesIds.length > 1 && !this.$store.state.filter.categoryId"
+ )
+
+ //- Period Selector
+ //---------------------------
+ .box__nav._noMargin
+ .menuDots(@click="isShowPeriodsNames = true")
+ .menuDots__name: Date(:type="2")
+ .menuDots__dots: .mdi.mdi-dots-vertical
+
+ //- Filter
+ //---------------------------
+ .page__filter(v-if="isShowFilter")
+ FilterRow
+
+ //- Incomes
+ //---------------------------
+ template(v-if="statAverage.incomes !== 0 || statCurrentPeriod.incomes.total !== 0")
+ .boxTitle {{ $t('money.incomes') }}
+
+ .boxSummary2
+ .boxSummary2__item
+ Amount(
+ :currency="$store.state.currencies.base"
+ :type="1"
+ :value="statCurrentPeriod.incomes.total"
+ size="xl"
+ vertical="left"
+ )
+ SummaryRowItemView(
+ :type="1"
+ :amount="statAverage.incomes"
+ :title="$t('money.averageIncomes')"
+ )
+
+ .boxEmpty(v-if="statCurrentPeriod.incomes.categoriesIds.length === 0") {{ $t('stat.empty') }}
+
+ //- Cats incomes
+ //---------------------------
+ .box._stat(v-if="$store.state.ui.catsChart === 'visible' && statCurrentPeriod.incomes.categoriesIds.length > 0")
+ .box__content
+ PeriodCatsChart(type="incomes")
+
+ //- Stat incomes
+ //---------------------------
+ .box._stat(v-if="$store.state.ui.statItems === 'visible' && statCurrentPeriod.incomes.categoriesIds.length > 0")
+ .box__content
+ StatItemMobile(
+ v-for="categoryId in statCurrentPeriod.incomes.categoriesIds"
+ :biggest="statCurrentPeriod.incomes.biggest"
+ :category="$store.state.categories.items[categoryId]"
+ :categoryId="categoryId"
+ :currency="$store.state.currencies.base"
+ :key="categoryId"
+ :total="statCurrentPeriod.categories[categoryId].incomes"
+ :type="1"
+ )
+
+ //- Expenses
+ //---------------------------
+ template(v-if="statAverage.expenses !== 0 || statCurrentPeriod.expenses.total !== 0")
+ .boxTitle {{ $t('money.expenses') }}
+
+ .boxSummary2
+ .boxSummary2__item
+ Amount(
+ :currency="$store.state.currencies.base"
+ :type="0"
+ :value="statCurrentPeriod.expenses.total"
+ size="xl"
+ vertical="left"
+ )
+ SummaryRowItemView(
+ :type="0"
+ :amount="statAverage.expenses"
+ :title="$t('money.averageExpenses')"
+ )
+
+ .boxEmpty(v-if="statCurrentPeriod.expenses.categoriesIds.length === 0") {{ $t('stat.empty') }}
+
+ //---------------------------
+ .box._stat(v-if="$store.state.ui.catsChart === 'visible' && statCurrentPeriod.expenses.categoriesIds.length > 0")
+ .box__content
+ PeriodCatsChart(type="expenses")
+
+ //---------------------------
+ .box._stat(v-if="$store.state.ui.statItems === 'visible' && statCurrentPeriod.expenses.categoriesIds.length > 0")
+ .box__content
+ StatItemMobile(
+ v-for="categoryId in statCurrentPeriod.expenses.categoriesIds"
+ :biggest="statCurrentPeriod.expenses.biggest"
+ :category="$store.state.categories.items[categoryId]"
+ :categoryId="categoryId"
+ :currency="$store.state.currencies.base"
+ :key="categoryId"
+ :total="statCurrentPeriod.categories[categoryId].expenses"
+ :type="0"
+ )
+
+ template(v-if="$store.getters['trns/selectedTrnsIdsWithDate'].length > 0")
+ .boxTitle {{ $t('trns.history') }}
+ .box(style="paddingTop: 0")
+ TrnsList3(:size="10")
+
+ //- Customize
+ //---------------------------
+ .box._periods
+ .periods
+ .periodItem(
+ @click="$store.dispatch('ui/toogleVisibleCatsChart')"
+ :class="{ _active: $store.state.ui.catsChart === 'visible' }"
+ ) {{ $t('stat.customize.showCategorisChart') }}
+ .periodItem(
+ :class="{ _active: $store.state.ui.statItems === 'visible' }"
+ @click="$store.dispatch('ui/toogleVisibilityStatItems')"
+ ) {{ $t('stat.customize.showCategorisList') }}
+
+ //- Stat
+ //-----------------------------------------------------------------------
+ template(v-if="activeTabViewName === 'incomes' || activeTabViewName === 'expenses'")
+ .page__wrap
+ //- Color Line Chart
+ //---------------------------
+ .box._line(
+ v-if="statCurrentPeriod[activeTabStat].categoriesIds.length > 1 && !this.$store.state.filter.categoryId"
+ )
+ PeriodCatsChart2(:type="activeTabStat")
+
+ //- Period Selector
+ //---------------------------
+ .box__nav
+ .menuDots(@click="isShowPeriodsNames = true")
+ .menuDots__name: Date(:type="2")
+ .menuDots__dots: .mdi.mdi-dots-vertical
+
+ //- Filter
+ //---------------------------
+ .page__filter(v-if="isShowFilter")
+ FilterRow
+
+ //-
+ //---------------------------
+ .boxSummary2._simple._pad
+ .boxSummary2__item
+ Amount(
+ :currency="$store.state.currencies.base"
+ :type="activeTabStat === 'incomes' ? 1 : 0"
+ :value="statCurrentPeriod[activeTabStat].total"
+ size="xl"
+ vertical="left"
)
+ SummaryRowItemView(
+ :type="activeTabStat === 'incomes' ? 1 : 0"
+ :amount="statAverage[activeTabStat]"
+ :title="activeTabStat === 'incomes' ? $t('money.averageIncomes') : $t('money.averageExpenses')"
+ )
+
+ .boxEmpty(v-if="statCurrentPeriod[activeTabStat].categoriesIds.length === 0") {{ $t('stat.empty') }}
- template(slot="bottom")
- .flex
- .col
- Button(
- :title="$t('wallets.new')"
- className="_inline _small"
- @onClick="$store.dispatch('ui/setActiveTab', 'createWallet')"
- )
- .col
- Button(
- :title="$t('base.sort')"
- className="_inline _small"
- @onClick="$store.dispatch('ui/setActiveTab', 'walletsSort')"
- )
-
- //- Stat
- //------------------------------------------------------------------------------
- .swiper-slide
- .page
- .page__wrap
- .page__nav
- h1: Date
-
- .page__summary
- SummaryRow(
- :incomesAmount="statCurrentPeriod.incomes.total"
- :expensesAmount="statCurrentPeriod.expenses.total"
- )
-
- .page__summary
- //- Summary
- //-----------------------------------------------------------
- //- LazySummaryAverage(v-if="$store.state.ui.stat.averageStatVisibility === 'visible'")
-
- .page__content
- .chartBar(v-show="$store.state.ui.statGraphsVisibility === 'visible'")
- ChartMenu2
- StatChartsLine
-
- .switcher(:class="{ _round: $store.state.ui.statGraphsVisibility === 'hidden' }")
- .switcher__content
- .switcher__item._arrow(
- v-if="$store.state.ui.statGraphsVisibility === 'hidden'"
- :class="{ _disable: $store.state.filter.period === 'all' || $store.getters['stat/isLastPeriodSelected'] }"
- @click="$store.dispatch('filter/setPeriodNext')"
- ): .mdi.mdi-chevron-left
-
- .switcher__item(
- v-for="periodItem in periods"
- :key="periodItem.slug"
- :class="{ _active: $store.state.filter.period === periodItem.slug }"
- @click="changePeriod(periodItem.slug)"
- ) {{ periodItem.name }}
-
- .switcher__item._arrow(
- v-if="$store.state.ui.statGraphsVisibility === 'hidden'"
- :class="{ _disable: $store.state.filter.period === 'all' || $store.getters['stat/isFirstPeriodSelected'] }"
- @click="$store.dispatch('filter/setPeriodPrev')"
- ): .mdi.mdi-chevron-right
-
- StatMobile
-
- //- Categories
- .swiper-slide
- ComponentWrap(:contentPadding="false")
- template(slot="headerLeft") {{ $t('categories.name') }}
-
- template(slot="content")
- CategoriesList(
- :style="{ paddingTop: '16px' }"
- @onClick="(id) => $store.dispatch('categories/showCategoryModal', id)"
+ .box(v-if="$store.state.ui.catsChart === 'visible' && statCurrentPeriod[activeTabStat].categoriesIds.length > 0")
+ .box__content
+ PeriodCatsChart(:type="activeTabStat")
+
+ .box(v-if="$store.state.ui.statItems === 'visible' && statCurrentPeriod[activeTabStat].categoriesIds.length > 0")
+ .box__content
+ StatItemMobile(
+ v-for="categoryId in statCurrentPeriod[activeTabStat].categoriesIds"
+ :biggest="statCurrentPeriod[activeTabStat].biggest"
+ :category="$store.state.categories.items[categoryId]"
+ :categoryId="categoryId"
+ :currency="$store.state.currencies.base"
+ :key="categoryId"
+ :total="statCurrentPeriod.categories[categoryId][activeTabStat]"
+ :type="activeTabStat === 'incomes' ? 1 : 0"
)
- template(slot="bottom")
- .flex
- .col
- Button(
- :title="$t('categories.new')"
- className="_inline _small"
- @onClick="$store.dispatch('ui/setActiveTab', 'createCategory')"
- )
+ template(v-if="$store.getters['trns/selectedTrnsIdsWithDate'].length > 0")
+ .boxTitle {{ $t('trns.history') }}
+ .box(style="paddingTop: 0")
+ TrnsList3(
+ :incomes="activeTabStat === 'incomes'"
+ :expenses="activeTabStat === 'expenses'"
+ :size="10"
+ )
- .layoutMobile__menu
- LayoutMobileMenu(:slider="slider")
+ .box._periods
+ .periods
+ .periodItem(
+ @click="$store.dispatch('ui/toogleVisibleCatsChart')"
+ :class="{ _active: $store.state.ui.catsChart === 'visible' }"
+ ) {{ $t('stat.customize.showCategorisChart') }}
+ .periodItem(
+ :class="{ _active: $store.state.ui.statItems === 'visible' }"
+ @click="$store.dispatch('ui/toogleVisibilityStatItems')"
+ ) {{ $t('stat.customize.showCategorisList') }}
+
+ .layoutMobile__menu.pageScrollerJsMenu
+ LayoutMobileMenu
//- Modals
+ //---------------------------------------------------------------------------
CategoryModal(:slider="slider")
CurrencyModal
TrnForm(v-if="$store.getters['wallets/hasWallets'] && $store.getters['categories/hasCategories']")
TrnModal
WalletModal(:slider="slider")
- CategoryStatModal
+
+ LazyDateSelectorModal(
+ v-if="isShowPeriodsNames"
+ @onClose="isShowPeriodsNames = false"
+ )
Portal(
v-if="activeTab === 'menu'"
@@ -191,40 +544,6 @@ export default {
.context-menu-sep
- ContextMenuItem(
- :title="$t('stat.customize.showPeriodsChart')"
- :showCheckbox="true"
- :checkboxValue="$store.state.ui.statGraphsVisibility === 'visible'"
- icon="mdi mdi-chart-bar-stacked"
- @onClick="$store.dispatch('ui/toogleShowStatGraphs')"
- )
-
- ContextMenuItem(
- :title="$t('stat.customize.averageStatVisibility')"
- :showCheckbox="true"
- :checkboxValue="$store.state.ui.stat.averageStatVisibility === 'visible'"
- icon="mdi mdi-chart-timeline"
- @onClick="$store.dispatch('ui/toogleAverageStatVisibility')"
- )
-
- ContextMenuItem(
- :title="$t('stat.customize.showCategorisChart')"
- :showCheckbox="true"
- :checkboxValue="$store.state.ui.catsChart === 'visible'"
- icon="mdi mdi-folder-star"
- @onClick="$store.dispatch('ui/toogleVisibleCatsChart')"
- )
-
- ContextMenuItem(
- :title="$t('stat.customize.showCategorisList')"
- :showCheckbox="true"
- :checkboxValue="$store.state.ui.statItems === 'visible'"
- icon="mdi mdi-chart-gantt"
- @onClick="$store.dispatch('ui/toogleVisibilityStatItems')"
- )
-
- .context-menu-sep
-
ContextMenuItem(
:title="$t('theme.change')"
icon="mdi mdi-palette"
@@ -280,155 +599,492 @@ export default {
)
</template>
+<style lang="stylus">
+@import '~assets/stylus/variables'
+
+.finapp .box .cats-chart__items
+ margin 0 (- $m7)
+ padding-top $m5
+ padding-right $m7
+ padding-bottom 0
+ padding-left $m7
+
+ &:before
+ left (- $m7)
+ background linear-gradient(to right, var(--c-bg-4), rgba(0,0,0,0))
+
+ &:after
+ right (- $m7)
+ background linear-gradient(to right, rgba(0,0,0,0), var(--c-bg-4))
+
+ &:before
+ &:after
+ z-index 10
+ content ''
+ position absolute
+ top 0
+ width $m7
+ height 100%
+
+.finapp .page__header
+ .filterRow
+ padding $m6
+
+ .filterItem
+ padding $m6 $m5
+
+.finapp .page__content .trnsList
+ .trnItem._history
+ margin-right (- $m6)
+ margin-left (- $m6)
+ padding-right $m7
+ padding-left $m7
+
+.finapp .page__content .dropdown._noBd
+ margin 0 $m2 !important
+ border-radius $m6
+</style>
+
<style lang="stylus" scoped>
-@import "~assets/stylus/variables/animations"
-@import "~assets/stylus/variables/margins"
-@import "~assets/stylus/variables/media"
-@import "~assets/stylus/variables/fonts"
-@import "~assets/stylus/variables/scroll"
+@import '~assets/stylus/variables'
-.page
+.menuDots
+ cursor pointer
+ display flex
+ align-items center
+ justify-content center
+
+ &__dots
+ padding-top 3px
+ padding-left 4px
+ color var(--c-font-2)
+ font-size 16px
+
+.boxFlew2
+ display grid
+ grid-template-columns 1fr 1fr
+ grid-column-gap $m7
+ padding 0 $m7
+
+.boxFlew2Item
overflow hidden
- position relative
- width 100%
+ background var(--c-bg-5)
+ border-radius $m6
+
+.layoutMobile
+ display grid
height 100%
+ padding-bottom 44px
+ background var(--c-bg-4)
- &__nav
+ &__content
overflow hidden
- z-index 100
- opacity .95
- position sticky
- top 0
- height 94px
- padding $m7
- background var(--c-bg-2)
- &__summary
+ &__menu
+ position fixed
+ left 0
+ bottom 0
+ width 100%
+ transition all .3s ease
+
+ &._hide
+ transform translateY(100%)
+
+.boxEmpty
+ padding 0 $m7
+ padding-top $m6
+ padding-bottom $m10
+ color var(--c-font-5)
+ font-size 10px
+
+.boxSummary2
+ z-index 9
+ position sticky
+ top 60px
+ display flex
+ align-items center
+ justify-content flex-start
+ margin-bottom $m3
+ padding 0 $m7
+ padding-bottom $m5
+ background var(--c-bg-4)
+
+ &._simple
+ top 42px
padding-top $m6
- &__wrap
- overflow hidden
- overflow-y auto
- scrollbar()
- position relative
- height 100%
+ &._pad
+ top 38px
- h1
- padding-bottom 0
- font-size 18px
+ &._pad22
+ padding-top $m7
- &__content
- padding 0 $m7
+ &__item
+ padding-right $m9
- &__customize
- z-index 20
- position absolute
- top $m5
- right $m7
+.boxSummary
+ padding-top 8px
+ padding-bottom $m6
-.chartBar
- position relative
- margin 0 -8px
- padding 8px
- padding-top 0
- background var(--c-bg-3)
- border-left 1px solid var(--c-bg-4)
- border-right 1px solid var(--c-bg-4)
- border-radius 8px 8px 0 0
+.boxSwitcher
+ max-width 640px
+ margin 0 auto
-.switcher
+ .switcher2
+ .switcher2__item
+ +media-tablet()
+ padding $m7 $m6
+ font-size 14px
+ font-weight 400
+
+$border = 1px
+
+.periods
+ z-index 2
position relative
display flex
align-items center
- margin 0 -8px
+ margin-bottom (- $m7)
+ padding-top $m5
- &._round
- overflow hidden
- border-radius 8px
+.periodItem
+ cursor pointer
+ flex-grow 1
+ display flex
+ align-items center
+ justify-content center
+ min-width 50px
+ padding 12px $m6
+ color var(--c-font-5)
+ font-size 12px
- &._sb
- z-index 15
- justify-content space-between
+ &:active
+ background var(--c-bg-5)
- &__name
- flex-grow 1
+ &._active
color var(--c-font-3)
- font-size 10px
- text-transform uppercase
- &__content
- overflow hidden
- display flex
- align-items stretch
- justify-content space-between
- background var(--c-bg-4)
- border-radius 0 0 8px 8px
- flex-grow 1
+ &__count
+ padding-left $m4
+
+.date
+ color var(--c-font-3)
+ font-size 18px
+ font-weight 600
+
+.switcher
+ overflow hidden
+ position relative
+ display flex
+ align-items stretch
+ justify-content stretch
+ margin 0 $m6
&__item
opacity .6
- flex-grow 1
+ flex 1 1 1%
display flex
align-items center
justify-content center
- min-width 48px
- padding $m6 $m7
- font-size 12px
- text-align center
- border-radius $m9
+ padding $m6 $m5
+ color var(--c-font-4)
+ font-size 14px
+ border-radius $m7
+media-hover()
background var(--c-bg-3)
- &._arrow
- padding $m5 $m6
- font-size 18px
+ &:active
+ opacity 1
+ background var(--c-bg-3)
&._active
opacity 1
- background var(--c-bg-8)
+ color var(--c-font-2)
+ background var(--c-bg-5)
+
+.week
+ display flex
+ align-items center
+ margin 0 (- $m6)
+ padding $m6 0
+ border 1px solid transparent
+ border-bottom-color var(--c-bg-5)
- &._disable
- opacity .3
+ &:last-child
+ border-bottom-color transparent
-.block
- margin-bottom 8px
- background var(--c-bg-3)
- border-bottom 1px solid var(--c-bg-2)
+ &:active:not(._header._bottom)
+ background var(--c-bg-5)
+ border-radius $m5
-.layoutMobile
+ &._active
+ background var(--c-bg-3)
+ border 1px solid var(--c-bg-6)
+ border-radius $m5
+
+ &._header
+ opacity .6
+ border-bottom-color var(--c-bg-7)
+ border-bottom-width 2px
+ margin-bottom $m4
+
+ &._bottom
+ opacity .6
+ border-top-color var(--c-bg-7)
+ border-top-width 2px
+ margin-top (- $m3)
+
+ > div
+ flex 1 0 1%
+ padding 0 $m6
+
+ &__name
+ color var(--c-font-2)
+ font-size 12px
+ text-transform capitalize
+
+ ~/._header &
+ font-weight 500
+
+ &:last-child
+ // padding-bottom 0
+
+.box2
+ position relative
+ margin $m7
+ margin-top $m9
+ margin-bottom $m7
+
+.boxNavItem
+ cursor pointer
+ padding 0 $m5
+ color var(--c-font-4)
+ font-size 32px
+ font-weight 400
+ transform translateY(-22px)
+ transition all .3s ease
+
+ &:active
+ background var(--c-bg-5)
+
+ &._disable
+ opacity .2
+
+ &._last
+ //
+
+.activrPeriodName
+ font-size 14px
+
+.boxTitle
+ z-index 9
+ position sticky
+ top 37px
+ display flex
+ align-items center
+ padding $m6 $m7
+ color var(--c-font-4)
+ font-size 10px
+ font-weight 600
+ text-transform uppercase
+ background var(--c-bg-4)
+
+// Box
+// ----------------------------------------------------------------------------
+.box
+ position relative
+ padding $m7 $m7
+ padding-bottom $m9
+ background var(--c-bg-4)
+
+ +media-tablet()
+ border-bottom 0
+
+ &._stat
+ padding-top $m6
+
+ &._h272
+ height 232px
+ padding-bottom 0
+ border-bottom 0
+
+ &._line
+ padding-top 0
+ padding-bottom $m6
+ border-bottom 0
+
+ &._nobd
+ padding 0
+
+ &._simple
+ padding-top $m7
+ padding-bottom $m7
+ border-bottom 0
+
+ &._periods
+ padding 0
+ padding-bottom $m6
+
+ &__title
+ &__title2
+ display flex
+ // display none
+ align-items center
+ padding-top $m5
+ padding-bottom $m8
+ color var(--c-font-4)
+ font-size 10px
+ font-weight 600
+ text-transform uppercase
+
+ &__title2
+ margin-left (- $m8)
+ padding-bottom 0
+ font-size 14px
+
+ &__title
+ z-index 9
+ position sticky
+ top 37px
+ padding-top $m6
+ padding-bottom $m6
+ background var(--c-bg-4)
+
+ &__nav
+ z-index 10
+ position sticky
+ top 0
+ display flex
+ justify-content center
+ height 38px
+ margin-bottom $m3
+ background var(--c-bg-4)
+
+ &._noMargin
+ margin-bottom 0
+
+ &__control
+ flex-grow 1
+ display flex
+ align-items center
+ justify-content flex-end
+ margin-top (- $m6)
+ color var(--c-font-3)
+ font-size 29px
+
+.page
+ overflow hidden
display grid
- grid-template-rows 1fr minmax(30px, min-content)
height 100%
- background var(--c-bg-2)
+ max-width 900px
+ margin 0 auto
+ background var(--c-bg-4)
+ box-shadow 0 10px 30px 10px var(--c-bg-1)
+
+ &__line
+ width 90%
+ height 1px
+ margin 0 auto
&__content
overflow hidden
+ overflow-y auto
+ scrollbar()
+ height 100%
+
+ &__grid
+ +media-tablet()
+ display grid
+ grid-template-columns repeat(auto-fill, minmax(300px, 1fr))
+ grid-column-gap 40px
+ grid-row-gap 40px
+ padding 40px
+
+ &__block
+ z-index 10
+ opacity .99
+ position sticky
+ top 0
+ width 100%
+ padding 0 0
+ background var(--c-bg-3)
+ box-shadow 0 0 12px 5px rgba(0, 0, 0, .4)
+ transition all .3s ease
+
+ /.light-mode &
+ box-shadow 0 0 12px 5px rgba(120, 120, 120, .5)
+
+ &._hide
+ transform translateY(-100%)
+
+ &__header
+ overflow hidden
+ z-index 2
+ position fixed
+ bottom 44px
+ width 100%
+ background var(--c-bg-3)
+ transition all .3s ease
+ border-top 1px solid var(--c-bg-6)
-.swiper-slide-active
- .handler
- width 16px
- background none
- transition background 0ms
+ &._hide
+ transform translateY(calc(100% + 56px))
-.swiper-container
- height 100%
+ &__period
+ padding $m6
+ padding-bottom 0
-._sidebar
- overflow hidden
- overflow-y auto
- z-index 10
- height 100%
- max-width 70vw
- background var(--c-bg-4)
- border-right 1px solid var(--c-bg-1)
- scrollbar()
+ &__summary
+ flex-grow 1
+ display flex
+ align-items center
+ justify-content space-between
+ padding-bottom $m5
+ background var(--c-bg-3)
-.wrap
- overflow hidden
- position absolute
- top 0
- left 0
- width 100%
- height 100%
+ +media-tablet()
+ max-width 500px
+ margin 0 auto
+ padding $m8 0
+
+ &__nav
+ border-top 1px solid var(--c-bg-6)
+ border-bottom 1px solid var(--c-bg-6)
+
+ &._active
+ color var(--c-font-2)
+ border-bottom 2px solid var(--c-bg-9)
+
+.switcher2
+ display flex
+ align-items center
+
+ &._bg
+ overflow hidden
+ overflow-x auto
+ margin-bottom (- $border)
+ background var(--c-bg-3)
+
+.switcher2__item
+ cursor pointer
+ flex-grow 1
+ padding 12px $m7
+ color var(--c-font-5)
+ font-size 12px
+ font-weight 500
+ font-roboto()
+ text-align center
+ border-bottom $border solid var(--c-bg-5)
+
+ &:active
+ background var(--c-bg-5)
+ border-radius $m6 $m6 0 0
+ border-bottom $border solid var(--c-bg-5)
+
+ &._active
+ cursor default
+ color var(--c-font-3)
+ background none
+ border-bottom $border solid var(--c-blue-1)
</style>
diff --git a/components/layout/LayoutMobileMenu.vue b/components/layout/LayoutMobileMenu.vue
index 66f74466..11e699a8 100644
--- a/components/layout/LayoutMobileMenu.vue
+++ b/components/layout/LayoutMobileMenu.vue
@@ -6,6 +6,10 @@ export default {
slider: {
type: Object,
required: true
+ },
+ stat2: {
+ type: Boolean,
+ default: false
}
},
@@ -17,7 +21,7 @@ export default {
return {
stat: {
icon: 'mdi mdi-poll',
- id: 'stat',
+ id: 'chart',
name: this.$t('stat.shortTitle')
},
wallets: {
@@ -48,23 +52,14 @@ export default {
if (tab === 'categories' && index === 2) { return true }
}
},
+
handleSetActiveTab (tab) {
- switch (tab) {
- case 'wallets':
- this.slider.slideTo(0)
- break
- case 'stat':
- this.slider.slideTo(1)
- break
- case 'categories':
- this.slider.slideTo(2)
- break
- case 'menu':
- this.$store.dispatch('ui/setActiveTab', 'menu')
- break
- default:
- this.slider.slideTo(0)
+ if (tab === 'menu') {
+ this.$store.dispatch('ui/setActiveTab', 'menu')
+ return
}
+
+ this.$store.dispatch('ui/setActiveTabViewName', tab)
}
}
}
@@ -81,12 +76,12 @@ export default {
)
.menu__item__icon: div(:class="menu.wallets.icon")
- //- Stat
+ //- Categories
.menu__item(
- :class="{ _active: getClassName(menu.stat.id) }"
- @click="handleSetActiveTab(menu.stat.id)"
+ :class="{ _active: getClassName(menu.categories.id) }"
+ @click="handleSetActiveTab(menu.categories.id)"
)
- .menu__item__icon: div(:class="menu.stat.icon")
+ .menu__item__icon: div(:class="menu.categories.icon")
.openTrnForm(@click="$store.dispatch('trnForm/openTrnForm', { action: 'create' })")
svg(
@@ -95,12 +90,12 @@ export default {
)
path(d='M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z')
- //- Categories
+ //- Stat
.menu__item(
- :class="{ _active: getClassName(menu.categories.id) }"
- @click="handleSetActiveTab(menu.categories.id)"
+ :class="{ _active: getClassName(menu.stat.id) }"
+ @click="handleSetActiveTab(menu.stat.id)"
)
- .menu__item__icon: div(:class="menu.categories.icon")
+ .menu__item__icon: div(:class="menu.stat.icon")
//- History
.menu__item(
@@ -111,9 +106,9 @@ export default {
</template>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables/animations"
-@import "~assets/stylus/variables/margins"
-@import "~assets/stylus/variables/media"
+@import '~assets/stylus/variables/animations'
+@import '~assets/stylus/variables/margins'
+@import '~assets/stylus/variables/media'
.create-btn
flex-grow 1
@@ -131,7 +126,7 @@ export default {
display flex
align-items center
justify-content center
- padding 17px 0 16px 0
+ padding $m6 0
border-radius 8px
anim()
@@ -141,7 +136,7 @@ export default {
svg
width 24px
height 24px
- fill #0094FF
+ fill var(--c-blue-1)
.menu
background var(--c-bg-3)
@@ -165,7 +160,7 @@ export default {
justify-content center
flex-grow 1
flex-flow column
- padding 16px 0
+ padding $m6 0
color var(--c-font-4)
anim()
@@ -179,9 +174,5 @@ export default {
color var(--c-font-5)
&__icon
- font-size 26px
-
- &__text
- margin-top $m5
- font-size 12px
+ font-size 22px
</style>
diff --git a/components/layout/LayoutPc.vue b/components/layout/LayoutPc.vue
index 06ac2408..c4d1efbd 100644
--- a/components/layout/LayoutPc.vue
+++ b/components/layout/LayoutPc.vue
@@ -34,6 +34,7 @@ export default {
LayoutPcSidebar
.layout__item
+ //- ThemeEditor
transition(name="animation-tab")
Dashboard
@@ -132,9 +133,8 @@ export default {
.walletItemGrid
width 100%
- padding $m8
- padding-top 0
- border-radius $m6 $m6 0 0
+ // padding $m8
+ // padding-top 0
&__name
padding-bottom $m6
@@ -143,7 +143,7 @@ export default {
&__line
height 6px
margin-right (- $m8)
- margin-bottom $m8
+ // margin-bottom $m8
margin-left (- $m8)
.dashboardItems .categoryItem
diff --git a/components/layout/LayoutPcSidebar.vue b/components/layout/LayoutPcSidebar.vue
index b64c35b9..53df8dda 100644
--- a/components/layout/LayoutPcSidebar.vue
+++ b/components/layout/LayoutPcSidebar.vue
@@ -86,13 +86,13 @@ export default {
grid-template-rows minmax(auto, auto) minmax(auto, auto) 1fr
height 100vh
background var(--c-bg-4)
- border-right 1px solid var(--c-bg-1)
+ border-right 1px solid var(--c-bg-2)
&__menu
display flex
justify-content space-between
padding 0 $m7
- background var(--c-bg-5)
+ background var(--c-bg-3)
border-bottom 1px solid var(--c-bg-2)
&__item
@@ -102,8 +102,8 @@ export default {
justify-content center
padding $m7 $m8
font-header-1()
- font-size 18px
color var(--c-font-4)
+ font-size 18px
+media-laptop()
padding 10px 20px
@@ -125,8 +125,8 @@ export default {
z-index 1
padding $m7 $m8
font-header-1()
- font-size 18px
color var(--c-font-4)
+ font-size 18px
&:hover:not(._active)
@media $media-laptop
diff --git a/components/layout/component/ComponentWrap.vue b/components/layout/component/ComponentWrap.vue
index e654fcaf..8ffa2a1d 100644
--- a/components/layout/component/ComponentWrap.vue
+++ b/components/layout/component/ComponentWrap.vue
@@ -53,9 +53,6 @@ export default {
height 100%
&__header
- // background var(--c-bg-4)
- // border-bottom 1px solid var(--c-bg-1)
-
+media-laptop()
background 0
border-bottom 0
@@ -75,6 +72,8 @@ export default {
&-left
font-h1()
+ font-size 22px
+ font-weight 600
+media-laptop()
font-size 28px
diff --git a/components/layout/sidebar/Menu.vue b/components/layout/sidebar/Menu.vue
index 6fcabeff..e655937b 100644
--- a/components/layout/sidebar/Menu.vue
+++ b/components/layout/sidebar/Menu.vue
@@ -65,6 +65,11 @@ export default {
this.$store.dispatch('ui/setActiveTab', 'stat')
return
}
+ if (menuId === 'history') {
+ this.$router.push('/history')
+ this.$store.dispatch('ui/setActiveTab', 'stat')
+ return
+ }
else if (menuId === 'trnForm') {
this.$store.dispatch('trnForm/openTrnForm', { action: 'create' })
return
@@ -99,7 +104,7 @@ export default {
</template>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables"
+@import '~assets/stylus/variables'
item-bg-active()
background var(--c-bg-6)
diff --git a/components/modal/ModalBottom.vue b/components/modal/ModalBottom.vue
index ad4ba67d..de5862ca 100644
--- a/components/modal/ModalBottom.vue
+++ b/components/modal/ModalBottom.vue
@@ -18,12 +18,6 @@ export default {
}
},
- data () {
- return {
- isShowed: false
- }
- },
-
setup (props, ctx) {
const scrollContainer = ref(null)
const scrollContent = ref(null)
@@ -54,6 +48,12 @@ export default {
}
},
+ data () {
+ return {
+ isShowed: false
+ }
+ },
+
mounted () {
this.isShowed = true
}
@@ -79,7 +79,7 @@ export default {
//--------------------------------------
transition(
appear
- name="slide"
+ name="slide2"
@after-leave="afterClose"
)
.modalBottom__wrap(
@@ -96,10 +96,7 @@ export default {
//- Header
//--------------------------------------
- .modalBottom__header(
- v-if="$slots.header || title"
- @click="onCloseModal"
- )
+ .modalBottom__header(v-if="$slots.header || title")
//- Slot
template(v-if="$slots.header")
slot(name="header")
@@ -131,7 +128,7 @@ export default {
</template>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables"
+@import '~assets/stylus/variables'
.modalBottom
&__wrap
@@ -144,10 +141,10 @@ export default {
</style>
<style lang="stylus">
-@import "~assets/stylus/variables"
+@import '~assets/stylus/variables'
.modalBottom
- z-index 4
+ z-index 10
position fixed
left 0
bottom 0
@@ -161,7 +158,7 @@ export default {
bottom 0
width 100%
height 100%
- background var(--c-bg-overflow)
+ background var(--c-bg-14)
&__wrap
position relative
@@ -182,7 +179,7 @@ export default {
overflow-y auto
max-height calc(90vh - 80px)
padding $m7
- background var(--c-bg-2)
+ background var(--c-bg-4)
scrollbar()
@media $media-laptop
@@ -192,9 +189,6 @@ export default {
^[0]._paddingless &
padding 0
- /.light-mode &
- background var(--c-bg-2)
-
&__header
flex-grow 1
position relative
@@ -203,13 +197,9 @@ export default {
padding $m7
color var(--c-font-2)
fontFamilyNunito()
- background var(--c-bg-2)
+ background var(--c-bg-4)
border-radius $m7 $m7 0 0
- /.light-mode &
- color var(--c-font-4)
- background var(--c-bg-1)
-
&._alt
background var(--c-bg-1)
border-bottom 1px solid var(--c-bg-1)
diff --git a/components/modal/ModalButton.vue b/components/modal/ModalButton.vue
index a928727e..0c452bb6 100644
--- a/components/modal/ModalButton.vue
+++ b/components/modal/ModalButton.vue
@@ -8,32 +8,35 @@ export default {
name: {
type: String,
required: true
+ },
+ isActive: {
+ type: Boolean,
+ default: false
}
}
}
</script>
<template lang="pug">
-.button-link(@click="$emit('onClick')")
+.button-link(
+ :class="{ _active: isActive }"
+ @click="$emit('onClick')"
+)
.button-link__icon: div(:class="icon")
.button-link__name {{ name }}
</template>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables"
+@import '~assets/stylus/variables'
.button-link
cursor pointer
width auto
max-width 100%
- padding $m7 0
+ padding $m6 $m6
white-space nowrap
text-align center
- border-radius $m3
-
- /.light-mode &
- color var(--c-font-2)
- background var(--c-bg-1)
+ border-radius $m5
&__icon
opacity .8
@@ -43,10 +46,14 @@ export default {
&:hover
@media $media-laptop
- background var(--c-bg-6)
+ background var(--c-bg-3)
&:active
- background var(--c-bg-6)
+ background var(--c-bg-3)
+
+ &._active
+ background var(--c-bg-3)
+ border 1px solid var(--c-bg-6)
&__name
color var(--c-font-3)
diff --git a/components/shared/BaseModal.vue b/components/shared/BaseModal.vue
index 33eeb847..98afe94f 100644
--- a/components/shared/BaseModal.vue
+++ b/components/shared/BaseModal.vue
@@ -79,7 +79,7 @@ portal(to="modal" v-if="show")
@click="onClose"
)
- transition(name="slide" appear @after-leave="afterClose")
+ transition(name="hey" appear @after-leave="afterClose")
.baseModal__wrap(
ref="scrollDragger"
v-show="show"
@@ -105,7 +105,7 @@ portal(to="modal" v-if="show")
@import "~assets/stylus/variables/margins"
.baseModal
- z-index 3
+ z-index 10
position fixed
left 0
@@ -126,7 +126,7 @@ portal(to="modal" v-if="show")
bottom 0
width 100%
height 100%
- background var(--c-bg-overflow)
+ background var(--c-bg-14)
anim()
@media $media-laptop
diff --git a/components/shared/button/Button.vue b/components/shared/button/Button.vue
index 9276bd0a..41ef518f 100644
--- a/components/shared/button/Button.vue
+++ b/components/shared/button/Button.vue
@@ -74,13 +74,9 @@ export default {
font-size 16px
border-radius 50px
- /.light-mode &
- box-shadow 2px 2px 6px 0px var(--c-bg-11)
-
&:active:not(._disable)
color var(--c-font-3)
background var(--c-bg-2)
- border 1px solid var(--c-bg-7)
box-shadow 2px 2px 6px 0px var(--c-bg-2)
&:hover:not(._disable)
@@ -91,6 +87,9 @@ export default {
&._disable
opacity .6
+
+ &:active
+ background var(--c-bg-3)
</style>
<style lang="stylus" scoped>
@@ -116,31 +115,32 @@ export default {
font-size 14px
&:active
- transform scale(1.02)
+ background var(--c-bg-3)
&._center
text-align center
&._borderBottom
+ width 100%
margin-bottom 0
- padding $m7 0
+ padding $m7 $m7
+ border-radius $m5
&._border
display flex
align-items center
justify-content center
- background var(--c-bg-3)
- border 1px solid var(--c-bg-4)
- border-radius 3px
- box-shadow 2px 2px 6px 0px var(--c-bg-2)
+ margin 0 auto
+ padding $m6 $m6
+ color var(--c-font-4)
+ font-size 13px
+ background var(--c-bg-4)
+ border 1px solid var(--c-bg-5)
+ border-radius $m5
anim()
- /.light-mode &
- box-shadow 2px 2px 6px 0px var(--c-bg-11)
-
&:active:not(._disable)
color var(--c-font-3)
- transform scale(.96)
+media-laptop()
&:hover
@@ -162,7 +162,7 @@ export default {
&._inline
display flex
width 100%
- max-width 400px
+ max-width 220px
margin 0 auto
@media $media-laptop
@@ -191,19 +191,15 @@ export default {
&._small
height 40px
- padding 0 $m7
+ padding 0 $m8
color var(--c-font-4)
- background var(--c-bg-2)
- border 1px solid var(--c-bg-7)
- border-radius $m3
- box-shadow 2px 2px 6px 0px var(--c-bg-2)
-
- /.light-mode &
- box-shadow 2px 2px 6px 0px var(--c-bg-11)
+ font-size 12px
+ background var(--c-bg-3)
+ border 1px solid var(--c-bg-5)
+ border-radius $m4
^[0]:active &
color var(--c-font-3)
- transform scale(.96)
^[0]:hover &
@media $media-laptop
diff --git a/components/shared/contextMenu/ContextMenu.vue b/components/shared/contextMenu/ContextMenu.vue
index f36eb0ad..78c4fa18 100644
--- a/components/shared/contextMenu/ContextMenu.vue
+++ b/components/shared/contextMenu/ContextMenu.vue
@@ -31,6 +31,12 @@ export default {
}
}
if (this.position && this.position.right && typeof this.position.right === 'string') {
+ if (this.position.top && typeof this.position.top === 'string') {
+ return {
+ right: this.position.right,
+ top: this.position.top
+ }
+ }
return {
right: this.position.right
}
@@ -45,7 +51,12 @@ export default {
<template lang="pug">
.context-menu
transition(name="slide2")
- .context-menu__popup(v-if="$slots.content" :class="className", :style="positionStyles" v-show="visible")
+ .context-menu__popup(
+ v-if="$slots.content"
+ v-show="visible"
+ :class="className"
+ :style="positionStyles"
+ )
.context-menu__overflow(@click="$emit('onClickOpener')")
.context-menu__content
slot(name="content")
@@ -69,10 +80,10 @@ export default {
</style>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables/margins"
+@import '~assets/stylus/variables/margins'
.context-menu
- z-index 4
+ z-index 6
position relative
&__opener
@@ -89,19 +100,15 @@ export default {
&__popup
overflow hidden
- z-index 22
+ z-index 20
position absolute
top 48px
min-width 200px
- padding $m3
- background var(--c-bg-3)
- border 1px solid var(--c-bg-4)
- border-radius $m3
+ background var(--c-bg-2)
+ border 1px solid var(--c-bg-6)
+ border-radius $m6
box-shadow 0 10px 20px -5px var(--c-bg-1)
- /.light-mode &
- background var(--c-bg-7)
-
&._right
right 0
@@ -112,19 +119,13 @@ export default {
&__content
z-index 12
position relative
- background var(--c-bg-7)
-
- /.light-mode &
- background var(--c-bg-7-a)
&__desc
display flex
align-items center
- padding 10px 12px
+ padding 10px 16px
color var(--c-font-4)
font-size 11px
- background var(--c-bg-8)
-
- /.light-mode &
- background var(--c-bg-1)
+ background var(--c-bg-4)
+ border-top 1px solid var(--c-bg-6)
</style>
diff --git a/components/shared/contextMenu/ContextMenuItem.vue b/components/shared/contextMenu/ContextMenuItem.vue
index ba21080e..79fb1d3b 100644
--- a/components/shared/contextMenu/ContextMenuItem.vue
+++ b/components/shared/contextMenu/ContextMenuItem.vue
@@ -55,36 +55,32 @@ export default {
cursor pointer
display flex
align-items center
- height 50px
+ height 42px
+ margin $m4 $m4
padding 0 $m6
font-size 13px
white-space nowrap
+ border-radius $m5
@media $media-laptop
height 38px
&:active
- background var(--c-bg-2)
- /.light-mode &
- background var(--c-bg-7)
+ background var(--c-bg-1)
&:hover
@media $media-laptop
background var(--c-bg-2)
- /.light-mode &
- background var(--c-bg-7)
&._selected
- background var(--c-bg-4)
- /.light-mode &
- background var(--c-bg-4)
+ background var(--c-bg-5)
&__icon
+ opacity .85
width 24px
margin-right $m6
font-size 18px
text-align center
- opacity .85
&__title
color var(--c-font-3)
diff --git a/components/shared/date/Date.vue b/components/shared/date/Date.vue
index ee3c3512..aad2b90e 100644
--- a/components/shared/date/Date.vue
+++ b/components/shared/date/Date.vue
@@ -1,22 +1,27 @@
<script>
-import dayjs from 'dayjs'
-
export default {
+ props: {
+ type: {
+ type: Number,
+ default: 3
+ }
+ },
+
computed: {
formatedDate () {
- const today = dayjs()
+ const today = this.$day()
const filterDate = this.$store.state.filter.date
const filterPeriod = this.$store.state.filter.period
let format = 'MMMM'
switch (filterPeriod) {
case 'day':
- if (today.isSame(filterDate, 'day')) {
- return this.$t('dates.day.current')
- }
- else if (today.subtract(1, filterPeriod).isSame(filterDate, 'day')) {
- return 'Yesterday'
- }
+ // if (today.isSame(filterDate, 'day')) {
+ // return this.$t('dates.day.current')
+ // }
+ // else if (today.subtract(1, filterPeriod).isSame(filterDate, 'day')) {
+ // return 'Yesterday'
+ // }
if (today.isSame(filterDate, 'year')) {
format = 'DD MMMM'
}
@@ -30,19 +35,20 @@ export default {
return this.$t('dates.week.current')
}
else if (today.subtract(1, filterPeriod).isSame(filterDate, 'week')) {
- return 'Last week'
+ return this.$t('dates.week.last')
}
- const date = dayjs(filterDate)
- const startDate = date.startOf('week').format('DD.MM.YY')
- const endDate = date.endOf('week').format('DD.MM.YY')
+ const date = this.$day(filterDate)
+ const startDate = date.startOf('week').format('D MMMM')
+ const endDate = date.endOf('week').format('D MMMM')
return `${startDate} - ${endDate}`
case 'month':
- if (today.isSame(filterDate, 'month')) {
- return this.$t('dates.month.current')
- }
- else if (today.subtract(1, filterPeriod).isSame(filterDate, 'month')) {
- return 'Last month'
+ // if (today.isSame(filterDate, 'month')) {
+ // return this.$t('dates.month.current')
+ // }
+ if (today.isSame(filterDate, 'year')) {
+ format = 'MMMM'
+ break
}
format = 'MMMM YYYY'
break
@@ -52,7 +58,7 @@ export default {
break
}
- return dayjs(filterDate).format(format)
+ return this.$day(filterDate).format(format)
}
}
}
@@ -60,6 +66,21 @@ export default {
<template lang="pug">
.date
- template(v-if="$store.state.filter.period === 'all'") All data
- template(v-else) {{ formatedDate }}
+ template(v-if="$store.state.filter.period === 'all'") {{ $t('dates.all.simple') }}
+ template(v-else)
+ template(v-if="type === 0") {{ $t('money.expenses') }} &nbsp;
+ template(v-if="type === 1") {{ $t('money.incomes') }} &nbsp;
+ template(v-if="type === 2") {{ $t('money.total') }} &nbsp;
+ .hey {{ formatedDate }}
</template>
+
+<style lang="stylus" scoped>
+.date
+ display flex
+ align-items center
+ &:first-letter
+ text-transform uppercase
+
+.hey:first-letter
+ text-transform uppercase
+</style>
diff --git a/components/shared/dropdown/Dropdown.vue b/components/shared/dropdown/Dropdown.vue
index 3724170c..ea8f188e 100644
--- a/components/shared/dropdown/Dropdown.vue
+++ b/components/shared/dropdown/Dropdown.vue
@@ -32,6 +32,7 @@ export default {
.dropdown
.dropdown.d-button-cirle
+ cursor pointer
display flex
align-items stretch
width auto
@@ -66,7 +67,7 @@ export default {
justify-content center
font-size 18px
margin-right 6px
- opacity .8
+ opacity .6
&__title
flex-grow 1
@@ -75,10 +76,12 @@ export default {
padding-right 12px
&__toogle
- width 4px
- flex-grow 0
- font-size 18px
+ opacity .8
justify-content center
+ width 2px
+ flex-grow 0
+ font-size 15px
+ transform translateY(1px)
div
anim-all()
diff --git a/components/shared/inputs/Checkbox.vue b/components/shared/inputs/Checkbox.vue
index 6fae5632..36fca98f 100644
--- a/components/shared/inputs/Checkbox.vue
+++ b/components/shared/inputs/Checkbox.vue
@@ -60,8 +60,8 @@ label.checkbox(:class="{ _alt: alt }")
font-size 1em
&__input[type=checkbox]
- position absolute
opacity 0
+ position absolute
&:checked
+ .checkbox__helper:before
@@ -69,8 +69,7 @@ label.checkbox(:class="{ _alt: alt }")
box-shadow inset 0px 1px 1px background var(--c-bg-12)
^[0]._alt &
background var(--c-bg-7)
- /.light-mode &
- background var(--c-bg-13)
+
+ .checkbox__helper:after
animation switch .2s ease-out
left var(--left)
diff --git a/components/stat/DateSelectorModal.vue b/components/stat/DateSelectorModal.vue
new file mode 100644
index 00000000..a329b35b
--- /dev/null
+++ b/components/stat/DateSelectorModal.vue
@@ -0,0 +1,86 @@
+<script>
+export default {
+ name: 'DateSelectorModal',
+
+ data () {
+ return {
+ isShow: true,
+ periodsNames: [{
+ slug: 'day',
+ icon: 'mdi mdi-weather-sunset-up',
+ name: this.$t('dates.day.simple')
+ }, {
+ slug: 'week',
+ icon: 'mdi mdi-calendar-week',
+ name: this.$t('dates.week.simple')
+ }, {
+ slug: 'month',
+ icon: 'mdi mdi-calendar',
+ name: this.$t('dates.month.simple')
+ }, {
+ slug: 'year',
+ icon: 'mdi mdi-calendar-star',
+ name: this.$t('dates.year.simple')
+ }]
+ }
+ },
+
+ computed: {
+ activePriodName () {
+ return this.$store.state.filter.period
+ }
+ },
+
+ methods: {
+ onSelectPeriod (period) {
+ this.$store.dispatch('filter/setPeriod', period)
+ this.$emit('onClose')
+ }
+ }
+}
+</script>
+
+<template lang="pug">
+Portal(
+ v-if="isShow"
+ to="modal"
+)
+ ModalBottom(
+ @onClose="$emit('onClose')"
+ @afterClose="$emit('afterClose')"
+ )
+ template(slot="header")
+ .modalBottom__header__title
+ .ta_center
+ Date
+
+ .grid
+ ModalButton(
+ v-for="periodItem in periodsNames"
+ :icon="periodItem.icon"
+ :isActive="activePriodName === periodItem.slug"
+ :key="periodItem.slug"
+ :name="$t(`dates.${periodItem.slug}.simple`)"
+ @onClick="onSelectPeriod(periodItem.slug)"
+ )
+ ModalButton(
+ :isActive="activePriodName === 'all'"
+ :name="$t('dates.all.simple')"
+ icon="mdi mdi-database"
+ @onClick="onSelectPeriod('all')"
+ )
+</template>
+
+<style lang="stylus" scoped>
+.ta_center
+ display flex
+ align-items center
+ justify-content center
+ text-align center
+
+.grid
+ display grid
+ grid-template-columns repeat(auto-fit, minmax(75px, 1fr))
+ grid-column-gap 0
+ grid-row-gap $m7
+</style>
diff --git a/components/stat/StatChartDonut.vue b/components/stat/StatChartDonut.vue
index 07963fbb..57fee7c2 100644
--- a/components/stat/StatChartDonut.vue
+++ b/components/stat/StatChartDonut.vue
@@ -1,11 +1,6 @@
<script>
-import dayjs from 'dayjs'
import { Chart } from 'highcharts-vue'
-import Highcharts from 'highcharts'
-import borderRadius from 'highcharts-border-radius'
-import chartOptions from './chartOptions'
-
-borderRadius(Highcharts)
+import chartOptions from '~/components/stat/chartOptions'
export default {
components: {
@@ -15,18 +10,19 @@ export default {
data () {
const vm = this
return {
- date: dayjs().valueOf(),
+ date: this.$day().valueOf(),
periodName: 'month',
visiblePeriodMenu: false,
dateStart: null,
dateEnd: null,
chartOptions: {
...chartOptions,
+ tooltip: false,
chart: {
events: {
click (e) {
- const date = this.series[0].searchPoint(e, true).date
- vm.$store.dispatch('filter/setDate', parseInt(date))
+ const value = this.series[0].searchPoint(e, true) || this.series[1].searchPoint(e, true)
+ vm.$store.dispatch('filter/setDate', parseInt(value.date))
}
}
}
@@ -70,6 +66,7 @@ export default {
},
chart: {
+ tooltip: false,
backgroundColor: 'transparent',
with: '100%',
height: '40%',
@@ -102,12 +99,12 @@ export default {
const allTrnsIds = Object.keys(trns)
// diff periods from oldest trn and today
- const oldestTrnDate = dayjs(trns[this.$store.getters['trns/firstCreatedTrnId']].date).endOf(periodName)
- let periodsToShow = dayjs().endOf(periodName).diff(oldestTrnDate, periodName) + 1
+ const oldestTrnDate = this.$day(trns[this.$store.getters['trns/firstCreatedTrnId']].date).endOf(periodName)
+ let periodsToShow = this.$day().endOf(periodName).diff(oldestTrnDate, periodName) + 1
periodsToShow = periodsToShow > 24 ? 24 : periodsToShow
// get balance for first period
- const dateStart = dayjs().endOf(periodName).subtract(periodsToShow, periodName).valueOf()
+ const dateStart = this.$day().endOf(periodName).subtract(periodsToShow, periodName).valueOf()
const trnsIdsBeforeDate = allTrnsIds.filter(id => trns[id].date < dateStart)
const totalStart = this.$store.getters['trns/getTotalOfTrnsIds'](trnsIdsBeforeDate, true)
@@ -118,13 +115,13 @@ export default {
for (let index = 0; index < periodsToShow; index++) {
// count balance
- const balanceDateStart = dayjs().endOf(periodName).subtract(index, periodName).valueOf()
+ const balanceDateStart = this.$day().endOf(periodName).subtract(index, periodName).valueOf()
const balanceTrnsIds = allTrnsIds.filter(id => trns[id].date > dateStart && trns[id].date < balanceDateStart)
const balanceTotal = this.$store.getters['trns/getTotalOfTrnsIds'](balanceTrnsIds, true)
// count total period
- const periodDate = dayjs().endOf(periodName).subtract(index, periodName).valueOf()
- const name = dayjs(periodDate).format('MMM YY')
+ const periodDate = this.$day().endOf(periodName).subtract(index, periodName).valueOf()
+ const name = this.$day(periodDate).format('MMM YY')
const trnsIds = this.$store.getters['trns/getTrns']({ date: periodDate, periodName })
const periodTotal = this.$store.getters['trns/getTotalOfTrnsIds'](trnsIds)
diff --git a/components/stat/StatChartDonut2.vue b/components/stat/StatChartDonut2.vue
new file mode 100644
index 00000000..45445fd6
--- /dev/null
+++ b/components/stat/StatChartDonut2.vue
@@ -0,0 +1,333 @@
+<script>
+import { Chart } from 'highcharts-vue'
+import chartOptions from '~/components/stat/chartOptions'
+
+export default {
+ name: 'StatChartDonut2',
+
+ components: {
+ Chart
+ },
+
+ props: {
+ isShowIncomes: {
+ type: Boolean,
+ default: true
+ },
+ isShowExpenses: {
+ type: Boolean,
+ default: true
+ }
+ },
+
+ data () {
+ const vm = this
+ return {
+ average: 0,
+ date: this.$day().valueOf(),
+ periodName: 'month',
+ visiblePeriodMenu: false,
+ dateStart: null,
+ dateEnd: null,
+ chartOptions: {
+ ...chartOptions,
+ tooltip: false,
+ chart: {
+ events: {
+ click (e) {
+ const value = this.series[0].searchPoint(e, true) || this.series[1].searchPoint(e, true)
+ vm.$store.dispatch('filter/setDate', parseInt(value.date))
+ }
+ }
+ }
+ }
+ }
+ },
+
+ computed: {
+ activeTab () {
+ return this.$store.state.dashboard.activeTab === 'balance'
+ }
+ },
+
+ watch: {
+ activeTab (isShow) {
+ if (isShow) {
+ // this.chartOptions.chart.redraw()
+ }
+ }
+ },
+
+ mounted () {
+ const data = this.generateData(this.$store.state.filter.period)
+ const handlePerioSelect = date => this.$store.dispatch('filter/setDate', parseInt(date))
+ this.chartOptions.series = data.series
+ this.chartOptions.plotOptions.series = {
+ cursor: 'pointer',
+ point: {
+ events: {
+ click () {
+ handlePerioSelect(this.date)
+ }
+ }
+ }
+ }
+
+ this.chartOptions = {
+ ...this.chartOptions,
+ xAxis: {
+ categories: data.categories,
+ labels: {
+ padding: 15,
+ rotation: false
+ }
+ },
+
+ yAxis: {
+ plotLines: [{
+ opacity: 0.3,
+ color: 'var(--c-expenses-opacity)',
+ value: data.averageExpenses, // Insert your average here
+ width: '1',
+ zIndex: 1
+ }, {
+ opacity: 0.3,
+ color: 'var(--c-incomes-opacity)',
+ value: data.averageIncomes, // Insert your average here
+ width: '1',
+ zIndex: 1
+ }]
+ },
+
+ chart: {
+ tooltip: false,
+ backgroundColor: 'transparent',
+ with: '100%',
+ height: '200',
+ spacing: [5, 0, 0, 0],
+ type: 'column',
+ zoomType: 'x',
+ panning: true,
+ panKey: 'shift'
+ }
+ }
+ },
+
+ methods: {
+ changePeriod (name) {
+ if (this.periodName !== name) {
+ this.periodName = name
+ const data = this.generateData(this.periodName, this.chartOptions.series)
+ this.chartOptions.series = data.series
+ this.chartOptions.xAxis.categories = data.categories
+ }
+ },
+
+ formatAmount (amount) {
+ const fixed = this.$store.state.currencies.base === 'RUB' ? 0 : 2
+ return Number(`${amount.toFixed(fixed)}`).toLocaleString('ru-RU')
+ },
+
+ generateData (periodName, oldSeries) {
+ const trns = this.$store.state.trns.items
+ // const allTrnsIds = Object.keys(trns)
+
+ // diff periods from oldest trn and today
+ const oldestTrnDate = this.$day(trns[this.$store.getters['trns/firstCreatedTrnId']].date).endOf(periodName)
+ let periodsToShow = this.$day().endOf(periodName).diff(oldestTrnDate, periodName) + 1
+ periodsToShow = this.$store.state.chart.periods[periodName].showedPeriods >= periodsToShow ? periodsToShow : this.$store.state.chart.periods[periodName].showedPeriods
+
+ // get balance for first period
+ // const dateStart = this.$day().endOf(periodName).subtract(periodsToShow, periodName).valueOf()
+ // const trnsIdsBeforeDate = allTrnsIds.filter(id => trns[id].date < dateStart)
+ // const totalStart = this.$store.getters['trns/getTotalOfTrnsIds'](trnsIdsBeforeDate, true)
+
+ const categories = []
+ const incomesData = []
+ const expensesData = []
+ const totalData = []
+
+ for (let index = 0; index < periodsToShow; index++) {
+ // count balance
+ // const balanceDateStart = this.$day().endOf(periodName).subtract(index, periodName).valueOf()
+ // const balanceTrnsIds = allTrnsIds.filter(id => trns[id].date > dateStart && trns[id].date < balanceDateStart)
+ // const balanceTotal = this.$store.getters['trns/getTotalOfTrnsIds'](balanceTrnsIds, true)
+
+ // count total period
+ const periodDate = this.$day().endOf(periodName).subtract(index, periodName).valueOf()
+ const trnsIds = this.$store.getters['trns/getTrns']({ date: periodDate, periodName })
+ const periodTotal = this.$store.getters['trns/getTotalOfTrnsIds'](trnsIds)
+
+ let format = 'MM'
+ if (periodName === 'day') { format = 'D.MM' }
+ if (periodName === 'week') { format = 'D MMM' }
+ if (periodName === 'month') { format = 'MMM' }
+ if (periodName === 'year') { format = 'YYYY' }
+ const name = this.$day().startOf(periodName).subtract(index, periodName).format(format)
+
+ // return
+ incomesData.unshift({
+ date: periodDate,
+ y: Number(`${periodTotal.incomes.toFixed()}`)
+ })
+ expensesData.unshift({
+ date: periodDate,
+ y: Number(`${periodTotal.expenses.toFixed()}`)
+ })
+ // totalData.unshift({
+ // date: periodDate,
+ // y: Number(`${(totalStart.total + balanceTotal.total).toFixed()}`)
+ // })
+ totalData.unshift({
+ date: periodDate,
+ y: Number(`${(periodTotal.total).toFixed()}`)
+ })
+ categories.unshift(name)
+ }
+
+ let periods = 0
+ let periodsTotalIncomes = 0
+ for (const iterator of incomesData) {
+ if (iterator.y !== 0) {
+ periods = periods + 1
+ periodsTotalIncomes = periodsTotalIncomes + iterator.y
+ }
+ }
+ let periodsExpenses = 0
+ let periodsTotalExpenses = 0
+ for (const iterator of expensesData) {
+ if (iterator.y !== 0) {
+ periodsExpenses = periodsExpenses + 1
+ periodsTotalExpenses = periodsTotalExpenses + iterator.y
+ }
+ }
+
+ return {
+ series: [{
+ zIndex: 3,
+ visible: periodsTotalIncomes > 0 && this.isShowIncomes,
+ type: 'line',
+ name: this.$t('money.incomes'),
+ color: 'var(--c-incomes-1)',
+ data: incomesData,
+ marker: {
+ radius: 3,
+ fillColor: 'var(--c-bg-4)',
+ lineWidth: 2,
+ lineColor: 'var(--c-incomes-1)',
+ symbol: 'circle'
+ },
+
+ dataLabels: {
+ enabled: true,
+ allowOverlap: false,
+ shadow: false,
+ color: 'var(--c-font-3)',
+ backgroundColor: 'var(--c-bg-15)',
+ align: 'center',
+ borderRadius: 3,
+ padding: 3,
+ y: -8,
+ style: {
+ textOutline: 'var(--c-bg-1)',
+ color: 'var(--c-bg-7)',
+ fontSize: '10px',
+ fontFamily: 'var(--font-secondary)',
+ fontWeight: 400,
+ textTransform: 'uppercase'
+ }
+ }
+ }, {
+ zIndex: 2,
+ visible: periodsTotalExpenses > 0 && this.isShowExpenses,
+ type: 'line',
+ name: this.$t('money.expenses'),
+ color: 'var(--c-expenses-1)',
+ data: expensesData,
+ marker: {
+ radius: 3,
+ fillColor: 'var(--c-bg-4)',
+ lineWidth: 2,
+ lineColor: 'var(--c-expenses-1)',
+ symbol: 'circle'
+ },
+ dataLabels: {
+ enabled: true,
+ allowOverlap: false,
+ shadow: false,
+ color: 'var(--c-font-3)',
+ backgroundColor: 'var(--c-bg-15)',
+ align: 'center',
+ borderRadius: 3,
+ padding: 3,
+ y: -8,
+ style: {
+ textOutline: 'var(--c-bg-1)',
+ color: 'var(--c-bg-7)',
+ fontSize: '10px',
+ fontFamily: 'var(--font-secondary)',
+ fontWeight: 400,
+ textTransform: 'uppercase'
+ }
+ }
+ }, {
+ zIndex: 1,
+ visible: false,
+ type: 'areaspline',
+ name: this.$t('money.total'),
+ color: '#c1c1c1',
+ data: totalData,
+ marker: {
+ radius: 3,
+ fillColor: 'var(--c-bg-4)',
+ lineWidth: 2,
+ lineColor: '#c1c1c1',
+ symbol: 'circle'
+ },
+ dataLabels: {
+ enabled: true,
+ allowOverlap: false,
+ shadow: false,
+ color: 'var(--c-font-3)',
+ backgroundColor: 'var(--c-bg-15)',
+ align: 'center',
+ borderRadius: 3,
+ padding: 3,
+ y: -8,
+ style: {
+ textOutline: 'var(--c-bg-1)',
+ color: 'var(--c-bg-7)',
+ fontSize: '10px',
+ fontFamily: 'var(--font-secondary)',
+ fontWeight: 400,
+ textTransform: 'uppercase'
+ }
+ }
+ }],
+ categories,
+ averageIncomes: periodsTotalIncomes / periods,
+ averageExpenses: periodsTotalExpenses / periodsExpenses
+ }
+ }
+ }
+}
+</script>
+
+<template lang="pug">
+.chart
+ Chart(:options="chartOptions")
+</template>
+
+<style lang="stylus" scoped>
+@import "~assets/stylus/variables/animations"
+@import "~assets/stylus/variables/margins"
+@import "~assets/stylus/variables/fonts"
+@import "~assets/stylus/variables/media"
+
+$background = var(--c-bg-4)
+$border = var(--c-bg-1)
+
+.chart
+ z-index 3
+ position relative
+</style>
diff --git a/components/stat/StatChartDonut3.vue b/components/stat/StatChartDonut3.vue
new file mode 100644
index 00000000..7a23b1cb
--- /dev/null
+++ b/components/stat/StatChartDonut3.vue
@@ -0,0 +1,311 @@
+<script>
+import { Chart } from 'highcharts-vue'
+import chartOptions from '~/components/stat/chartOptions'
+
+export default {
+ name: 'StatChartDonut3',
+
+ components: {
+ Chart
+ },
+
+ props: {
+ categoryId: {
+ type: String,
+ required: true
+ },
+ color: {
+ type: String,
+ required: true
+ },
+ type: {
+ type: Number,
+ default: 3
+ }
+ },
+
+ data () {
+ const vm = this
+ return {
+ average: 0,
+ date: this.$day().valueOf(),
+ periodName: 'month',
+ visiblePeriodMenu: false,
+ dateStart: null,
+ dateEnd: null,
+ chartOptions: {
+ ...chartOptions,
+ legend: false,
+ tooltip: false,
+ chart: {
+ events: {
+ click (e) {
+ const value = this.series[0].searchPoint(e, true) || this.series[1].searchPoint(e, true)
+ vm.$store.dispatch('filter/setDate', parseInt(value.date))
+ }
+ }
+ }
+ }
+ }
+ },
+
+ computed: {
+ activeTab () {
+ return this.$store.state.dashboard.activeTab === 'balance'
+ }
+ },
+
+ watch: {
+ activeTab (isShow) {
+ if (isShow) {
+ // this.chartOptions.chart.redraw()
+ }
+ }
+ },
+
+ mounted () {
+ const data = this.generateData(this.$store.state.filter.period)
+ const handlePerioSelect = date => this.$store.dispatch('filter/setDate', parseInt(date))
+ this.chartOptions.series = data.series
+ this.chartOptions.plotOptions.series = {
+ cursor: 'pointer',
+ point: {
+ events: {
+ click () {
+ handlePerioSelect(this.date)
+ }
+ }
+ }
+ }
+
+ this.chartOptions = {
+ ...this.chartOptions,
+ xAxis: {
+ categories: data.categories,
+
+ // plotLines: [{
+ // color: 'var(--c-bg-9)',
+ // dashStyle: 'solid', // Style of the plot line. Default to solid
+ // value: 2, // Value of where the line will appear
+ // width: 6, // Width of the line
+ // zIndex: 1
+ // }]
+ },
+
+ yAxis: {
+ plotLines: [{
+ opacity: 0.3,
+ color: 'var(--c-expenses-opacity)',
+ value: data.averageExpenses, // Insert your average here
+ width: '1',
+ zIndex: 1
+ }, {
+ opacity: 0.3,
+ color: 'var(--c-incomes-opacity)',
+ value: data.averageIncomes, // Insert your average here
+ width: '1',
+ zIndex: 1
+ }]
+ },
+
+ chart: {
+ tooltip: false,
+ backgroundColor: 'transparent',
+ with: '100%',
+ height: '200',
+ spacing: [5, 0, 0, 15],
+ type: 'column',
+ zoomType: 'x',
+ panning: true,
+ panKey: 'shift'
+ }
+ }
+ },
+
+ methods: {
+ changePeriod (name) {
+ if (this.periodName !== name) {
+ this.periodName = name
+ const data = this.generateData(this.periodName, this.chartOptions.series)
+ this.chartOptions.series = data.series
+ this.chartOptions.xAxis.categories = data.categories
+ }
+ },
+
+ formatAmount (amount) {
+ const fixed = this.$store.state.currencies.base === 'RUB' ? 0 : 2
+ return Number(`${amount.toFixed(fixed)}`).toLocaleString('ru-RU')
+ },
+
+ generateData (periodName, oldSeries) {
+ const trns = this.$store.state.trns.items
+ // const allTrnsIds = Object.keys(trns)
+
+ // diff periods from oldest trn and today
+ const oldestTrnDate = this.$day(trns[this.$store.getters['trns/firstCreatedTrnId']].date).endOf(periodName)
+ let periodsToShow = this.$day().endOf(periodName).diff(oldestTrnDate, periodName) + 1
+ periodsToShow = this.$store.state.chart.periods[periodName].showedPeriods >= periodsToShow ? periodsToShow : this.$store.state.chart.periods[periodName].showedPeriods
+ // get balance for first period
+ // const dateStart = this.$day().endOf(periodName).subtract(periodsToShow, periodName).valueOf()
+ // const trnsIdsBeforeDate = allTrnsIds.filter(id => trns[id].date < dateStart)
+ // const totalStart = this.$store.getters['trns/getTotalOfTrnsIds'](trnsIdsBeforeDate, true)
+
+ const categories = []
+ const incomesData = []
+ const expensesData = []
+ const totalData = []
+
+ for (let index = 0; index < periodsToShow; index++) {
+ // count balance
+ // const balanceDateStart = this.$day().endOf(periodName).subtract(index, periodName).valueOf()
+ // const balanceTrnsIds = allTrnsIds.filter(id => trns[id].date > dateStart && trns[id].date < balanceDateStart)
+ // const balanceTotal = this.$store.getters['trns/getTotalOfTrnsIds'](balanceTrnsIds, true)
+
+ // count total period
+ const periodDate = this.$day().endOf(periodName).subtract(index, periodName).valueOf()
+ const trnsIds = this.$store.getters['trns/getTrns']({ date: periodDate, periodName, categoryId: this.categoryId })
+ const periodTotal = this.$store.getters['trns/getTotalOfTrnsIds'](trnsIds)
+
+ let format = 'MM'
+ if (periodName === 'day') { format = 'D.MM' }
+ if (periodName === 'week') { format = 'D MMM' }
+ if (periodName === 'month') { format = 'MMM' }
+ if (periodName === 'year') { format = 'YYYY' }
+ const name = this.$day().startOf(periodName).subtract(index, periodName).format(format)
+
+ // return
+ incomesData.unshift({
+ date: periodDate,
+ y: Number(`${periodTotal.incomes.toFixed()}`)
+ })
+ expensesData.unshift({
+ date: periodDate,
+ y: Number(`${periodTotal.expenses.toFixed()}`)
+ })
+ // totalData.unshift({
+ // date: periodDate,
+ // y: Number(`${(totalStart.total + balanceTotal.total).toFixed()}`)
+ // })
+ totalData.unshift({
+ date: periodDate,
+ y: Number(`${(periodTotal.total).toFixed()}`)
+ })
+ categories.unshift(name)
+ }
+
+ let periods = 0
+ let periodsTotalIncomes = 0
+ for (const iterator of incomesData) {
+ if (iterator.y !== 0) {
+ periods = periods + 1
+ periodsTotalIncomes = periodsTotalIncomes + iterator.y
+ }
+ }
+ let periodsExpenses = 0
+ let periodsTotalExpenses = 0
+ for (const iterator of expensesData) {
+ if (iterator.y !== 0) {
+ periodsExpenses = periodsExpenses + 1
+ periodsTotalExpenses = periodsTotalExpenses + iterator.y
+ }
+ }
+
+ return {
+ series: [{
+ // zIndex: 3,
+ visible: periodsTotalIncomes > 0 && this.type === 1,
+ type: 'bar',
+ name: this.$t('money.incomes'),
+ color: this.color,
+ borderWidth: 0,
+ data: incomesData,
+ animation: false,
+ marker: {
+ radius: 3,
+ fillColor: 'var(--c-bg-4)',
+ lineWidth: 2,
+ lineColor: this.color,
+ symbol: 'circle'
+ },
+ dataLabels: {
+ enabled: true,
+ allowOverlap: false,
+ shadow: false,
+ color: 'var(--c-font-3)',
+ backgroundColor: 'var(--c-bg-15)',
+ align: 'center',
+ borderRadius: 3,
+ padding: 3,
+ y: -8,
+ style: {
+ textOutline: 'var(--c-bg-1)',
+ color: 'var(--c-bg-7)',
+ fontSize: '10px',
+ fontFamily: 'var(--font-secondary)',
+ fontWeight: 400,
+ textTransform: 'uppercase'
+ }
+ }
+ }, {
+ // zIndex: 2,
+ visible: periodsTotalExpenses > 0 && this.type === 0,
+ type: 'bar',
+ name: this.$t('money.expenses'),
+ color: this.color,
+ borderWidth: 0,
+ data: expensesData,
+ animation: false,
+ marker: {
+ radius: 3,
+ fillColor: 'var(--c-bg-4)',
+ lineWidth: 2,
+ lineColor: this.color,
+ symbol: 'circle'
+ },
+ dataLabels: {
+ enabled: true,
+ allowOverlap: false,
+ shadow: false,
+ color: 'var(--c-font-3)',
+ borderColor: 'red',
+ align: 'center',
+ backgroundColor: 'var(--c-bg-15)',
+ borderRadius: 3,
+ padding: 3,
+ y: -8,
+ style: {
+ textOutline: 'var(--c-bg-1)',
+ fontSize: '10px',
+ fontFamily: 'var(--font-secondary)',
+ fontWeight: 400,
+ textTransform: 'uppercase'
+ }
+ }
+ }],
+ categories,
+ averageIncomes: periodsTotalIncomes / periods,
+ averageExpenses: periodsTotalExpenses / periodsExpenses
+ }
+ }
+ }
+}
+</script>
+
+<template lang="pug">
+.chart
+ Chart(:options="chartOptions")
+</template>
+
+<style lang="stylus" scoped>
+@import "~assets/stylus/variables/animations"
+@import "~assets/stylus/variables/margins"
+@import "~assets/stylus/variables/fonts"
+@import "~assets/stylus/variables/media"
+
+$background = var(--c-bg-4)
+$border = var(--c-bg-1)
+
+.chart
+ z-index 3
+ position relative
+</style>
diff --git a/components/stat/StatChartDonut4.vue b/components/stat/StatChartDonut4.vue
new file mode 100644
index 00000000..7bacf089
--- /dev/null
+++ b/components/stat/StatChartDonut4.vue
@@ -0,0 +1,336 @@
+<script>
+import { Chart } from 'highcharts-vue'
+import chartOptions from '~/components/stat/chartOptions'
+
+export default {
+ name: 'StatChartDonut2',
+
+ components: {
+ Chart
+ },
+
+ props: {
+ isShowIncomes: {
+ type: Boolean,
+ default: true
+ },
+ isShowExpenses: {
+ type: Boolean,
+ default: true
+ }
+ },
+
+ data () {
+ const vm = this
+ return {
+ average: 0,
+ date: this.$day().valueOf(),
+ periodName: 'month',
+ visiblePeriodMenu: false,
+ dateStart: null,
+ dateEnd: null,
+ chartOptions: {
+ ...chartOptions,
+ tooltip: false,
+ chart: {
+ events: {
+ click (e) {
+ const value = this.series[0].searchPoint(e, true) || this.series[1].searchPoint(e, true)
+ vm.$store.dispatch('filter/setDate', parseInt(value.date))
+ }
+ }
+ }
+ }
+ }
+ },
+
+ computed: {
+ activeTab () {
+ return this.$store.state.dashboard.activeTab === 'balance'
+ }
+ },
+
+ watch: {
+ activeTab (isShow) {
+ if (isShow) {
+ // this.chartOptions.chart.redraw()
+ }
+ }
+ },
+
+ mounted () {
+ const data = this.generateData(this.$store.state.filter.period)
+ const handlePerioSelect = date => this.$store.dispatch('filter/setDate', parseInt(date))
+ this.chartOptions.series = data.series
+ this.chartOptions.plotOptions.series = {
+ cursor: 'pointer',
+ point: {
+ events: {
+ click () {
+ handlePerioSelect(this.date)
+ }
+ }
+ }
+ }
+
+ this.chartOptions = {
+ ...this.chartOptions,
+ xAxis: {
+ categories: data.categories
+ // plotLines: [{
+ // color: 'var(--c-bg-9)',
+ // dashStyle: 'solid', // Style of the plot line. Default to solid
+ // value: 2, // Value of where the line will appear
+ // width: 6, // Width of the line
+ // zIndex: 1
+ // }]
+ },
+
+ yAxis: {
+ plotLines: [{
+ opacity: 0.3,
+ color: 'var(--c-expenses-opacity)',
+ value: data.averageExpenses, // Insert your average here
+ width: '1',
+ zIndex: 1
+ }, {
+ opacity: 0.3,
+ color: 'var(--c-incomes-opacity)',
+ value: data.averageIncomes, // Insert your average here
+ width: '1',
+ zIndex: 1
+ }]
+ },
+
+ chart: {
+ tooltip: false,
+ backgroundColor: 'transparent',
+ with: '100%',
+ height: '200',
+ spacing: [5, 0, 0, 0],
+ type: 'column',
+ zoomType: 'x',
+ panning: true,
+ panKey: 'shift'
+ }
+ }
+ },
+
+ methods: {
+ changePeriod (name) {
+ if (this.periodName !== name) {
+ this.periodName = name
+ const data = this.generateData(this.periodName, this.chartOptions.series)
+ this.chartOptions.series = data.series
+ this.chartOptions.xAxis.categories = data.categories
+ }
+ },
+
+ formatAmount (amount) {
+ const fixed = this.$store.state.currencies.base === 'RUB' ? 0 : 2
+ return Number(`${amount.toFixed(fixed)}`).toLocaleString('ru-RU')
+ },
+
+ generateData (periodName, oldSeries) {
+ const trns = this.$store.state.trns.items
+ const categoriesItems = this.$store.state.categories.items
+ // const allTrnsIds = Object.keys(trns)
+
+ // diff periods from oldest trn and today
+ const oldestTrnDate = this.$day(trns[this.$store.getters['trns/firstCreatedTrnId']].date).endOf(periodName)
+ let periodsToShow = this.$day().endOf(periodName).diff(oldestTrnDate, periodName) + 1
+ periodsToShow = this.$store.state.chart.periods[periodName].showedPeriods >= periodsToShow ? periodsToShow : this.$store.state.chart.periods[periodName].showedPeriods
+
+ // get balance for first period
+ // const dateStart = this.$day().endOf(periodName).subtract(periodsToShow, periodName).valueOf()
+ // const trnsIdsBeforeDate = allTrnsIds.filter(id => trns[id].date < dateStart)
+ // const totalStart = this.$store.getters['trns/getTotalOfTrnsIds'](trnsIdsBeforeDate, true)
+
+ const categories = []
+ const incomesData = []
+ const expensesData = []
+ const totalData = []
+
+ const series = []
+
+ for (let index = 0; index < periodsToShow; index++) {
+ // count balance
+ // const balanceDateStart = this.$day().endOf(periodName).subtract(index, periodName).valueOf()
+ // const balanceTrnsIds = allTrnsIds.filter(id => trns[id].date > dateStart && trns[id].date < balanceDateStart)
+ // const balanceTotal = this.$store.getters['trns/getTotalOfTrnsIds'](balanceTrnsIds, true)
+
+ // count total period
+ const periodDate = this.$day().endOf(periodName).subtract(index, periodName).valueOf()
+ const trnsIds = this.$store.getters['trns/getTrns']({ date: periodDate, periodName })
+ const periodTotal = this.$store.getters['trns/getTotalOfTrnsIds'](trnsIds)
+
+ const expensesTrnsIds = trnsIds.filter(trnId => trns[trnId].type === 0)
+ const cat = this.$store.getters['stat/getCategoriesIdsWithTrnsIds']({ trnsIds: expensesTrnsIds })
+
+ for (const catId in cat) {
+ console.log(catId)
+ // // return
+ // series.unshift({
+ // name: 'h',
+ // data: {
+ // date: periodDate,
+ // y: Number(`${periodTotal.incomes.toFixed()}`)
+ // }
+ // })
+ // series.unshift({
+ // name: 'h2',
+ // data: {
+ // date: periodDate,
+ // y: Number(`${periodTotal.expenses.toFixed()}`)
+ // }
+ // })
+ // series.unshift({
+ // name: 'h3',
+ // data: {
+ // date: periodDate,
+ // y: Number(`${(periodTotal.total).toFixed()}`)
+ // }
+ // })
+
+ }
+
+ 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' }
+ const name = this.$day(periodDate).format(format)
+
+ categories.unshift(name)
+ }
+
+ return {
+ series,
+ // series: [{
+ // zIndex: 3,
+ // visible: periodsTotalIncomes > 0 && this.isShowIncomes,
+ // type: 'line',
+ // name: this.$t('money.incomes'),
+ // color: 'var(--c-incomes-1)',
+ // data: incomesData,
+ // marker: {
+ // radius: 3,
+ // fillColor: 'var(--c-bg-4)',
+ // lineWidth: 2,
+ // lineColor: 'var(--c-incomes-1)',
+ // symbol: 'circle'
+ // },
+
+ // dataLabels: {
+ // enabled: true,
+ // allowOverlap: false,
+ // shadow: false,
+ // color: 'var(--c-font-3)',
+ // backgroundColor: 'var(--c-bg-15)',
+ // align: 'center',
+ // borderRadius: 3,
+ // padding: 3,
+ // y: -8,
+ // style: {
+ // textOutline: 'var(--c-bg-1)',
+ // color: 'var(--c-bg-7)',
+ // fontSize: '10px',
+ // fontFamily: 'var(--font-secondary)',
+ // fontWeight: 400,
+ // textTransform: 'uppercase'
+ // }
+ // }
+ // }, {
+ // zIndex: 2,
+ // visible: periodsTotalExpenses > 0 && this.isShowExpenses,
+ // type: 'line',
+ // name: this.$t('money.expenses'),
+ // color: 'var(--c-expenses-1)',
+ // data: expensesData,
+ // marker: {
+ // radius: 3,
+ // fillColor: 'var(--c-bg-4)',
+ // lineWidth: 2,
+ // lineColor: 'var(--c-expenses-1)',
+ // symbol: 'circle'
+ // },
+ // dataLabels: {
+ // enabled: true,
+ // allowOverlap: false,
+ // shadow: false,
+ // color: 'var(--c-font-3)',
+ // backgroundColor: 'var(--c-bg-15)',
+ // align: 'center',
+ // borderRadius: 3,
+ // padding: 3,
+ // y: -8,
+ // style: {
+ // textOutline: 'var(--c-bg-1)',
+ // color: 'var(--c-bg-7)',
+ // fontSize: '10px',
+ // fontFamily: 'var(--font-secondary)',
+ // fontWeight: 400,
+ // textTransform: 'uppercase'
+ // }
+ // }
+ // }, {
+ // zIndex: 1,
+ // visible: false,
+ // type: 'areaspline',
+ // name: this.$t('money.total'),
+ // color: '#c1c1c1',
+ // data: totalData,
+ // marker: {
+ // radius: 3,
+ // fillColor: 'var(--c-bg-4)',
+ // lineWidth: 2,
+ // lineColor: '#c1c1c1',
+ // symbol: 'circle'
+ // },
+ // dataLabels: {
+ // enabled: true,
+ // allowOverlap: false,
+ // shadow: false,
+ // color: 'var(--c-font-3)',
+ // backgroundColor: 'var(--c-bg-15)',
+ // align: 'center',
+ // borderRadius: 3,
+ // padding: 3,
+ // y: -8,
+ // style: {
+ // textOutline: 'var(--c-bg-1)',
+ // color: 'var(--c-bg-7)',
+ // fontSize: '10px',
+ // fontFamily: 'var(--font-secondary)',
+ // fontWeight: 400,
+ // textTransform: 'uppercase'
+ // }
+ // }
+ // }],
+ categories,
+ averageIncomes: periodsTotalIncomes / periods,
+ averageExpenses: periodsTotalExpenses / periodsExpenses
+ }
+ }
+ }
+}
+</script>
+
+<template lang="pug">
+.chart
+ Chart(:options="chartOptions")
+</template>
+
+<style lang="stylus" scoped>
+@import "~assets/stylus/variables/animations"
+@import "~assets/stylus/variables/margins"
+@import "~assets/stylus/variables/fonts"
+@import "~assets/stylus/variables/media"
+
+$background = var(--c-bg-4)
+$border = var(--c-bg-1)
+
+.chart
+ z-index 3
+ position relative
+</style>
diff --git a/components/stat/StatChartDonut5.vue b/components/stat/StatChartDonut5.vue
new file mode 100644
index 00000000..eb8cedcf
--- /dev/null
+++ b/components/stat/StatChartDonut5.vue
@@ -0,0 +1,332 @@
+<script>
+import { Chart } from 'highcharts-vue'
+import chartOptions from '~/components/stat/chartOptions'
+
+export default {
+ name: 'StatChartDonut5',
+
+ components: {
+ Chart
+ },
+
+ props: {
+ categoryId: {
+ type: String,
+ required: true
+ },
+ color: {
+ type: String,
+ required: true
+ },
+ type: {
+ type: Number,
+ default: 3
+ },
+ averageIncomes: {
+ type: Number,
+ default: 0
+ },
+ averageExpenses: {
+ type: Number,
+ default: 0
+ }
+ },
+
+ data () {
+ const vm = this
+ return {
+ date: this.$day().valueOf(),
+ periodName: 'month',
+ visiblePeriodMenu: false,
+ dateStart: null,
+ dateEnd: null,
+ chartOptions: {
+ ...chartOptions,
+ legend: false,
+ tooltip: false,
+ chart: {
+ events: {
+ click (e) {
+ // const value = this.series[0].searchPoint(e, true) || this.series[1].searchPoint(e, true) || this.series[2].searchPoint(e, true)
+ // vm.$store.dispatch('filter/setDate', parseInt(value.date))
+ }
+ }
+ }
+ }
+ }
+ },
+
+ computed: {
+ activeTab () {
+ return this.$store.state.dashboard.activeTab === 'balance'
+ }
+ },
+
+ watch: {
+ activeTab (isShow) {
+ if (isShow) {
+ // this.chartOptions.chart.redraw()
+ }
+ }
+ },
+
+ mounted () {
+ const data = this.generateData(this.$store.state.filter.period)
+ const handlePerioSelect = date => this.$store.dispatch('filter/setDate', parseInt(date))
+ this.chartOptions.series = data.series
+ this.chartOptions.plotOptions.series = {
+ cursor: 'pointer',
+ point: {
+ events: {
+ click () {
+ // handlePerioSelect(this.date)
+ }
+ }
+ }
+ }
+
+ this.chartOptions = {
+ ...this.chartOptions,
+ xAxis: {
+ categories: data.categories,
+ labels: false,
+ // labels: {
+ // style: {
+ // textOutline: 'var(--c-bg-1)',
+ // fontSize: '8px',
+ // fontFamily: 'var(--font-secondary)',
+ // fontWeight: 400,
+ // textTransform: 'uppercase'
+ // }
+ // }
+
+ // plotLines: [{
+ // color: 'var(--c-bg-9)',
+ // dashStyle: 'solid', // Style of the plot line. Default to solid
+ // value: 2, // Value of where the line will appear
+ // width: 6, // Width of the line
+ // zIndex: 1
+ // }]
+ },
+
+ yAxis: {
+ labels: false,
+ plotLines: [{
+ opacity: 0.3,
+ color: 'var(--c-expenses-opacity)',
+ value: this.averageExpenses, // Insert your average here
+ width: '1',
+ zIndex: 1
+ }, {
+ opacity: 0.3,
+ color: 'var(--c-incomes-opacity)',
+ value: this.averageIncomes, // Insert your average here
+ width: '1',
+ zIndex: 1
+ }]
+ },
+
+ chart: {
+ tooltip: false,
+ legend: false,
+ backgroundColor: 'transparent',
+ with: '100%',
+ height: '36',
+ spacing: [0, 0, 5, 5],
+ type: 'column',
+ zoomType: 'x',
+ panning: true,
+ panKey: 'shift'
+ }
+ }
+ },
+
+ methods: {
+ changePeriod (name) {
+ if (this.periodName !== name) {
+ this.periodName = name
+ const data = this.generateData(this.periodName, this.chartOptions.series)
+ this.chartOptions.series = data.series
+ this.chartOptions.xAxis.categories = data.categories
+ }
+ },
+
+ formatAmount (amount) {
+ const fixed = this.$store.state.currencies.base === 'RUB' ? 0 : 2
+ return Number(`${amount.toFixed(fixed)}`).toLocaleString('ru-RU')
+ },
+
+ generateData (periodName, oldSeries) {
+ const trns = this.$store.state.trns.items
+ // const allTrnsIds = Object.keys(trns)
+
+ // diff periods from oldest trn and today
+ const oldestTrnDate = this.$day(trns[this.$store.getters['trns/firstCreatedTrnId']].date).endOf(periodName)
+ let periodsToShow = this.$day().endOf(periodName).diff(oldestTrnDate, periodName) + 1
+ periodsToShow = this.$store.state.chart.periods[periodName].showedPeriods >= periodsToShow ? periodsToShow : this.$store.state.chart.periods[periodName].showedPeriods
+ // get balance for first period
+ // const dateStart = this.$day().endOf(periodName).subtract(periodsToShow, periodName).valueOf()
+ // const trnsIdsBeforeDate = allTrnsIds.filter(id => trns[id].date < dateStart)
+ // const totalStart = this.$store.getters['trns/getTotalOfTrnsIds'](trnsIdsBeforeDate, true)
+
+ const categories = []
+ const incomesData = []
+ const expensesData = []
+ const totalData = []
+
+ for (let index = 0; index < 4; index++) {
+ // count balance
+ // const balanceDateStart = this.$day().endOf(periodName).subtract(index, periodName).valueOf()
+ // const balanceTrnsIds = allTrnsIds.filter(id => trns[id].date > dateStart && trns[id].date < balanceDateStart)
+ // const balanceTotal = this.$store.getters['trns/getTotalOfTrnsIds'](balanceTrnsIds, true)
+
+ // count total period
+ const periodDate = this.$day().endOf(periodName).subtract(index, periodName).valueOf()
+ const trnsIds = this.$store.getters['trns/getTrns']({ date: periodDate, periodName, categoryId: this.categoryId })
+ const periodTotal = this.$store.getters['trns/getTotalOfTrnsIds'](trnsIds)
+
+ let format = 'MM'
+ if (periodName === 'day') { format = 'D.MM' }
+ if (periodName === 'week') { format = 'D MMM' }
+ if (periodName === 'month') { format = 'MMM' }
+ if (periodName === 'year') { format = 'YYYY' }
+ const name = this.$day().startOf(periodName).subtract(index, periodName).format(format)
+
+ // return
+ incomesData.unshift({
+ date: periodDate,
+ y: Number(`${periodTotal.incomes.toFixed()}`)
+ })
+ expensesData.unshift({
+ date: periodDate,
+ y: Number(`${periodTotal.expenses.toFixed()}`)
+ })
+ // totalData.unshift({
+ // date: periodDate,
+ // y: Number(`${(totalStart.total + balanceTotal.total).toFixed()}`)
+ // })
+ totalData.unshift({
+ date: periodDate,
+ y: Number(`${(periodTotal.total).toFixed()}`)
+ })
+ categories.unshift(name)
+ }
+
+ let periods = 0
+ let periodsTotalIncomes = 0
+ for (const iterator of incomesData) {
+ if (iterator.y !== 0) {
+ periods = periods + 1
+ periodsTotalIncomes = periodsTotalIncomes + iterator.y
+ }
+ }
+ let periodsExpenses = 0
+ let periodsTotalExpenses = 0
+ for (const iterator of expensesData) {
+ if (iterator.y !== 0) {
+ periodsExpenses = periodsExpenses + 1
+ periodsTotalExpenses = periodsTotalExpenses + iterator.y
+ }
+ }
+
+ return {
+ series: [{
+ // zIndex: 3,
+ visible: periodsTotalIncomes > 0 && this.type === 1,
+ type: 'bar',
+ name: this.$t('money.incomes'),
+ color: this.color,
+ borderWidth: 0,
+ data: incomesData,
+ groupPadding: 0,
+ pointPadding: 0.2,
+ marker: {
+ radius: 2,
+ fillColor: 'var(--c-bg-4)',
+ lineWidth: 2,
+ lineColor: this.color,
+ symbol: 'circle'
+ },
+ // dataLabels: {
+ // enabled: true,
+ // allowOverlap: false,
+ // shadow: false,
+ // color: 'var(--c-font-3)',
+ // backgroundColor: 'var(--c-bg-15)',
+ // align: 'center',
+ // borderRadius: 3,
+ // padding: 3,
+ // y: -8,
+ // style: {
+ // textOutline: 'var(--c-bg-1)',
+ // color: 'var(--c-bg-7)',
+ // fontSize: '10px',
+ // fontFamily: 'var(--font-secondary)',
+ // fontWeight: 400,
+ // textTransform: 'uppercase'
+ // }
+ // }
+ }, {
+ // zIndex: 2,
+ visible: periodsTotalExpenses > 0 && this.type === 0,
+ type: 'bar',
+ name: this.$t('money.expenses'),
+ color: this.color,
+ data: expensesData,
+ borderWidth: 0,
+ groupPadding: 0,
+ pointPadding: 0.2,
+ marker: {
+ radius: 2,
+ fillColor: 'var(--c-bg-4)',
+ lineWidth: 2,
+ lineColor: this.color,
+ symbol: 'circle'
+ },
+ // dataLabels: {
+ // enabled: true,
+ // allowOverlap: false,
+ // shadow: false,
+ // color: 'var(--c-font-3)',
+ // borderColor: 'red',
+ // align: 'center',
+ // backgroundColor: 'var(--c-bg-15)',
+ // borderRadius: 3,
+ // padding: 3,
+ // y: -8,
+ // style: {
+ // textOutline: 'var(--c-bg-1)',
+ // fontSize: '10px',
+ // fontFamily: 'var(--font-secondary)',
+ // fontWeight: 400,
+ // textTransform: 'uppercase'
+ // }
+ // }
+ }],
+ categories,
+ // averageIncomes: periodsTotalIncomes / periods,
+ // averageExpenses: periodsTotalExpenses / periodsExpenses
+ }
+ }
+ }
+}
+</script>
+
+<template lang="pug">
+.chart
+ Chart(:options="chartOptions")
+</template>
+
+<style lang="stylus" scoped>
+@import "~assets/stylus/variables/animations"
+@import "~assets/stylus/variables/margins"
+@import "~assets/stylus/variables/fonts"
+@import "~assets/stylus/variables/media"
+
+$background = var(--c-bg-4)
+$border = var(--c-bg-1)
+
+.chart
+ z-index 3
+ position relative
+</style>
diff --git a/components/stat/StatChartsLine.vue b/components/stat/StatChartsLine.vue
index 5aa55525..5a49edf7 100644
--- a/components/stat/StatChartsLine.vue
+++ b/components/stat/StatChartsLine.vue
@@ -1,6 +1,4 @@
<script>
-import dayjs from 'dayjs'
-
export default {
name: 'StatChartsLine2',
@@ -12,7 +10,7 @@ export default {
return this.$store.state.filter.period
},
activePeriodNumber () {
- const statFromDate = dayjs().startOf(this.$store.state.filter.period)
+ const statFromDate = this.$day().startOf(this.$store.state.filter.period)
return statFromDate.diff(this.$store.state.filter.date, this.$store.state.filter.period) + 1
},
periodsValues () {
@@ -24,8 +22,8 @@ export default {
const values = {}
for (let period = 0; period < diff; period++) {
- const periodStartDate = dayjs().subtract(period, filterPeriod).startOf(filterPeriod)
- const periodEndDate = dayjs().subtract(period, filterPeriod).endOf(filterPeriod)
+ const periodStartDate = this.$day().subtract(period, filterPeriod).startOf(filterPeriod)
+ const periodEndDate = this.$day().subtract(period, filterPeriod).endOf(filterPeriod)
const ids = trnsIds
.filter((trnId) => {
return trns[trnId].date >= periodStartDate &&
@@ -48,8 +46,8 @@ export default {
const groupedValues = {}
for (const date in periodsValues) {
- const periodStartDateValue = dayjs(parseInt(date)).startOf(groupedBy).valueOf()
- const periodEndDateValue = dayjs(parseInt(date)).endOf(groupedBy).valueOf()
+ const periodStartDateValue = this.$day(parseInt(date)).startOf(groupedBy).valueOf()
+ const periodEndDateValue = this.$day(parseInt(date)).endOf(groupedBy).valueOf()
if (date >= periodStartDateValue && date <= periodEndDateValue) {
groupedValues[periodStartDateValue]
@@ -106,9 +104,9 @@ export default {
// periods in current group
const getPeriodsInCurrentGroup = () => {
let currentGroupPeriods
- if (filterPeriod === 'day') { currentGroupPeriods = parseInt(dayjs().format('D')) }
- if (filterPeriod === 'week') { currentGroupPeriods = dayjs().week() - dayjs().startOf('month').week() + 1 }
- if (filterPeriod === 'month') { currentGroupPeriods = parseInt(dayjs().format('MM')) }
+ if (filterPeriod === 'day') { currentGroupPeriods = parseInt(this.$day().format('D')) }
+ if (filterPeriod === 'week') { currentGroupPeriods = this.$day().week() - this.$day().startOf('month').week() + 1 }
+ if (filterPeriod === 'month') { currentGroupPeriods = parseInt(this.$day().format('MM')) }
return currentGroupPeriods
}
@@ -122,8 +120,8 @@ export default {
}
const getPeriodsInPrevGroup2 = (hey) => {
- const groupDateStart = dayjs().subtract(hey, groupedBy).startOf(groupedBy)
- const groupDateEnd = dayjs().subtract(hey, groupedBy).endOf(groupedBy)
+ const groupDateStart = this.$day().subtract(hey, groupedBy).startOf(groupedBy)
+ const groupDateEnd = this.$day().subtract(hey, groupedBy).endOf(groupedBy)
let periodsInGroup = 0
filterPeriod === 'week'
@@ -163,7 +161,7 @@ export default {
format = 'YYYY'
break
}
- return dayjs(dateValueOf).format(format)
+ return this.$day(dateValueOf).format(format)
}
}
}
diff --git a/components/stat/StatItem.vue b/components/stat/StatItem.vue
index d111570a..e8615c2a 100644
--- a/components/stat/StatItem.vue
+++ b/components/stat/StatItem.vue
@@ -1,6 +1,6 @@
<script>
export default {
- name: 'StatItem2',
+ name: 'StatItem',
props: {
category: {
@@ -70,68 +70,66 @@ export default {
<template lang="pug">
.statItem(
- @click="toogleShowInside(categoryId)"
:class="{ _active: showInside }"
+ @click="toogleShowInside(categoryId)"
)
-
.statItem__content
.statItem__graph: .statItem__graph__in(:style="styles")
.statItem__icon(@click.stop="() => $store.dispatch('filter/handleSetFilterCategory', categoryId)")
Icon(
:background="category.color"
:icon="category.icon"
- :round="true"
)
.statItem__name {{ category.name }}
.statItem__amount
Amount(
:currency="currency"
- :value="total")
+ :value="total"
+ )
template(v-if="showInside")
.statItem__inside(@click.stop="")
template(v-if="showChildCategories")
- StatItemChildCats(:categoryId="categoryId", :type="type")
+ StatItemChildCats(
+ :categoryId="categoryId"
+ :type="type"
+ )
template(v-else)
- TrnsList(
- ui="stat"
- :incomes="type === 1"
- :expenses="type === 0"
- :categoryId="categoryId")
+ .statItem__trns
+ TrnsList(
+ ui="stat"
+ :incomes="type === 1"
+ :expenses="type === 0"
+ :categoryId="categoryId"
+ )
</template>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables"
+@import '~assets/stylus/variables'
.statItem
- overflow hidden
+ // overflow hidden
cursor pointer
position relative
- // margin (- 10px) 0
- margin-bottom 10px
- padding 8px 0
+ padding $m5 0
border 1px solid transparent
border-radius $m5
&:hover
@media $media-laptop
z-index 2
+ margin 0 (- $m5)
+ padding $m5 $m5
background var(--c-bg-1)
border 1px solid var(--c-bg-5)
- /.light-mode &
- background var(--c-bg-3)
-
&._active
+ margin $m6 (- $m6)
padding 0
- margin-bottom 30px
- background var(--c-bg-2)
- border 1px solid var(--c-bg-7)
-
- // &:first-child
- // margin-top (- 10px)
+ background var(--c-bg-3)
+ border 1px solid var(--c-bg-6)
&__content
display grid
@@ -140,20 +138,22 @@ export default {
grid-column-gap 20px
^[0]._active &
- padding 10px 10px
- background var(--c-bg-5)
- border-bottom 1px solid var(--c-bg-7)
+ margin 0 $m6
+ padding $m6 0
+ border-bottom 1px solid var(--c-bg-5)
+
+ &__inside
+ padding 0
- /.light-mode &
- background var(--c-bg-10)
- border-bottom 1px solid var(--c-bg-5)
+ &__trns
+ padding 0 $m6
&__graph
overflow hidden
grid-column 2 / -1
grid-row 2 / -1
align-self center
- margin-top 6px
+ margin-top $m3
background var(--c-bg-8)
border-radius 2px
@@ -165,7 +165,7 @@ export default {
overflow hidden
align-self center
color var(--c-font-4)
- font-size 16px
+ font-size 14px
white-space nowrap
text-overflow ellipsis
@@ -186,4 +186,10 @@ export default {
&__amount
align-self center
+
+ &__arrow
+ padding-top $m2
+ color var(--c-font-5)
+ grid-column 4 / 5
+ grid-row 1 / 2
</style>
diff --git a/components/stat/StatItemChildCatsItem.vue b/components/stat/StatItemChildCatsItem.vue
index 65a205d0..019aa384 100644
--- a/components/stat/StatItemChildCatsItem.vue
+++ b/components/stat/StatItemChildCatsItem.vue
@@ -48,50 +48,66 @@ export default {
<template lang="pug">
.statItemChild(
- @click="toogleShowInside(categoryId)"
:class="{ _active: isShowInside }"
+ @click="toogleShowInside(categoryId)"
)
.statItemChild__content
- .statItemChild__graph: .statItemChild__graph__in(:style="styles")
+ .statItemChild__graph
+ .statItemChild__graph__in(:style="styles")
- .statItemChild__icon(@click.stop="() => $store.dispatch('filter/handleSetFilterCategory', categoryId)")
+ .statItemChild__icon(
+ @click.stop="() => $store.dispatch('filter/handleSetFilterCategory', categoryId)"
+ )
Icon(
- :background="category.color"
+ :color="$store.state.ui.pc ? category.color : null"
+ :background="$store.state.ui.mobile ? category.color : null"
:icon="category.icon"
- :round="true")
+ )
.statItemChild__name {{ category.name }}
.statItemChild__amount
Amount(
:currency="$store.state.currencies.base"
- :value="total")
-
- .statItemChild__trns(@click.stop="" v-if="isShowInside")
+ :value="total"
+ :type="type"
+ :isColorize="false"
+ isShowPrefix
+ )
+
+ .statItemChild__trns(
+ v-if="isShowInside"
+ @click.stop=""
+ )
TrnsList(
- ui="stat"
:incomes="type === 1"
:expenses="type === 0"
- :categoryId="categoryId")
+ :categoryId="categoryId"
+ ui="stat"
+ )
</template>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables/margins"
-@import "~assets/stylus/variables/fonts"
-@import "~assets/stylus/variables/media"
-@import "~assets/stylus/variables/scroll"
+@import '~assets/stylus/variables'
.statItemChild
- border-bottom 1px solid var(--c-bg-5)
- &:last-child
- border 0
+
+ &._active
+ padding-bottom $m6
&__content
display grid
grid-template-columns minmax(10px, max-content) 1fr minmax(10px, max-content)
grid-template-rows repeat(2, minmax(10px, max-content))
grid-column-gap 20px
- padding 10px 10px
+ margin 0 0px
+ padding $m6 0
+
+ +media-tablet()
+ padding $m6 $m6
+
+ &__trns
+ padding 0 $m6 0 $m7
&__graph
overflow hidden
@@ -110,10 +126,14 @@ export default {
overflow hidden
align-self center
color var(--c-font-4)
- font-size 16px
+ font-size 14px
white-space nowrap
text-overflow ellipsis
+ ^[0]._active &
+ color var(--c-font-2)
+ font-weight 500
+
&__icon
display flex
justify-content center
@@ -123,4 +143,8 @@ export default {
&__amount
align-self center
+
+ &__trns
+ ^[0]._active &
+ padding-bottom $m6
</style>
diff --git a/components/stat/StatItemMobile.vue b/components/stat/StatItemMobile.vue
new file mode 100644
index 00000000..26a1b8a6
--- /dev/null
+++ b/components/stat/StatItemMobile.vue
@@ -0,0 +1,278 @@
+<script>
+export default {
+ name: 'StatItemMobile',
+
+ props: {
+ category: {
+ type: Object,
+ required: true
+ },
+ categoryId: {
+ type: String,
+ required: true
+ },
+ currency: {
+ type: String,
+ required: true
+ },
+ total: {
+ type: Number,
+ required: true
+ },
+ biggest: {
+ type: Number,
+ required: true
+ },
+ type: {
+ type: Number,
+ required: true
+ }
+ },
+
+ computed: {
+ trnsIds () {
+ return this.$store.getters['trns/getTrns']({
+ categoryId: this.categoryId,
+ type: this.type
+ })
+ },
+
+ summary () {
+ return this.$store.getters['trns/getTotalOfTrnsIds'](this.trnsIds)
+ },
+
+ showChildCategories () {
+ const childCategoriesIds = this.$store.getters['categories/getChildCategoriesIds'](this.categoryId)
+
+ const childCatsIdsWithTrns = []
+ for (const childCategoryId of childCategoriesIds) {
+ const trnsIds = this.$store.getters['trns/getTrnsIdsByFilter']({
+ categoryId: childCategoryId,
+ type: this.type
+ })
+ if (trnsIds.length > 0) { childCatsIdsWithTrns.push(childCategoryId) }
+ }
+
+ if (childCatsIdsWithTrns.length > 0) { return true }
+ return false
+ },
+
+ styles () {
+ return {
+ width: `${Math.abs(this.total) / Math.abs(this.biggest) * 100}%`,
+ background: this.category.color
+ }
+ },
+
+ filterPeriod () {
+ return this.$store.state.filter.period
+ },
+
+ statCurrentPeriod () {
+ return this.$store.getters['stat/statCurrentPeriod']
+ }
+ }
+}
+</script>
+
+<template lang="pug">
+.statItem(
+ @click="$store.commit('stat/setCategoryModal', { id: categoryId, type })"
+)
+ .statItem__content
+ .statItem__graph: .statItem__graph__in(:style="styles")
+ .statItem__icon(@click.stop="() => $store.dispatch('filter/handleSetFilterCategory', categoryId)")
+ Icon(
+ :background="category.color"
+ :icon="category.icon"
+ )
+
+ .statItem__name {{ category.name }}
+ .statItem__amount
+ Amount(
+ :currency="currency"
+ :value="total"
+ :type="type"
+ :isColorize="false"
+ isShowPrefix
+ )
+
+ //- Modal
+ //---------------------------------------------------------------------------
+ Portal(
+ v-if="$store.state.stat.categoryModal.id === categoryId && $store.state.stat.categoryModal.type === type"
+ to="modal"
+ )
+ ModalBottom(
+ center
+ @onClose="$store.commit('stat/setCategoryModal', { id: null, type: null })"
+ )
+ template(slot="header")
+ .categoryWrap
+ .categoryIcon
+ Icon(
+ :icon="category.icon"
+ :background="category.color || $store.state.ui.defaultBgColor"
+ :round="true"
+ :big="true"
+ )
+ .modalBottom__header__title {{ category.name }}
+
+ .statItem__inside(@click.stop="")
+ .statItem__chart
+ StatChartDonut3(
+ v-if="filterPeriod !== 'all'"
+ :categoryId="categoryId"
+ :color="category.color"
+ :type="type"
+ :key="filterPeriod + $store.state.chart.periods[filterPeriod].showedPeriods + this.$store.state.filter.categoryId + this.$store.state.filter.walletId"
+ )
+
+ .statItem__date
+ Date
+
+ .statItem__summary
+ Amount(
+ :currency="currency"
+ :value="total"
+ :type="type"
+ size="xl"
+ vertical="center"
+ :isColorize="false"
+ isShowPrefix
+ )
+
+ template(v-if="showChildCategories")
+ StatItemChildCats(
+ :categoryId="categoryId"
+ :type="type"
+ )
+
+ .statItem__trns
+ h2 {{ $t('trns.history') }}
+ TrnsList3(
+ :categoryId="categoryId"
+ :expenses="type === 0"
+ :incomes="type === 1"
+ :showCategory="showChildCategories"
+ :size="5"
+ ui="stat"
+ )
+</template>
+
+<style lang="stylus" scoped>
+@import '~assets/stylus/variables'
+
+.categoryWrap
+ flex-grow 1
+ display flex
+ align-items center
+ justify-content center
+ flex-flow column
+ margin-top -38px
+ margin-bottom -10px
+
+.categoryIcon
+ flex-grow 1
+ display flex
+ align-items center
+ justify-content center
+ padding-bottom 12px
+
+.statItem
+ overflow hidden
+ cursor pointer
+ position relative
+ padding $m5 0
+ border-bottom 1px solid transparent
+
+ &:first-child
+ padding-top 0
+
+ &:last-child
+ padding-bottom 0
+
+ &._active
+ margin-bottom $m9
+ border-bottom-color var(--c-bg-6)
+
+ &:active
+ z-index 2
+ background var(--c-bg-5)
+
+ &__content
+ display grid
+ grid-template-columns minmax(10px, max-content) 1fr minmax(10px, max-content)
+ grid-template-rows repeat(2, minmax(10px, max-content))
+ grid-column-gap 20px
+
+ &__inside
+ cursor default
+
+ &__trns
+ padding-top $m8
+
+ h2
+ padding-bottom $m6
+
+ &__date
+ display flex
+ justify-content center
+ padding-top $m7
+ padding-bottom $m5
+ color var(--c-font-4)
+ text-align center
+
+ &__summary
+ z-index 10
+ position sticky
+ top (- $m7)
+ padding 0
+ padding-bottom $m7
+ background var(--c-bg-4)
+
+ &__chart
+ height 180px
+ margin-bottom $m9
+ margin-left (- $m7)
+
+ &__graph
+ overflow hidden
+ grid-column 2 / -1
+ grid-row 2 / -1
+ align-self center
+ margin-top $m3
+ background var(--c-bg-8)
+ border-radius 2px
+
+ &__in
+ height 4px
+ min-width 2px
+
+ &__name
+ overflow hidden
+ align-self center
+ color var(--c-font-4)
+ font-size 14px
+ white-space nowrap
+ text-overflow ellipsis
+
+ ^[0]._active &
+ color var(--c-font-2)
+ font-weight 500
+
+ &__icon
+ width 32px
+ grid-column 1 / 2
+ grid-row 1 / -1
+
+ &:active
+ opacity .8
+
+ @media $media-laptop
+ &:hover
+ transform scale(1.3)
+
+ &__amount
+ align-self center
+</style>
diff --git a/components/stat/StatItemMobileExtra.vue b/components/stat/StatItemMobileExtra.vue
new file mode 100644
index 00000000..04bfdd0b
--- /dev/null
+++ b/components/stat/StatItemMobileExtra.vue
@@ -0,0 +1,297 @@
+<script>
+export default {
+ name: 'StatItemMobileExtra',
+
+ props: {
+ category: {
+ type: Object,
+ required: true
+ },
+ categoryId: {
+ type: String,
+ required: true
+ },
+ currency: {
+ type: String,
+ required: true
+ },
+ total: {
+ type: Number,
+ required: true
+ },
+ biggest: {
+ type: Number,
+ required: true
+ },
+ type: {
+ type: Number,
+ required: true
+ }
+ },
+
+ data () {
+ return {
+ showInside: false
+ }
+ },
+
+ computed: {
+ trnsIds () {
+ return this.$store.getters['trns/getTrns']({
+ categoryId: this.categoryId,
+ type: this.type
+ })
+ },
+
+ summary () {
+ return this.$store.getters['trns/getTotalOfTrnsIds'](this.trnsIds)
+ },
+
+ showChildCategories () {
+ const childCategoriesIds = this.$store.getters['categories/getChildCategoriesIds'](this.categoryId)
+
+ const childCatsIdsWithTrns = []
+ for (const childCategoryId of childCategoriesIds) {
+ const trnsIds = this.$store.getters['trns/getTrnsIdsByFilter']({
+ categoryId: childCategoryId,
+ type: this.type
+ })
+ if (trnsIds.length > 0) { childCatsIdsWithTrns.push(childCategoryId) }
+ }
+
+ if (childCatsIdsWithTrns.length > 0) { return true }
+ return false
+ },
+
+ styles () {
+ return {
+ width: `${Math.abs(this.total) / Math.abs(this.biggest) * 100}%`,
+ background: this.category.color
+ }
+ },
+
+ filterPeriod () {
+ return this.$store.state.filter.period
+ },
+
+ statCurrentPeriod () {
+ return this.$store.getters['stat/statCurrentPeriod']
+ }
+ },
+
+ methods: {
+ toogleShowInside (categoryId) {
+ this.showInside = !this.showInside
+ }
+ }
+}
+</script>
+
+<template lang="pug">
+.statItem(@click="toogleShowInside(categoryId)")
+ .statItem__content
+ .statItem__graph: .statItem__graph__in(:style="styles")
+ .statItem__icon(@click.stop="() => $store.dispatch('filter/handleSetFilterCategory', categoryId)")
+ Icon(
+ :background="category.color"
+ :icon="category.icon"
+ )
+
+ .statItem__name {{ category.name }}
+ .statItem__amount
+ Amount(
+ :currency="currency"
+ :value="total"
+ :type="type"
+ :isColorize="false"
+ isShowPrefix
+ )
+
+ .statItem__chart2
+ StatChartDonut5(
+ v-if="filterPeriod !== 'all'"
+ :categoryId="categoryId"
+ :color="category.color"
+ :type="type"
+ :key="filterPeriod + $store.state.chart.periods[filterPeriod].showedPeriods + this.$store.state.filter.categoryId + this.$store.state.filter.walletId"
+ )
+
+ Portal(
+ v-if="showInside"
+ to="modal"
+ )
+ ModalBottom(
+ center
+ @onClose="showInside = false"
+ )
+ template(slot="header")
+ .categoryWrap
+ .categoryIcon
+ Icon(
+ :icon="category.icon"
+ :background="category.color || $store.state.ui.defaultBgColor"
+ :round="true"
+ :big="true"
+ )
+ .modalBottom__header__title {{ category.name }}
+
+ .statItem__inside(@click.stop="")
+ //- pre {{ summary }}
+
+ .statItem__chart
+ StatChartDonut3(
+ v-if="filterPeriod !== 'all'"
+ :categoryId="categoryId"
+ :color="category.color"
+ :type="type"
+ :key="filterPeriod + $store.state.chart.periods[filterPeriod].showedPeriods + this.$store.state.filter.categoryId + this.$store.state.filter.walletId"
+ )
+
+ .statItem__date
+ Date
+
+ .statItem__summary
+ Amount(
+ :currency="currency"
+ :value="total"
+ :type="type"
+ size="xl"
+ vertical="center"
+ :isColorize="false"
+ isShowPrefix
+ )
+
+ template(v-if="showChildCategories")
+ StatItemChildCats(
+ :categoryId="categoryId"
+ :type="type"
+ )
+
+ template(v-else)
+ TrnsList(
+ ui="stat"
+ :incomes="type === 1"
+ :expenses="type === 0"
+ :categoryId="categoryId"
+ )
+</template>
+
+<style lang="stylus" scoped>
+@import '~assets/stylus/variables'
+
+.categoryWrap
+ flex-grow 1
+ display flex
+ align-items center
+ justify-content center
+ flex-flow column
+ margin-top -38px
+ margin-bottom -10px
+
+.categoryIcon
+ flex-grow 1
+ display flex
+ align-items center
+ justify-content center
+ padding-bottom 12px
+
+.statItem
+ // overflow hidden
+ cursor pointer
+ position relative
+ display grid
+ grid-template-columns 1fr 80px
+ // height 42px
+ padding $m5 0
+ border-bottom 1px solid transparent
+
+ &:first-child
+ padding-top 0
+
+ &:last-child
+ padding-bottom 0
+
+ &._active
+ margin-bottom $m9
+ border-bottom-color var(--c-bg-6)
+
+ &:active
+ z-index 2
+ // margin -1px (- $m6)
+ // padding $m5 $m5
+ background var(--c-bg-5)
+
+ &__chart2
+ // width 70px
+
+ &__content
+ display grid
+ grid-template-columns minmax(10px, max-content) 1fr minmax(10px, max-content)
+ grid-template-rows repeat(2, minmax(10px, max-content))
+ grid-column-gap 20px
+ padding-right $m7
+
+ &__inside
+ cursor default
+
+ &__date
+ display flex
+ justify-content center
+ padding-top $m7
+ padding-bottom $m5
+ color var(--c-font-4)
+ text-align center
+
+ &__summary
+ z-index 10
+ position sticky
+ top (- $m7)
+ padding 0
+ padding-bottom $m7
+ background var(--c-bg-4)
+
+ &__chart
+ height 180px
+ margin-bottom $m9
+ margin-left (- $m7)
+
+ &__graph
+ overflow hidden
+ grid-column 2 / -1
+ grid-row 2 / -1
+ align-self center
+ margin-top 10px
+ background var(--c-bg-8)
+ border-radius 2px
+
+ &__in
+ height 4px
+ min-width 2px
+
+ &__name
+ overflow hidden
+ align-self center
+ color var(--c-font-4)
+ font-size 14px
+ white-space nowrap
+ text-overflow ellipsis
+
+ ^[0]._active &
+ color var(--c-font-2)
+ font-weight 500
+
+ &__icon
+ width 32px
+ grid-column 1 / 2
+ grid-row 1 / -1
+
+ &:active
+ opacity .8
+
+ @media $media-laptop
+ &:hover
+ transform scale(1.3)
+
+ &__amount
+ align-self center
+</style>
diff --git a/components/stat/StatMobile.vue b/components/stat/StatMobile.vue
deleted file mode 100644
index 26de8c2f..00000000
--- a/components/stat/StatMobile.vue
+++ /dev/null
@@ -1,290 +0,0 @@
-<script>
-export default {
- name: 'StatMobile',
-
- data () {
- return {
- view: 'expenses'
- }
- },
-
- computed: {
- activeTabStat () {
- return this.$store.state.ui.stat.activeTab
- },
-
- statCurrentPeriod () {
- return this.$store.getters['stat/statCurrentPeriod']
- },
-
- statAverage () {
- return this.$store.getters['stat/statAverage']
- },
-
- periods () {
- return this.$store.state.chart.periods
- },
-
- filterCategory () {
- return this.$store.state.categories.items[this.$store.state.filter.categoryId]
- },
-
- filterCategoryParent () {
- return this.$store.state.categories.items[this.filterCategory.parentId]
- },
-
- filterWallet () {
- return this.$store.state.wallets.items[this.$store.state.filter.walletId]
- }
- },
-
- methods: {
- clearCategoryFilter () {
- const nextCategory = this.filterCategory.parentId !== 0 ? this.filterCategory.parentId : null
- this.$store.dispatch('filter/setFilterCategoryId', nextCategory)
- },
-
- clearParentCategoryFilter () {
- this.$store.dispatch('filter/setFilterCategoryId', null)
- },
-
- clearWalletFilter () {
- this.$store.dispatch('filter/setFilterWalletId', null)
- }
- }
-}
-</script>
-
-<template lang="pug">
-.stat
- //- Filter
- //---------------------------------------------------------------------------
- .stat__filter.swiper-no-swiping(v-if="$store.state.filter.categoryId || $store.state.filter.walletId")
- //- Wallet
- template(v-if="$store.state.filter.walletId")
- FilterItem(
- :color="filterWallet.color || $store.state.ui.defaultBgColor"
- :name="filterWallet.name"
- icon="mdi mdi-credit-card-multiple"
- @onClick="clearWalletFilter"
- )
-
- //- Category
- template(v-if="$store.state.filter.categoryId")
- //- Parent
- template(v-if="filterCategory.parentId !== 0")
- FilterItem(
- :color="filterCategoryParent.color || $store.state.ui.defaultBgColor"
- :icon="filterCategoryParent.icon"
- :name="filterCategoryParent.name"
- @onClick="clearParentCategoryFilter"
- )
- //- Child
- FilterItem(
- :color="filterCategory.color || $store.state.ui.defaultBgColor"
- :icon="filterCategory.icon"
- :name="filterCategory.name"
- @onClick="clearCategoryFilter"
- )
-
- //- Header
- //---------------------------------------------------------------------------
- .stat__header(:class="{ _withFilter: ($store.state.filter.categoryId || $store.state.filter.walletId) }")
- .statItemHeader(
- :class="{ _active: activeTabStat === 'incomes' }"
- @click="$store.dispatch('ui/setActiveTabStat', 'incomes')"
- )
- .statItemHeader__title {{ $t('money.incomes') }}
- //- .statItemHeader__amount
- //- Amount(
- //- :currency="$store.state.currencies.base"
- //- :type="1"
- //- :value="statCurrentPeriod.incomes.total"
- //- size="md"
- //- )
-
- .statItemHeader(
- :class="{ _active: activeTabStat === 'expenses' }"
- @click="$store.dispatch('ui/setActiveTabStat', 'expenses')"
- )
- .statItemHeader__title {{ $t('money.expenses') }}
- //- .statItemHeader__amount
- //- Amount(
- //- :currency="$store.state.currencies.base"
- //- :type="0"
- //- :value="statCurrentPeriod.expenses.total"
- //- size="md"
- //- )
-
- .statItemHeader(
- :class="{ _active: activeTabStat === 'history' }"
- @click="$store.dispatch('ui/setActiveTabStat', 'history')"
- )
- .statItemHeader__title {{ $t('trns.history') }}
- //- .statItemHeader__amount
- //- Amount(
- //- :currency="$store.state.currencies.base"
- //- :type="3"
- //- :value="statCurrentPeriod.incomes.total - statCurrentPeriod.expenses.total"
- //- size="md"
- //- )
-
- //- Content
- //---------------------------------------------------------------------------
- .stat__content
- //- Incomes
- //-------------------------------------------------------------------------
- .statGroup(v-show="activeTabStat === 'incomes'")
- EmptyData(
- v-if="$store.getters['trns/hasTrns'] && statCurrentPeriod.incomes.categoriesIds.length === 0"
- :text="$t('stat.empty')"
- )
-
- //- Categories charts
- .stat__charts(v-show="$store.state.ui.catsChart === 'visible'")
- PeriodCatsChart(type="incomes")
-
- //- Categories list
- .stat__cats(v-show="$store.state.ui.statItems === 'visible'")
- StatItem(
- v-for="categoryId in statCurrentPeriod.incomes.categoriesIds"
- :biggest="statCurrentPeriod.incomes.biggest"
- :category="$store.state.categories.items[categoryId]"
- :categoryId="categoryId"
- :currency="$store.state.currencies.base"
- :key="categoryId"
- :total="statCurrentPeriod.categories[categoryId].incomes"
- :type="1"
- )
-
- //- Expenses
- //-------------------------------------------------------------------------
- .statGroup(v-show="activeTabStat === 'expenses'")
- EmptyData(
- v-if="$store.getters['trns/hasTrns'] && statCurrentPeriod.expenses.categoriesIds.length === 0"
- :text="$t('stat.empty')"
- )
-
- //- Categories charts
- .stat__charts(v-show="$store.state.ui.catsChart === 'visible'")
- PeriodCatsChart(type="expenses")
-
- //- Categories list
- .stat__cats(v-show="$store.state.ui.statItems === 'visible'")
- StatItem(
- v-for="categoryId in statCurrentPeriod.expenses.categoriesIds"
- :biggest="statCurrentPeriod.expenses.biggest"
- :category="$store.state.categories.items[categoryId]"
- :categoryId="categoryId"
- :currency="$store.state.currencies.base"
- :key="categoryId"
- :total="statCurrentPeriod.categories[categoryId].expenses"
- :type="0"
- )
-
- //- History
- //-------------------------------------------------------------------------
- .statGroup(v-show="activeTabStat === 'history'")
- EmptyData(
- v-if="$store.getters['trns/hasTrns'] && $store.getters['trns/selectedTrnsIdsWithDate'].length === 0"
- :text="$t('stat.empty')"
- )
-
- TrnsList
-</template>
-
-<style lang="stylus">
-.stat
- .cats-chart__items
- padding-right 8px
- padding-left 8px
-
- .trnsList
- .trnsList__grid
- padding 0
-
- .trnsList__day
- margin-top 0
-
- &:last-child
- margin-bottom 0
- padding-bottom 0
- border-bottom 0
-</style>
-
-<style lang="stylus" scoped>
-@import "~assets/stylus/variables"
-
-.swiper-slide
- overflow hidden
- overflow-y auto
- height 100%
-
-.stat
- position relative
- margin 0 -8px
- padding-top $m7
-
- &__filter
- overflow auto
- z-index 10
- position sticky
- top 94px
- display flex
- padding-bottom $m8
- background var(--c-bg-2)
- scrollbar()
-
- &__header
- z-index 10
- position sticky
- top 93px
- display flex
- align-items center
- justify-content space-around
- margin-bottom $m7
- padding-bottom $m5
- background var(--c-bg-2)
-
- &._withFilter
- top 138px
-
- &__charts
- padding-bottom $m7
- &:last-child
- padding-bottom 0
-
- &__name
- padding 0 10px
- padding-bottom 10px
- font-header-1()
-
- &__trns
- padding 0 10px
- padding-bottom 20px
-
-.statItemHeader
- padding $m6
- padding-top 0
- padding-bottom $m5
- border-bottom 2px solid transparent
-
- &._active
- opacity 1
- border-bottom 2px solid var(--c-bg-9)
-
- &__title
- padding 0 $m2
- color var(--c-font-5)
- font-size 14px
-
- ~/._active &
- color var(--c-font-2)
-
- &__amount
- padding-top $m5
-
-.statItem
- &__trns
- padding-bottom $m8
-</style>
diff --git a/components/stat/StatSummaryPc.vue b/components/stat/StatSummaryPc.vue
index 9a9aa90a..e15ceb61 100644
--- a/components/stat/StatSummaryPc.vue
+++ b/components/stat/StatSummaryPc.vue
@@ -129,10 +129,11 @@ export default {
&._expenses
@media $media-pc
border-left 2px solid rgba(200, 30, 50, .3)
+
&._total
align-self center
@media $media-pc
- border-left 2px solid var(--c-bg-5)
+ border-left 2px solid var(--c-bg-6)
&._incomes
align-self end
diff --git a/components/stat/SummaryRow.vue b/components/stat/SummaryRow.vue
index cc64d4a3..cd81c1d5 100644
--- a/components/stat/SummaryRow.vue
+++ b/components/stat/SummaryRow.vue
@@ -14,6 +14,10 @@ export default {
computed: {
statAverage () {
return this.$store.getters['stat/statAverage']
+ },
+
+ activeTabViewName () {
+ return this.$store.state.ui.activeTabViewName
}
}
}
@@ -22,7 +26,9 @@ export default {
<template lang="pug">
.summary
//- Incomes
- .summary__item._incomes(v-if="statAverage.incomes !== 0")
+ .summary__item._incomes(
+ v-if="statAverage.incomes !== 0"
+ )
.summary__item__title._incomes {{ $t('money.incomes') }}
.summary__item__amount
Amount(
@@ -33,8 +39,23 @@ export default {
vertical="left"
)
+ //- Total
+ .summary__item._total(v-if="statAverage.incomes !== 0 && (activeTabViewName === 'incomes' || activeTabViewName === 'chart2' || activeTabViewName === 'history')")
+ .summary__item__title {{ $t('money.averageIncomes') }}
+ .summary__item__amount
+ Amount(
+ :center="true"
+ :currency="$store.state.currencies.base"
+ :type="1"
+ :value="statAverage.incomes"
+ size="md"
+ vertical="left"
+ )
+
//- Expenses
- .summary__item._expenses(v-if="statAverage.expenses !== 0")
+ .summary__item._expenses(
+ v-if="statAverage.expenses !== 0"
+ )
.summary__item__title._expenses {{ $t('money.expenses') }}
.summary__item__amount
Amount(
@@ -45,25 +66,40 @@ export default {
vertical="left"
)
+ .summary__item._total(v-if="statAverage.expenses !== 0 && (activeTabViewName === 'expenses' || activeTabViewName === 'chart2' || activeTabViewName === 'history2')")
+ .summary__item__title {{ $t('money.averageExpenses') }}
+ .summary__item__amount
+ Amount(
+ :center="true"
+ :currency="$store.state.currencies.base"
+ :type="0"
+ :value="statAverage.expenses"
+ size="md"
+ vertical="left"
+ )
+
//- Total
- .summary__item._total(v-if="statAverage.total !== 0")
- template(v-if="(incomesAmount - expensesAmount) !== 0")
- .summary__item__title {{ $t('money.total') }}
- .summary__item__amount
- Amount(
- :center="true"
- :currency="$store.state.currencies.base"
- :value="incomesAmount - expensesAmount"
- size="md"
- vertical="left"
- )
+ .summary__item._total(v-if="statAverage.total !== 0 && (incomesAmount - expensesAmount) !== 0 && (activeTabViewName === 'chart' || activeTabViewName === 'history2')")
+ .summary__item__title {{ $t('money.total') }}
+ .summary__item__amount
+ Amount(
+ :center="true"
+ :currency="$store.state.currencies.base"
+ :value="incomesAmount - expensesAmount"
+ size="md"
+ vertical="left"
+ )
+
+ //- pre {{ statAverage }}
+ //- pre {{ incomesAmount - expensesAmount }}
</template>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables/margins"
+@import '~assets/stylus/variables/margins'
.summary
display flex
+ flex-grow 1
&__item
flex 1 0 0
@@ -72,25 +108,10 @@ export default {
align-items center
justify-content center
flex-flow column
- padding-right 32px
-
- &:after
- position absolute
- top 50%
- right 16px
- content ""
- width 1px
- height 32px
- background var(--c-bg-7)
- transform translateY(-50%)
-
- &:last-child
- padding-right 0
- &:after
- display none
+ padding 0 $m6
&__title
- padding-bottom $m5
- color var(--c-font-3)
- font-size 12px
+ padding-bottom $m4
+ color var(--c-font-4)
+ font-size 10px
</style>
diff --git a/components/stat/SummaryRowItemView.vue b/components/stat/SummaryRowItemView.vue
new file mode 100644
index 00000000..330db7fe
--- /dev/null
+++ b/components/stat/SummaryRowItemView.vue
@@ -0,0 +1,77 @@
+<script>
+export default {
+ name: 'SummaryRowItemView',
+
+ props: {
+ amount: {
+ type: Number,
+ required: true
+ },
+ type: {
+ type: Number,
+ default: 3
+ },
+ title: {
+ type: String,
+ required: true
+ }
+ },
+
+ computed: {
+ className () {
+ return {
+ _expenses: this.type === 0,
+ _incomes: this.type === 1
+ }
+ }
+ }
+}
+</script>
+
+<template lang="pug">
+.summaryItem(:class="className")
+ .summaryItem__title {{ title }}
+ .summaryItem__amount
+ Amount(
+ :currency="$store.state.currencies.base"
+ :type="type"
+ :value="amount"
+ size="md"
+ vertical="left"
+ )
+ .summaryItem__line
+</template>
+
+<style lang="stylus" scoped>
+@import '~assets/stylus/variables/margins'
+
+.summaryItem
+ position relative
+ display flex
+ flex-flow column
+ margin-right $m8
+ padding-right $m8
+
+ &._expenses
+ color var(--c-expenses-1)
+
+ &._incomes
+ color var(--c-incomes-1)
+
+ &__title
+ padding-bottom $m4
+ color var(--c-font-4)
+ font-size 10px
+
+ &__line
+ position absolute
+ top 50%
+ right 0
+ width 1px
+ height 20px
+ background var(--c-bg-6)
+ transform translateY(-50%)
+
+ ~/:last-child &
+ display none
+</style>
diff --git a/components/stat/cats/PeriodCatsChart2.vue b/components/stat/cats/PeriodCatsChart2.vue
new file mode 100644
index 00000000..152708be
--- /dev/null
+++ b/components/stat/cats/PeriodCatsChart2.vue
@@ -0,0 +1,75 @@
+<script>
+export default {
+ name: 'PeriodCatsChart2',
+
+ props: {
+ type: {
+ type: String,
+ required: true,
+ validator (value) {
+ return value === 'incomes' || value === 'expenses'
+ }
+ }
+ },
+
+ data () {
+ return {
+ activeCategoryId: null,
+ offset: 0
+ }
+ },
+
+ computed: {
+ className () {
+ return {
+ _incomes: this.type === 'incomes',
+ _expenses: this.type === 'expenses'
+ }
+ },
+ biggestAmount () {
+ return this.$store.getters['stat/statCurrentPeriod'][this.type].biggest
+ },
+ categories () {
+ return this.$store.state.categories.items
+ },
+ statCurrentPeriod () {
+ return this.$store.getters['stat/statCurrentPeriod']
+ }
+ },
+
+ methods: {
+ handleActiveCategoryChange ({ categoryId, offset }) {
+ if (offset) { this.offset = offset }
+ categoryId
+ ? this.activeCategoryId = categoryId
+ : this.activeCategoryId = null
+ }
+ }
+}
+</script>
+
+<template lang="pug">
+.statLineCategories(
+ v-if="statCurrentPeriod[type].categoriesIds.length > 0"
+ :class="className"
+)
+ PeriodCatsChartItem2(
+ v-for="categoryId in statCurrentPeriod[type].categoriesIds"
+ :biggest="biggestAmount"
+ :category="categories[categoryId]"
+ :categoryId="categoryId"
+ :key="`charts-${categoryId}`"
+ :total="statCurrentPeriod.categories[categoryId][type]"
+ @onActiveCategoryChange="handleActiveCategoryChange"
+ )
+</template>
+
+<style lang="stylus" scoped>
+@import '~assets/stylus/variables'
+
+.statLineCategories
+ overflow hidden
+ // opacity .8
+ display flex
+ border-radius $m4
+</style>
diff --git a/components/stat/cats/PeriodCatsChartItem.vue b/components/stat/cats/PeriodCatsChartItem.vue
index a5de7e99..59cdb367 100644
--- a/components/stat/cats/PeriodCatsChartItem.vue
+++ b/components/stat/cats/PeriodCatsChartItem.vue
@@ -63,10 +63,11 @@ export default {
</script>
<template lang="pug">
-.statCatsItem.statCatsItem.swiper-no-swiping(
+.statCatsItem.swiper-no-swiping(
@click="() => $store.dispatch('filter/handleSetFilterCategory', categoryId)"
@mouseenter="handleMouseEnter"
- @mouseleave="handleMouseLeave")
+ @mouseleave="handleMouseLeave"
+)
.statCatsItem__graph
.statCatsItem__graph__in(:style="styles")
.statCatsItem__graph__amount {{ amount }}
@@ -76,14 +77,14 @@ export default {
</template>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables/margins"
-@import "~assets/stylus/variables/media"
+@import '~assets/stylus/variables/margins'
+@import '~assets/stylus/variables/media'
.statCatsItem
cursor pointer
margin-top 12px
margin-right 10px
- background var(--c-bg-4)
+ background var(--c-bg-5)
border-radius 3px
&:hover
@@ -98,8 +99,8 @@ export default {
width 28px
height 80px
margin 0 auto
- border-radius 3px
margin-bottom -3px
+ border-radius 3px
&__amount
position absolute
diff --git a/components/stat/cats/PeriodCatsChartItem2.vue b/components/stat/cats/PeriodCatsChartItem2.vue
new file mode 100644
index 00000000..0a303804
--- /dev/null
+++ b/components/stat/cats/PeriodCatsChartItem2.vue
@@ -0,0 +1,79 @@
+<script>
+export default {
+ name: 'PeriodCatsChartItem2',
+
+ props: {
+ category: {
+ type: Object,
+ required: true
+ },
+ categoryId: {
+ type: String,
+ required: true
+ },
+ total: {
+ type: Number,
+ required: true
+ },
+ biggest: {
+ type: Number,
+ required: true
+ }
+ },
+
+ computed: {
+ styles () {
+ return {
+ width: `${Math.abs(this.total) / Math.abs(this.biggest) * 100}%`,
+ 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'
+ }
+
+ return this.total.toFixed()
+ }
+ },
+
+ methods: {
+ handleMouseEnter (e) {
+ if (this.$store.state.ui.pc) {
+ const parent = e.target.parentNode
+ const parentScrollLeft = parent.scrollLeft
+ const targetOffset = e.target.offsetLeft
+ const targetWidth = e.target.clientWidth
+ const offset = targetOffset + (targetWidth / 2) - parentScrollLeft
+ this.$emit('onActiveCategoryChange', { offset, categoryId: this.categoryId })
+ }
+ },
+
+ handleMouseLeave (e) {
+ if (this.$store.state.ui.pc) {
+ this.$emit('onActiveCategoryChange', { categoryId: null })
+ }
+ }
+ }
+}
+</script>
+
+<template lang="pug">
+.statCatsItem.statCatsItem.swiper-no-swiping(
+ :style="styles"
+)
+</template>
+
+<style lang="stylus" scoped>
+@import "~assets/stylus/variables/margins"
+@import "~assets/stylus/variables/media"
+
+.statCatsItem
+ height 12px
+</style>
diff --git a/components/stat/chart/ChartItem.vue b/components/stat/chart/ChartItem.vue
index d8488ea1..0b695de0 100644
--- a/components/stat/chart/ChartItem.vue
+++ b/components/stat/chart/ChartItem.vue
@@ -1,6 +1,4 @@
<script>
-import dayjs from 'dayjs'
-
export default {
name: 'ChartItem',
@@ -34,7 +32,7 @@ export default {
const hasTrns = this.period.expenses > 0 || this.period.incomes > 0
return {
- _active: dayjs(parseInt(currentPeriodDate)).isSame(filterDate, filterPeriod),
+ _active: this.$day(parseInt(currentPeriodDate)).isSame(filterDate, filterPeriod),
[`_${filterPeriod}`]: true,
_grouped: this.$store.state.chart.periods[filterPeriod].grouped,
_empty: !hasTrns && this.$store.state.chart.periods[filterPeriod].hideEmpty
@@ -47,28 +45,28 @@ export default {
switch (filterPeriod) {
case 'day':
- formatedDate = dayjs(dateValueOf).format('D')
+ formatedDate = this.$day(dateValueOf).format('D')
if (!this.$store.state.chart.periods[filterPeriod].grouped) {
- dayjs().isSame(dateValueOf, 'year')
- ? formatedDate = dayjs(dateValueOf).format('D.MM')
- : formatedDate = dayjs(dateValueOf).format('D.MM.YY')
+ this.$day().isSame(dateValueOf, 'year')
+ ? formatedDate = this.$day(dateValueOf).format('D.MM')
+ : formatedDate = this.$day(dateValueOf).format('D.MM.YY')
}
return formatedDate
case 'week':
- return dayjs(parseInt(dateValueOf)).week()
+ return this.$day(parseInt(dateValueOf)).week()
case 'month':
- formatedDate = dayjs(dateValueOf).format('MMM')
+ formatedDate = this.$day(dateValueOf).format('MMM')
if (!this.$store.state.chart.periods[filterPeriod].grouped) {
- dayjs().isSame(dateValueOf, 'year')
- ? formatedDate = dayjs(dateValueOf).format('MMM')
- : formatedDate = dayjs(dateValueOf).format('MMM YY')
+ this.$day().isSame(dateValueOf, 'year')
+ ? formatedDate = this.$day(dateValueOf).format('MMM')
+ : formatedDate = this.$day(dateValueOf).format('MMM YY')
}
return formatedDate
case 'year':
- return dayjs(dateValueOf).format('YYYY')
+ return this.$day(dateValueOf).format('YYYY')
}
},
periods () {
@@ -132,7 +130,7 @@ export default {
padding $m5 $m5
padding-top $m6
flex-grow 1
- border-radius 4px
+ border-radius $m6
&._empty
display none
@@ -163,7 +161,7 @@ export default {
&._active
color var(--c-font-2)
- background var(--c-bg-4)
+ background var(--c-bg-5)
&__name
padding-top 4px
diff --git a/components/stat/chart/ChartMenu2.vue b/components/stat/chart/ChartMenu2.vue
index 800fbe98..75bd6dcd 100644
--- a/components/stat/chart/ChartMenu2.vue
+++ b/components/stat/chart/ChartMenu2.vue
@@ -37,6 +37,10 @@ export default {
},
addPeriodOrGroup () {
+ if (this.periods[this.filterPeriod].grouped) {
+ this.$store.commit('chart/toogleChartPeriodView', { periodName: this.filterPeriod })
+ }
+
this.periods[this.filterPeriod].grouped
? this.$store.commit('chart/addElementsToChart', { periodName: this.filterPeriod, periodType: 'showedGroups' })
: this.$store.commit('chart/addElementsToChart', { periodName: this.filterPeriod, periodType: 'showedPeriods' })
@@ -44,6 +48,10 @@ export default {
},
removePeriodOrGroup () {
+ if (this.periods[this.filterPeriod].grouped) {
+ this.$store.commit('chart/toogleChartPeriodView', { periodName: this.filterPeriod })
+ }
+
this.periods[this.filterPeriod].grouped
? this.$store.commit('chart/removeElementsFromChart', { periodName: this.filterPeriod, periodType: 'showedGroups' })
: this.$store.commit('chart/removeElementsFromChart', { periodName: this.filterPeriod, periodType: 'showedPeriods' })
@@ -57,7 +65,7 @@ export default {
},
saveChartsPeriodsToLocalStorage () {
- localforage.setItem('finapp.chart.periods', this.periods)
+ localforage.setItem('finapp.chart.periods', this.$store.state.chart.periods)
this.$store.dispatch('ui/saveUiView')
}
}
@@ -65,56 +73,67 @@ export default {
</script>
<template lang="pug">
-.switcher
- .switcher__name(@click="toogleView") {{ Object.keys($store.getters['stat/statByPeriods']).length }} {{ $t(`dates.${periodName}.simple`) }}
-
- .switcher__content(:class="{ _active: visibleContextMenu}")
- .switcher__item(
- v-if="!visibleContextMenu"
- @click="visibleContextMenu = !visibleContextMenu"
- ): .mdi.mdi-dots-horizontal
-
- template(v-if="visibleContextMenu")
- .switcher__item(
- v-if="periodName !== 'year'"
- @click="toogleView"
- ) {{ $t('chart.view.toogle') }}
- .switcher__item(
- v-if="(periods[filterPeriod].grouped && periods[filterPeriod].showedGroups > 1) || (!periods[filterPeriod].grouped && periods[filterPeriod].showedPeriods > 1)"
- @click="removePeriodOrGroup"
- ) {{ $t('chart.view.remove') }}
- .switcher__item(@click="addPeriodOrGroup") {{ $t('chart.view.add') }}
- .switcher__item(
- @click="visibleContextMenu = !visibleContextMenu"
- ): .mdi.mdi-close
+.chartMenu
+ //- .chartMenu__name(
+ //- v-if="filterPeriod !== 'all'"
+ //- @click="toogleView"
+ //- )
+ //- ) {{ $store.state.chart.periods[filterPeriod].showedPeriods }} {{ $t(`dates.${periodName}.simple`) }}
+
+ .chartMenu__content
+ ContextMenu(
+ :position="{ right: '0px', top: '38px' }"
+ :visible="visibleContextMenu"
+ @onClickOpener="visibleContextMenu = !visibleContextMenu"
+ )
+ template(slot="opener")
+ Dropdown._noBd.date(:active="visibleContextMenu")
+ template(slot="title")
+ //- Date
+ //- .activrPeriodName {{ $t(`dates.${$store.state.filter.period}.simple`) }}
+ template(
+ slot="desc"
+ v-if="filterPeriod !== 'all'"
+ ) {{ $store.state.chart.periods[filterPeriod].showedPeriods }} {{ $t(`dates.${periodName}.simple`) }}
+
+ template(slot="content")
+ ContextMenuItem(
+ :title="$t('chart.view.remove')"
+ icon="mdi mdi-minus"
+ @onClick="removePeriodOrGroup"
+ )
+ ContextMenuItem(
+ :title="$t('chart.view.add')"
+ icon="mdi mdi-plus"
+ @onClick="addPeriodOrGroup"
+ )
</template>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables"
+@import '~assets/stylus/variables'
-.switcher
- overflow hidden
- z-index 15
- position relative
+.chartMenu
+ z-index 11
+ position absolute
+ right 0
+ bottom 8px
display flex
align-items center
justify-content space-between
- // padding 0 $m5
- margin-bottom $m6
- border-radius 8px 8px 0 0
- border-bottom 1px solid var(--c-bg-4)
+ margin 0
+ padding 0 $m7
&__name
flex-grow 1
- padding-left $m6
color var(--c-font-5)
- font-size 10px
+ font-size 8px
text-transform uppercase
&__content
display flex
align-items stretch
justify-content stretch
+ width 32px
&._active
border-left 1px solid var(--c-bg-4)
@@ -128,8 +147,7 @@ export default {
display flex
align-items center
justify-content center
- min-width 48px
- padding $m5 $m7
+ padding 0 $m6
font-size 12px
text-align center
diff --git a/components/stat/chartOptions.js b/components/stat/chartOptions.js
index 9e93972e..9579edce 100644
--- a/components/stat/chartOptions.js
+++ b/components/stat/chartOptions.js
@@ -10,36 +10,39 @@ export default {
panKey: 'shift',
events: {
click (e) {
- console.log(this.series[0].searchPoint(e, true))
+ // console.log(this.series[0].searchPoint(e, true))
}
}
},
credits: { enabled: false },
legend: {
itemHiddenStyle: {
+ fontWeight: 'normal',
color: 'var(--c-font-5)'
},
itemStyle: {
- color: 'var(--c-font-2)'
+ fontWeight: 'normal',
+ color: 'var(--c-font-4)'
},
itemHoverStyle: {
- color: 'var(--c-font-3)'
+ fontWeight: 'normal',
+ color: 'var(--c-font-4)'
}
},
plotOptions: {
+ // series: {
+ // allowPointSelect: true,
+ // marker: {
+ // states: {
+ // select: {
+ // enabled: true
+ // }
+ // }
+ // }
+ // },
areaspline: {
fillOpacity: 0.3,
- borderWidth: 2,
- marker: {
- enabled: false,
- symbol: 'circle',
- radius: 3,
- states: {
- hover: {
- enabled: true
- }
- }
- }
+ borderWidth: 2
},
column: {
groupPadding: 0.2,
@@ -58,7 +61,7 @@ export default {
}
},
marker: {
- enabled: false
+ // enabled: false
}
}
},
@@ -69,32 +72,62 @@ export default {
animation: true,
backgroundColor: 'var(--c-bg-3)',
borderColor: 'var(--c-bg-7)',
- borderRadius: 3,
- padding: 10,
+ borderRadius: 8,
+ padding: 12,
shadow: false,
style: {
color: 'var(--c-font-2)',
- fontSize: '12px'
+ fontSize: '10px'
+ },
+ positioner (labelWidth, labelHeight, point) {
+ const leftHalf = point.plotX < (this.chart.plotWidth / 2)
+ const topHalf = point.plotY < (this.chart.plotHeight / 2)
+ return {
+ x: leftHalf ? this.chart.plotLeft + this.chart.plotWidth - labelWidth - 2 : this.chart.plotLeft,
+ y: topHalf ? this.chart.plotTop + this.chart.plotHeight - labelHeight : this.chart.plotTop
+ }
}
},
xAxis: {
categories: [],
- crosshair: true,
lineColor: 'var(--c-bg-7)',
tickColor: 'var(--c-bg-7)',
tickmarkPlacement: 'on',
labels: {
style: {
- color: 'var(--c-font-4)',
- fontSize: '12px',
+ cursor: 'pointer',
+ color: 'var(--c-font-5)',
+ fontSize: '10px',
fontFamily: 'var(--font-secondary)',
textTransform: 'uppercase'
}
- }
+ },
+ crosshair: true
+ // color: 'green'
+ // }
+ // plotBands: [{
+ // color: 'orange', // Color value
+ // from: 3.5, // Start of the plot band
+ // to: 4.5 // End of the plot band
+ // }]
},
yAxis: {
+ cursor: 'pointer',
alternateGridColor: '',
- gridLineColor: 'var(--c-bg-4)',
- title: { text: null }
+ gridLineColor: 'var(--c-bg-5)',
+ title: { text: null },
+ labels: {
+ style: {
+ cursor: 'pointer',
+ color: 'var(--c-font-5)',
+ fontSize: '12px',
+ fontFamily: 'var(--font-secondary)',
+ textTransform: 'uppercase'
+ }
+ },
+ // opposite: true,
+ // labels: {
+ // align: 'left'
+ // }
}
}
diff --git a/components/summary/SummaryRowItem.vue b/components/summary/SummaryRowItem.vue
index 5a06fa52..dd73205c 100644
--- a/components/summary/SummaryRowItem.vue
+++ b/components/summary/SummaryRowItem.vue
@@ -44,7 +44,7 @@ export default {
</template>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables"
+@import '~assets/stylus/variables'
.summaryRowItem
flex 1 0 0
diff --git a/components/themeEditor/ThemeEditor.vue b/components/themeEditor/ThemeEditor.vue
new file mode 100644
index 00000000..63e9593c
--- /dev/null
+++ b/components/themeEditor/ThemeEditor.vue
@@ -0,0 +1,91 @@
+<script>
+import Pickr from '@simonwep/pickr'
+import '@simonwep/pickr/dist/themes/classic.min.css'
+
+export default {
+ name: 'ThemeEditor',
+ data () {
+ return {
+ colors: [
+ '--c-bg-1',
+ '--c-bg-2',
+ '--c-bg-3',
+ '--c-bg-4',
+ '--c-bg-5',
+ '--c-bg-6',
+ '--c-bg-7',
+ '--c-bg-8',
+ '--c-bg-9',
+ '--c-bg-10',
+ '--c-bg-11',
+ '--c-bg-12',
+ '--c-bg-13',
+ '--c-bg-14'
+ ]
+ }
+ },
+
+ mounted () {
+ this.initPickrs()
+ },
+
+ methods: {
+ setColor (name, color) {
+ document.documentElement.style.setProperty(name, color)
+ },
+
+ initPickrs () {
+ for (const colorItem of this.colors) {
+ const colorIdx = this.colors.indexOf(colorItem)
+ const element = document.querySelector([`.initPickElement${colorIdx}`])
+ console.log(element)
+
+ Pickr.create({
+ el: element,
+ useAsButton: true,
+ theme: 'classic',
+
+ components: {
+ // Main components
+ preview: true,
+ opacity: true,
+ hue: true,
+
+ // Input / output Options
+ interaction: {
+ hex: true,
+ rgba: true,
+ hsla: true,
+ hsva: true,
+ cmyk: true,
+ input: true
+ }
+ }
+ }).on('change', (color) => {
+ const hexColor = color.toHEXA().toString()
+ this.setColor(colorItem, hexColor)
+ })
+ }
+ }
+ }
+}
+</script>
+
+<template lang="pug">
+.colors
+ .colorItem(
+ v-for="(colorItem, colorIdx) in colors"
+ :key="colorItem"
+ :class="`initPickElement${colorIdx}`"
+ ) {{ colorItem }}
+</template>
+
+<style lang="stylus" scoped>
+@import '~assets/stylus/variables'
+
+.colors
+ display flex
+
+.colorItem
+ padding $m6
+</style>
diff --git a/components/trnForm/TrnForm.vue b/components/trnForm/TrnForm.vue
index 3976332c..efa447f8 100644
--- a/components/trnForm/TrnForm.vue
+++ b/components/trnForm/TrnForm.vue
@@ -1,7 +1,6 @@
<script>
import Swiper from 'swiper'
import 'swiper/swiper-bundle.css'
-import dayjs from 'dayjs'
import { ref, useContext } from 'nuxt-composition-api'
import generateId from '~/utils/id'
import useTouchClose from '~/composables/useTouchClose'
@@ -122,7 +121,7 @@ export default {
handleSubmitTrn () {
const values = { ...this.$store.state.trnForm.values }
- const id = values.trnId || generateId(dayjs().valueOf())
+ const id = values.trnId || generateId(this.$day().valueOf())
this.$store.dispatch('trns/addTrn', {
id,
@@ -134,12 +133,12 @@ export default {
const values = {
amount: this.$store.state.trnForm.values.amount,
categoryId: this.$store.getters['categories/transferCategoryId'],
- date: dayjs(this.$store.state.trnForm.values.date).valueOf()
+ date: this.$day(this.$store.state.trnForm.values.date).valueOf()
}
// Income
this.$store.dispatch('trns/addTrn', {
- id: generateId(dayjs().valueOf()),
+ id: generateId(this.$day().valueOf()),
values: {
...values,
walletId: this.$store.state.trnForm.transfer.to,
@@ -149,7 +148,7 @@ export default {
// Expense
this.$store.dispatch('trns/addTrn', {
- id: generateId(dayjs().valueOf()),
+ id: generateId(this.$day().valueOf()),
values: {
...values,
walletId: this.$store.state.trnForm.transfer.from,
@@ -343,9 +342,9 @@ export default {
</template>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables/animations"
-@import "~assets/stylus/variables/margins"
-@import "~assets/stylus/variables/media"
+@import '~assets/stylus/variables/animations'
+@import '~assets/stylus/variables/margins'
+@import '~assets/stylus/variables/media'
.trnForm
&__title
@@ -373,7 +372,7 @@ export default {
border-radius 16px 16px 0 0
&._anim
- anim(300ms)
+ anim(200ms)
@media $media-laptop
border-radius 16px
diff --git a/components/trnForm/TrnFormAmountInput.vue b/components/trnForm/TrnFormAmountInput.vue
index 04fcdc13..76089061 100644
--- a/components/trnForm/TrnFormAmountInput.vue
+++ b/components/trnForm/TrnFormAmountInput.vue
@@ -207,9 +207,9 @@ export default {
padding-bottom $m7
.trnFormAmountPc
- background var(--c-bg-2)
- border-top 1px solid var(--c-bg-1)
- border-bottom 1px solid var(--c-bg-1)
+ background var(--c-bg-3)
+ border-top 1px solid var(--c-bg-2)
+ border-bottom 1px solid var(--c-bg-2)
&__types
display flex
diff --git a/components/trnForm/TrnFormCalculator.vue b/components/trnForm/TrnFormCalculator.vue
index 85238063..5ba359c3 100644
--- a/components/trnForm/TrnFormCalculator.vue
+++ b/components/trnForm/TrnFormCalculator.vue
@@ -249,7 +249,7 @@ export default {
~/._num &
color var(--c-font-3)
- background var(--c-bg-3)
+ background var(--c-bg-5)
~/._act &
color var(--c-font-4)
diff --git a/components/trnForm/TrnFormCalendar.vue b/components/trnForm/TrnFormCalendar.vue
index f59aad18..40210e27 100644
--- a/components/trnForm/TrnFormCalendar.vue
+++ b/components/trnForm/TrnFormCalendar.vue
@@ -1,5 +1,4 @@
<script>
-import dayjs from 'dayjs'
import { formatDate } from '~/utils/formatDate'
export default {
@@ -10,20 +9,20 @@ export default {
},
isToday () {
- return dayjs().isSame(this.$store.state.trnForm.values.date, 'day')
+ return this.$day().isSame(this.$store.state.trnForm.values.date, 'day')
}
},
methods: {
setPrevDay () {
this.$store.commit('trnForm/setTrnFormValues', {
- date: dayjs(this.$store.state.trnForm.values.date).subtract(1, 'day').valueOf()
+ date: this.$day(this.$store.state.trnForm.values.date).subtract(1, 'day').valueOf()
})
},
setNextDay () {
if (!this.isToday) {
this.$store.commit('trnForm/setTrnFormValues', {
- date: dayjs(this.$store.state.trnForm.values.date).add(1, 'day').valueOf()
+ date: this.$day(this.$store.state.trnForm.values.date).add(1, 'day').valueOf()
})
}
}
@@ -52,7 +51,7 @@ export default {
.trnFormMeta
display flex
align-items stretch
- border-top 1px solid var(--c-bg-5)
+ border-top 1px solid var(--c-bg-3)
@media $media-laptop
color var(--c-font-4)
diff --git a/components/trnForm/TrnFormHeader.vue b/components/trnForm/TrnFormHeader.vue
index f023e443..83063523 100644
--- a/components/trnForm/TrnFormHeader.vue
+++ b/components/trnForm/TrnFormHeader.vue
@@ -13,8 +13,8 @@ export default {
</template>
<style lang="stylus">
-@import "~assets/stylus/variables/margins"
-@import "~assets/stylus/variables/animations"
+@import '~assets/stylus/variables/margins'
+@import '~assets/stylus/variables/animations'
.trnFormHeaderItem
cursor pointer
@@ -33,8 +33,8 @@ export default {
</style>
<style lang="stylus">
-@import "~assets/stylus/variables/margins"
-@import "~assets/stylus/variables/media"
+@import '~assets/stylus/variables/margins'
+@import '~assets/stylus/variables/media'
.trnFormHeader
display grid
@@ -43,7 +43,4 @@ export default {
grid-row-gap $m7
padding $m7
padding-top 0
-
- /.light-mode &
- background var(--c-bg-2)
</style>
diff --git a/components/trnForm/TrnFormHeaderItemCategory.vue b/components/trnForm/TrnFormHeaderItemCategory.vue
index 28d833f1..4fbefe69 100644
--- a/components/trnForm/TrnFormHeaderItemCategory.vue
+++ b/components/trnForm/TrnFormHeaderItemCategory.vue
@@ -1,5 +1,7 @@
<script>
export default {
+ // TODO: add check for valid category
+
name: 'TrnFormHeaderItemCategory',
computed: {
diff --git a/components/trnForm/TrnFormHeaderItemWallet.vue b/components/trnForm/TrnFormHeaderItemWallet.vue
index a38b296e..642371b8 100644
--- a/components/trnForm/TrnFormHeaderItemWallet.vue
+++ b/components/trnForm/TrnFormHeaderItemWallet.vue
@@ -1,4 +1,5 @@
<script>
+// TODO: add check for valid wallet
export default {
name: 'TrnFormHeaderItemWallet',
diff --git a/components/trnForm/TrnFormModal.vue b/components/trnForm/TrnFormModal.vue
index 6531b224..2c289cd0 100644
--- a/components/trnForm/TrnFormModal.vue
+++ b/components/trnForm/TrnFormModal.vue
@@ -131,10 +131,10 @@ export default {
</template>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables/animations"
-@import "~assets/stylus/variables/fonts"
-@import "~assets/stylus/variables/media"
-@import "~assets/stylus/variables/margins"
+@import '~assets/stylus/variables/animations'
+@import '~assets/stylus/variables/fonts'
+@import '~assets/stylus/variables/media'
+@import '~assets/stylus/variables/margins'
.trnFormModal
z-index 3
@@ -155,7 +155,7 @@ export default {
bottom 0
width 100%
height 100%
- background var(--c-bg-overflow)
+ background var(--c-bg-14)
anim()
@media $media-laptop
@@ -167,7 +167,7 @@ export default {
display flex
flex-grow 1
flex-flow column nowrap
- background var(--c-bg-2)
+ background var(--c-bg-4)
border-radius $m6
&._anim
diff --git a/components/trnForm/TrnFormModalCalendar.vue b/components/trnForm/TrnFormModalCalendar.vue
index f134e34b..2d65df0e 100644
--- a/components/trnForm/TrnFormModalCalendar.vue
+++ b/components/trnForm/TrnFormModalCalendar.vue
@@ -1,6 +1,4 @@
<script>
-import dayjs from 'dayjs'
-
import Datepicker from 'vuejs-datepicker'
const calendarOptions = {
@@ -28,13 +26,13 @@ export default {
methods: {
handleSelectDate (date) {
this.$store.commit('trnForm/setTrnFormValues', {
- date: dayjs(date).valueOf()
+ date: this.$day(date).valueOf()
})
this.$store.commit('trnForm/toogleTrnFormModal', 'calendar')
},
handleSelectDateDaysAgo (daysAgo) {
this.$store.commit('trnForm/setTrnFormValues', {
- date: dayjs().subtract(daysAgo, 'day').valueOf()
+ date: this.$day().subtract(daysAgo, 'day').valueOf()
})
this.$store.commit('trnForm/toogleTrnFormModal', 'calendar')
}
diff --git a/components/trnForm/TrnFormModalCats.vue b/components/trnForm/TrnFormModalCats.vue
index f509a10b..c2e43077 100644
--- a/components/trnForm/TrnFormModalCats.vue
+++ b/components/trnForm/TrnFormModalCats.vue
@@ -83,7 +83,6 @@ TrnFormModal(
.swiper-container(ref="slider")
.swiper-wrapper
-
.swiper-slide
.scrollBlock.waitForScroll(
v-if="$store.getters['categories/lastUsedCategoriesIdsByDate'] && $store.getters['categories/lastUsedCategoriesIdsByDate'].length > 0"
@@ -121,9 +120,9 @@ TrnFormModal(
</template>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables/margins"
-@import "~assets/stylus/variables/media"
-@import "~assets/stylus/variables/scroll"
+@import '~assets/stylus/variables'
+
+$border = 1px
.scrollBlock
overflow hidden
@@ -131,40 +130,42 @@ TrnFormModal(
scrollbar()
.marginBottom
- margin-bottom 80px
+ margin-top 40px
+ margin-bottom 36px
.bottomNav
z-index 10
position absolute
+ top 50px
left 0
- bottom 0
width 100%
padding 0
+ background var(--c-bg-4)
.switcher
- overflow hidden
- opacity .96
- position relative
display flex
- align-items stretch
- justify-content stretch
- background var(--c-bg-4)
-
- &__item
- opacity .6
- flex-grow 1
- display flex
- align-items center
- justify-content center
- min-width 48px
- padding $m7 $m7
- font-size 14px
- border-radius 4px
-
- +media-hover()
- background var(--c-bg-3)
-
- &._active
- opacity 1
- background var(--c-bg-8)
+ align-items center
+ padding 0 $m7
+
+.switcher__item
+ cursor pointer
+ flex-grow 1
+ padding $m6 $m7
+ color var(--c-font-5)
+ font-size 12px
+ font-weight 500
+ font-roboto()
+ text-align center
+ border-bottom $border solid var(--c-bg-2)
+
+ &:active
+ background var(--c-bg-5)
+ border-radius $m6 $m6 0 0
+ border-bottom $border solid var(--c-bg-2)
+
+ &._active
+ cursor default
+ color var(--c-font-3)
+ background none
+ border-bottom $border solid var(--c-blue-1)
</style>
diff --git a/components/trnForm/TrnFormTrns.vue b/components/trnForm/TrnFormTrns.vue
index 6880fa16..5ae7a271 100644
--- a/components/trnForm/TrnFormTrns.vue
+++ b/components/trnForm/TrnFormTrns.vue
@@ -1,6 +1,4 @@
<script>
-import dayjs from 'dayjs'
-
export default {
props: {
ui: {
@@ -96,8 +94,8 @@ export default {
for (const trnId of trnsIds) {
let dayDate
this.sortByEditDate
- ? dayDate = dayjs(trns[trnId].edited).startOf('day').valueOf()
- : dayDate = dayjs(trns[trnId].date).startOf('day').valueOf()
+ ? dayDate = this.$day(trns[trnId].edited).startOf('day').valueOf()
+ : dayDate = this.$day(trns[trnId].date).startOf('day').valueOf()
if (!trnsList[dayDate]) {
trnsList[dayDate] = [trnId]
diff --git a/components/trnForm/styles/trnForm.styl b/components/trnForm/styles/trnForm.styl
index d727988c..e82a8dd6 100644
--- a/components/trnForm/styles/trnForm.styl
+++ b/components/trnForm/styles/trnForm.styl
@@ -1,5 +1,5 @@
.trnForm
- z-index 100
+ z-index 10
position fixed
bottom 0
height auto
@@ -20,7 +20,7 @@
bottom 0
width 100%
height 100%
- background var(--c-bg-overflow)
+ background var(--c-bg-14)
&__wrap
position relative
@@ -29,10 +29,7 @@
flex-flow column nowrap
max-width 500px
margin 0 auto
- background var(--c-bg-2)
-
- /.light-mode &
- background var(--c-bg-2)
+ background var(--c-bg-4)
@media $media-phone
max-height calc(100vh - 24px)
@@ -93,14 +90,14 @@
@media $media-phone
transform translate(0, 0)
- transition opacity 200ms ease-out, transform 250ms ease-out
+ transition opacity 100ms ease-out, transform 150ms ease-out
@media $media-laptop
transform translate(0, 0)
&-enter
opacity 0
- transition opacity 200ms ease-out, transform 250ms ease-out
+ transition opacity 100ms ease-out, transform 150ms ease-out
@media $media-phone
transform translate(0, 10px)
diff --git a/components/trns/item/TrnItem.vue b/components/trns/item/TrnItem.vue
index 9694b968..d871eaf8 100644
--- a/components/trns/item/TrnItem.vue
+++ b/components/trns/item/TrnItem.vue
@@ -23,6 +23,11 @@ export default {
ui: {
type: String,
default: 'history'
+ },
+
+ showCategory: {
+ type: Boolean,
+ default: false
}
},
@@ -30,7 +35,7 @@ export default {
className () {
return {
_detailed: this.ui === 'detailed',
- _history: this.ui === 'history',
+ _history: this.ui === 'history' || (this.ui === 'stat' && this.showCategory),
_stat: this.ui === 'stat'
}
},
@@ -39,7 +44,7 @@ export default {
return `${date.weekday}, ${date.day} ${date.month} ${date.year}`
},
formatedDateDay () {
- return formatDate(this.trn.date, 'numberDay')
+ return formatDate(this.trn.date, 'trnItem')
},
formatedDateDay2 () {
return formatDate(this.trn.date, 'trnItem')
@@ -70,6 +75,7 @@ export default {
setTrnEdit () {
const trnId = this.trnId
this.$store.dispatch('trnForm/openTrnForm', { action: 'edit', trnId })
+ this.$store.commit('stat/setCategoryModal', { id: null, type: null })
}
}
}
@@ -190,17 +196,19 @@ export default {
.trnItem__desc(v-if="trn.description") {{ trn.description }}
- //- Stat
+ //- Stat no category
//-------------------------------------------------------------------------
- template(v-else-if="ui === 'stat'")
+ template(v-else-if="ui === 'stat' && !showCategory")
.trnItem__statWrap
- .trnItem__date {{ formatedDateDay }}
+ .trnItem__date {{ $t(formatedDateDay) }}
+
.trnItem__wallet
.walletIcon
Icon(
:abbr="wallet.name"
:background="wallet.color"
- :small="true")
+ small
+ )
.walletName {{ wallet.name }}
.trnItem__desc(v-if="trn.description") {{ trn.description }}
.trnItem__amount(@click.stop="setTrnEdit")
@@ -214,41 +222,45 @@ export default {
//- History
//-------------------------------------------------------------------------
template(v-else)
- .trnItem__categoryIcon
- Icon(
- :background="category.color"
- :icon="category.icon"
- round
- )
+ .trnItem__left
+ .trnItem__categoryIcon
+ Icon(
+ :background="category.color"
+ :icon="category.icon"
+ round
+ )
- .trnItem__categoryName
- | {{ category.name }}
- .trnItem__groups(v-if="trn.groups") In group
- .trnItem__budgets(v-if="trn.budgets") In budget
+ .trnItem__center
+ .trnItem__categoryName
+ | {{ category.name }}
+ .trnItem__groups(v-if="trn.groups") In group
+ .trnItem__budgets(v-if="trn.budgets") In budget
- .trnItem__walletFloatIcon
- Icon(
- :abbr="wallet.name"
- :background="wallet.color"
- :small="true"
- )
+ .trnItem__wallet
+ .trnItem__walletIcon
+ Icon(
+ :abbr="wallet.name"
+ :background="wallet.color"
+ :small="true"
+ )
+ .trnItem__walletName {{ wallet.name }}
- .trnItem__amount(@click.stop="setTrnEdit")
- Amount(
- :currency="wallet.currency"
- :value="trn.amount"
- :type="trn.type"
- :isColorize="trn.type === 1"
- isShowPrefix
- )
+ .trnItem__desc(v-if="trn.description") {{ trn.description }}
- .trnItem__desc
- div(v-if="trn.description") {{ trn.description }}
+ .trnItem__right
+ .trnItem__amount(@click.stop="setTrnEdit")
+ Amount(
+ :currency="wallet.currency"
+ :value="trn.amount"
+ :type="trn.type"
+ :isColorize="trn.type === 1"
+ isShowPrefix
+ )
</template>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables/margins"
-@import "~assets/stylus/variables/media"
+@import '~assets/stylus/variables/margins'
+@import '~assets/stylus/variables/media'
.transfer
padding-top $m5
@@ -271,25 +283,16 @@ export default {
margin-bottom -10px
text-align center
- &._history
- display grid
- grid-template-columns minmax(10px, max-content) 1fr minmax(10px, max-content)
- grid-column-gap 28px
- margin-top -1px
- padding 0 16px
- padding-top 10px
-
- &:first-child
- margin-top 0
-
&._stat
margin-top -1px
- padding-top 10px
- padding-right 10px
- padding-left 68px
+ padding-top $m6
+ padding-right 0
+ border-bottom $m2
- @media $media-laptop
- padding-left 62px
+ &:active
+ &._history
+ &._stat
+ background var(--c-bg-5)
&:hover
&._history
@@ -297,16 +300,9 @@ export default {
@media $media-laptop
background var(--c-bg-5)
- /.light-mode &
- background var(--c-bg-5)
-
&__amount
align-self center
- ^[0]._history &
- grid-column 3 / 4
- grid-row 1 / 2
-
^[0]._stat &
margin-left auto
@@ -325,11 +321,6 @@ export default {
font-size 22px
fontFamilyNunito()
- ^[0]._history &
- grid-column 2 / 3
- grid-row 1 / 2
- align-self center
-
&__date
font-size 13px
@@ -338,7 +329,7 @@ export default {
font-size 14px
^[0]._stat &
- padding-right 20px
+ padding-right $m7
&__desc
color var(--c-font-2)
@@ -347,15 +338,9 @@ export default {
^[0]._detailed &
padding-top $m7
- ^[0]._history &
- grid-column 2 / 4
- grid-row 2 / 3
- padding-top 5px
- padding-bottom 5px
-
^[0]._stat &
overflow hidden
- padding-right 10px
+ padding-right 0
white-space nowrap
text-overflow ellipsis
@@ -394,14 +379,54 @@ export default {
^[0]._stat &
padding-right 20px
- &__walletFloatIcon
- position absolute
- top 24px
- left 35px
-
&__groups
&__budgest
display inline-block
padding-left 10px
font-size 10px
+
+// Stat
+// ----------------------------------------------------------------------------
+.trnItem._stat._history
+ padding 0
+
+// History
+// ----------------------------------------------------------------------------
+.trnItem
+ &._history
+ display grid
+ grid-template-columns minmax(10px, max-content) 1fr minmax(10px, max-content)
+ grid-column-gap $m7
+ margin-top -1px
+ padding $m6 $m7
+
+ &:first-child
+ margin-top 0
+
+ &__wallet
+ display flex
+ align-items center
+ font-size 12px
+
+ &__walletIcon
+ padding-right $m4
+
+ &__walletName
+ font-size 12px
+
+ &__desc
+ ^[0]._history &
+ padding-top $m6
+ color var(--c-font-3)
+ font-size 11px
+
+ &__categoryName
+ ^[0]._history &
+ padding-bottom $m4
+ color var(--c-font-2)
+ font-size 14px
+
+ &__amount
+ ^[0]._history &
+ //
</style>
diff --git a/components/trns/list/TrnsList.vue b/components/trns/list/TrnsList.vue
index 95e6d097..2a39c003 100644
--- a/components/trns/list/TrnsList.vue
+++ b/components/trns/list/TrnsList.vue
@@ -1,7 +1,7 @@
<script>
-import dayjs from 'dayjs'
-
export default {
+ name: 'TrnsList',
+
props: {
ui: {
type: String,
@@ -73,8 +73,8 @@ export default {
for (const trnId of trnsIds) {
let dayDate
this.sortByEditDate
- ? dayDate = dayjs(trns[trnId].edited).startOf('day').valueOf()
- : dayDate = dayjs(trns[trnId].date).startOf('day').valueOf()
+ ? dayDate = this.$day(trns[trnId].edited).startOf('day').valueOf()
+ : dayDate = this.$day(trns[trnId].date).startOf('day').valueOf()
if (!trnsList[dayDate]) {
trnsList[dayDate] = [trnId]
@@ -135,7 +135,7 @@ export default {
</template>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables"
+@import '~assets/stylus/variables'
.trnsList
padding-bottom 8px
@@ -186,8 +186,6 @@ export default {
justify-content space-between
padding 0 12px
padding-bottom 12px
- // background var(--c-bg-4)
- // border-bottom 1px solid var(--c-bg-2)
&__pages
padding 16px 8px
@@ -200,7 +198,7 @@ export default {
padding 0
padding-bottom $m8
- +media-laptop("less")
+ +media-laptop('less')
padding $m7
padding-bottom $m6
</style>
diff --git a/components/trns/list/TrnsList3.vue b/components/trns/list/TrnsList3.vue
new file mode 100644
index 00000000..0539710b
--- /dev/null
+++ b/components/trns/list/TrnsList3.vue
@@ -0,0 +1,192 @@
+<script>
+export default {
+ name: 'TrnsList3',
+
+ props: {
+ ui: {
+ type: String,
+ default: 'history'
+ },
+ limit: {
+ type: Number,
+ default: 0
+ },
+ categoryId: {
+ type: String,
+ default: null
+ },
+ expenses: {
+ type: Boolean,
+ default: false
+ },
+ incomes: {
+ type: Boolean,
+ default: false
+ },
+ size: {
+ type: Number,
+ default: 30
+ },
+ showCategory: {
+ type: Boolean,
+ default: false
+ }
+ },
+
+ data () {
+ return {
+ pageNumber: 1,
+ sortByEditDate: false
+ }
+ },
+
+ computed: {
+ isShowedAllTrns () {
+ return this.paginatedTrnsIds.length === this.trnsIds.length
+ },
+
+ paginatedTrnsIds () {
+ const end = this.pageNumber * this.size
+ return this.trnsIds.slice(0, end)
+ },
+
+ trnsIds () {
+ const trns = this.$store.state.trns.items
+ let trnsIds = this.$store.getters['trns/selectedTrnsIdsWithDate']
+
+ // from category
+ if (this.categoryId) {
+ const categoriesIds = this.$store.getters['categories/categoriesIds']
+ const categories = this.$store.state.categories.items
+ const childCategoriesIds = categoriesIds.filter(id => categories[id].parentId === this.categoryId)
+ if (childCategoriesIds.length) {
+ trnsIds = trnsIds.filter((trnId) => {
+ const trnCategoryId = trns[trnId].categoryId
+ for (const categoryId of childCategoriesIds) {
+ if (trnCategoryId === categoryId) { return true }
+ }
+ return false
+ })
+ }
+ else {
+ trnsIds = trnsIds.filter(trnId => trns[trnId].categoryId === this.categoryId)
+ }
+ }
+
+ // filter type
+ if (this.incomes) { trnsIds = trnsIds.filter(id => trns[id].type === 1) }
+ if (this.expenses) { trnsIds = trnsIds.filter(id => trns[id].type === 0) }
+
+ // limit
+ if (this.limit > 0) { return trnsIds.slice(0, this.limit) }
+ return trnsIds
+ },
+
+ groupedTrns () {
+ const trns = this.$store.state.trns.items
+ const trnsIds = this.paginatedTrnsIds
+ const trnsList = {}
+
+ for (const trnId of trnsIds) {
+ let dayDate
+ this.sortByEditDate
+ ? dayDate = this.$day(trns[trnId].edited).startOf('day').valueOf()
+ : dayDate = this.$day(trns[trnId].date).startOf('day').valueOf()
+
+ if (!trnsList[dayDate]) {
+ trnsList[dayDate] = [trnId]
+ }
+ else {
+ trnsList[dayDate].push(trnId)
+ }
+ }
+ return trnsList
+ }
+ },
+
+ methods: {
+ showMoreTrns () {
+ this.pageNumber = this.pageNumber + 1
+ }
+ }
+}
+</script>
+
+<template lang="pug">
+.trnsList
+ .trnsList__content
+ template(v-if="trnsIds.length > 0")
+ //- history view
+ template(v-if="ui === 'history'")
+ .trnsList__grid
+ .trnsList__day(v-for="(trnsIds, date) in groupedTrns")
+ .trnsList__header: TrnsListDate(:date="date")
+ .trnsList__trns
+ TrnItem(
+ v-for="trnId in trnsIds"
+ :category="$store.state.categories.items[$store.state.trns.items[trnId].categoryId]"
+ :key="trnId"
+ :trn="$store.state.trns.items[trnId]"
+ :trnId="trnId"
+ :wallet="$store.state.wallets.items[$store.state.trns.items[trnId].walletId]"
+ )
+
+ //- stat view
+ template(v-else)
+ template(v-for="trnId of paginatedTrnsIds")
+ TrnItem(
+ :category="$store.state.categories.items[$store.state.trns.items[trnId].categoryId]"
+ :key="trnId"
+ :trn="$store.state.trns.items[trnId]"
+ :trnId="trnId"
+ :ui="ui"
+ :showCategory="showCategory"
+ :wallet="$store.state.wallets.items[$store.state.trns.items[trnId].walletId]"
+ )
+
+ .trnsList__pages(v-if="!isShowedAllTrns")
+ Button(
+ :class="['_text-center _border _inline']"
+ :title="$t('trns.more')"
+ @onClick="showMoreTrns"
+ )
+</template>
+
+<style lang="stylus" scoped>
+@import "~assets/stylus/variables"
+
+.trnsList
+ &__grid
+ display grid
+ grid-template-rows 1fr
+ grid-template-columns 1fr
+
+ &__day
+ padding $m7 0
+ // border-bottom 1px solid var(--c-bg-5)
+
+ &:first-child
+ padding-top 0
+
+ &:last-child
+ padding-bottom 0
+ border-bottom 0
+
+ &__header
+ z-index 2
+ opacity .95
+ position sticky
+ top 37px
+ display flex
+ align-items center
+ justify-content space-between
+ padding $m3 $m3
+ background var(--c-bg-4)
+
+ &__pages
+ padding 16px 8px
+
+ +media-laptop()
+ padding 0
+ padding-top 20px
+</style>
diff --git a/components/trns/modal/TrnModal.vue b/components/trns/modal/TrnModal.vue
index d993a150..1552808c 100644
--- a/components/trns/modal/TrnModal.vue
+++ b/components/trns/modal/TrnModal.vue
@@ -35,6 +35,7 @@ export default {
this.$store.dispatch('filter/setFilterCategoryId', this.$store.state.trns.items[this.trnId].categoryId)
this.$store.commit('trns/hideTrnModal')
this.$store.commit('trns/setTrnModalId', null)
+ this.$store.commit('stat/setCategoryModal', { id: null, type: null })
this.$store.dispatch('ui/setActiveTab', 'stat')
},
handleSetFilterWallet (id) {
@@ -42,6 +43,7 @@ export default {
this.$store.dispatch('filter/setFilterWalletId', this.$store.state.trns.items[this.trnId].walletId)
this.$store.commit('trns/hideTrnModal')
this.$store.commit('trns/setTrnModalId', null)
+ this.$store.commit('stat/setCategoryModal', { id: null, type: null })
this.$store.dispatch('ui/setActiveTab', 'stat')
},
handleDublicateTrn () {
@@ -49,12 +51,14 @@ export default {
this.$store.dispatch('trnForm/openTrnForm', { action: 'duplicate', trnId })
this.$store.commit('trns/hideTrnModal')
this.$store.commit('trns/setTrnModalId', null)
+ this.$store.commit('stat/setCategoryModal', { id: null, type: null })
},
handleEditClick () {
const trnId = this.trnId
this.$store.dispatch('trnForm/openTrnForm', { action: 'edit', trnId })
this.$store.commit('trns/hideTrnModal')
this.$store.commit('trns/setTrnModalId', null)
+ this.$store.commit('stat/setCategoryModal', { id: null, type: null })
},
handleDeleteClick () {
this.showModalConfirm = true
diff --git a/components/wallets/WalletsPageMobile.vue b/components/wallets/WalletsPageMobile.vue
new file mode 100644
index 00000000..6f4c1996
--- /dev/null
+++ b/components/wallets/WalletsPageMobile.vue
@@ -0,0 +1,42 @@
+<script>
+export default {
+ name: 'WalletsPageMobile',
+
+ methods: {
+ handleShowWalletModal (id) {
+ this.$store.commit('wallets/showWalletModal')
+ this.$store.commit('wallets/setWalletModalId', id)
+ }
+ }
+}
+</script>
+
+<template lang="pug">
+ComponentWrap(:contentPadding="false")
+ template(slot="content")
+ WalletsTotal
+ WalletsList3(
+ :limit="6"
+ showToogle
+ @onClick="(id) => handleShowWalletModal(id)"
+ )
+
+ template(slot="bottom")
+ .flex
+ .col
+ Button(
+ :title="$t('wallets.new')"
+ className="_inline _small"
+ @onClick="$store.dispatch('ui/setActiveTab', 'createWallet')"
+ )
+ .col
+ Button(
+ :title="$t('base.sort')"
+ className="_inline _small"
+ @onClick="$store.dispatch('ui/setActiveTab', 'walletsSort')"
+ )
+</template>
+
+<style lang="stylus" scoped>
+//
+</style>
diff --git a/components/wallets/item/WalletItem2.vue b/components/wallets/item/WalletItem2.vue
index 3a860a01..139e2b01 100644
--- a/components/wallets/item/WalletItem2.vue
+++ b/components/wallets/item/WalletItem2.vue
@@ -66,21 +66,23 @@ export default {
</template>
<style lang="stylus">
-@import "~assets/stylus/variables"
+@import '~assets/stylus/variables'
.walletItemGrid
overflow hidden
cursor pointer
- padding $m6 $m6
+ padding 14px $m7
padding-top 0
background var(--c-bg-3)
+ border 1px solid var(--c-bg-6)
+ border-top 0
border-radius $m5
&__line
opacity 1
height 4px
- margin 0 (- $m6)
- margin-bottom $m6
+ margin 0 (- $m7)
+ margin-bottom 14px
&__name
padding-bottom $m5
diff --git a/components/wallets/modal/WalletModal.vue b/components/wallets/modal/WalletModal.vue
index af1de7af..d5134a9a 100644
--- a/components/wallets/modal/WalletModal.vue
+++ b/components/wallets/modal/WalletModal.vue
@@ -2,13 +2,6 @@
import { db } from '~/services/firebaseConfig'
export default {
- props: {
- slider: {
- type: Object,
- default: () => {}
- }
- },
-
data () {
return {
showModalConfirm: false
@@ -43,8 +36,8 @@ export default {
this.$store.dispatch('filter/setFilterWalletId', this.walletId)
this.$store.commit('wallets/setWalletModalId', null)
- if (this.slider) {
- this.slider.slideTo(1)
+ if (this.$store.state.ui.mobile) {
+ this.$store.dispatch('ui/setActiveTabViewName', 'chart')
}
},
@@ -135,7 +128,8 @@ Portal(
padding $m8
padding-top 0
padding-bottom $m6
- background var(--c-bg-2)
+ background var(--c-bg-4)
+ border-bottom 0
border-radius $m6 $m6 0 0
&__name
diff --git a/composables/useTouchClose.js b/composables/useTouchClose.js
index 741d5d65..464aed6a 100644
--- a/composables/useTouchClose.js
+++ b/composables/useTouchClose.js
@@ -37,7 +37,7 @@ export default function useOnTouch ({ container, overflow, dragger, content, onC
if (content.value && content.value.scrollTop > 0) { return }
if (event.target.closest('.doNotCloseModal')) {
- this.isDragging = false
+ isDragging.value = false
return
}
diff --git a/layouts/default.vue b/layouts/default.vue
index 2dd6af73..7dfa3a62 100644
--- a/layouts/default.vue
+++ b/layouts/default.vue
@@ -72,7 +72,7 @@ export default {
</template>
<style lang="stylus">
-@import "~assets/stylus/variables"
+@import '~assets/stylus/variables'
*
box-sizing border-box
@@ -83,11 +83,11 @@ export default {
html
font-size 16px
- overscroll-behavior-y contain
+// overscroll-behavior-y contain
body
overflow hidden
- overscroll-behavior-y contain
+ // overscroll-behavior-y contain
margin 0
color var(--c-font-2)
font-primary()
@@ -99,7 +99,7 @@ body
</style>
<style lang="stylus" scoped>
-@import "~assets/stylus/index"
+@import '~assets/stylus/index'
.finapp
display flex
diff --git a/layouts/error.vue b/layouts/error.vue
index fd2172dd..5ee4fcfb 100644
--- a/layouts/error.vue
+++ b/layouts/error.vue
@@ -23,6 +23,7 @@ export default {
.container
h1 Error
pre {{ error }}
+ h1(@click="$router.push('/')") Index
</template>
<style lang="stylus">
diff --git a/locales/en-US.js b/locales/en-US.js
index 07937265..52c9cd4a 100644
--- a/locales/en-US.js
+++ b/locales/en-US.js
@@ -12,6 +12,7 @@ export default {
},
theme: {
+ title: 'Theme',
change: 'Change theme'
},
@@ -207,6 +208,7 @@ export default {
title: 'Statistics',
selectedPeriod: 'Selected period',
shortTitle: 'Stat',
+ periods: 'Detail',
balanceTitle: 'Balance',
empty: 'No stat for this period',
customize: {
@@ -268,17 +270,21 @@ export default {
},
week: {
current: 'This week',
+ last: 'Last week',
simple: 'Week'
},
month: {
current: 'This month',
+ last: 'Last month',
simple: 'Month'
},
year: {
current: 'This year',
simple: 'Year'
},
- all: 'Show all'
+ all: {
+ simple: 'All trns'
+ }
},
alerts: {
diff --git a/locales/ru-RU.js b/locales/ru-RU.js
index 40e6d3d4..ac48c070 100644
--- a/locales/ru-RU.js
+++ b/locales/ru-RU.js
@@ -13,6 +13,7 @@ export default {
},
theme: {
+ title: 'Тема',
change: 'Сменить цвет оформления'
},
@@ -210,6 +211,7 @@ export default {
selectedPeriod: 'Выбранный период',
shortTitle: 'Статистика',
balanceTitle: 'Баланс',
+ periods: 'Общее',
empty: 'Статистики по выбранным параметрам нет :)',
customize: {
showPeriodsChart: 'Показывать график периодов',
@@ -270,17 +272,21 @@ export default {
},
week: {
current: 'Текущая неделя',
+ last: 'Прошлая неделя',
simple: 'Неделя'
},
month: {
current: 'Текущий месяц',
+ last: 'Прошлый месяц',
simple: 'Месяц'
},
year: {
current: 'Текущий год',
simple: 'Год'
},
- all: 'Показать всё'
+ all: {
+ simple: 'Все транзакции'
+ }
},
alerts: {
@@ -289,7 +295,7 @@ export default {
buttons: {
nextTitle: 'Следующий',
- prevTitle: 'Предыдущий',
+ prevTitle: 'Прошлый',
nextStep: 'Далее'
},
diff --git a/package-lock.json b/package-lock.json
index e2d48616..ec647031 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "finapp",
- "version": "3.2.5",
+ "version": "3.3.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -4944,19 +4944,19 @@
}
},
"@nuxtjs/eslint-config": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/@nuxtjs/eslint-config/-/eslint-config-3.1.0.tgz",
- "integrity": "sha512-/6hDCt4nmlgmSFmJMLyZoopJ9iEfUVL5gpvr0uCzAYBjBl49ldsmu+SmsT13zosEnCIWCosBIevuaeCDKKBbJA==",
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/@nuxtjs/eslint-config/-/eslint-config-5.0.0.tgz",
+ "integrity": "sha512-xoi0CPpFj4hOTz5xMiqGK314276gOmI+8W+3tgybqsKiKQBFXe1IOUjHzsuGqkS44iGy+GmmrwA387ojvKnhkQ==",
"dev": true,
"requires": {
- "eslint-config-standard": "^14.1.1",
- "eslint-plugin-import": "2.22.0",
- "eslint-plugin-jest": "^23.18.2",
+ "eslint-config-standard": "^16.0.1",
+ "eslint-plugin-import": "^2.22.1",
+ "eslint-plugin-jest": "^24.1.3",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
- "eslint-plugin-standard": "^4.0.1",
- "eslint-plugin-unicorn": "^21.0.0",
- "eslint-plugin-vue": "^6.2.2"
+ "eslint-plugin-standard": "^4.1.0",
+ "eslint-plugin-unicorn": "^23.0.0",
+ "eslint-plugin-vue": "^7.1.0"
}
},
"@nuxtjs/pwa": {
@@ -5108,6 +5108,15 @@
"resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
"integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA="
},
+ "@simonwep/pickr": {
+ "version": "1.7.4",
+ "resolved": "https://registry.npmjs.org/@simonwep/pickr/-/pickr-1.7.4.tgz",
+ "integrity": "sha512-fq7jgKJT21uWGC1mARBHvvd1JYlEf93o7SuVOB4Lr0x/2UPuNC9Oe9n/GzVeg4oVtqMDfh1wIEJpsdOJEZb+3g==",
+ "requires": {
+ "core-js": "^3.6.5",
+ "nanopop": "^2.1.0"
+ }
+ },
"@stylelint/postcss-css-in-js": {
"version": "0.37.1",
"resolved": "https://registry.npmjs.org/@stylelint/postcss-css-in-js/-/postcss-css-in-js-0.37.1.tgz",
@@ -5153,10 +5162,19 @@
"resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz",
"integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w=="
},
+ "@types/mdast": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.3.tgz",
+ "integrity": "sha512-SXPBMnFVQg1s00dlMCc/jCdvPqdE4mXaMMCeRlxLDmTAEoegHT53xKtkDnzDTOcmMHUfcjyf36/YYZ6SxRdnsw==",
+ "dev": true,
+ "requires": {
+ "@types/unist": "*"
+ }
+ },
"@types/minimist": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz",
- "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=",
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.1.tgz",
+ "integrity": "sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==",
"dev": true
},
"@types/node": {
@@ -5250,38 +5268,74 @@
}
},
"@typescript-eslint/experimental-utils": {
- "version": "2.34.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.34.0.tgz",
- "integrity": "sha512-eS6FTkq+wuMJ+sgtuNTtcqavWXqsflWcfBnlYhg/nS4aZ1leewkXGbvBhaapn1q6qf4M71bsR1tez5JTRMuqwA==",
+ "version": "4.8.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.8.1.tgz",
+ "integrity": "sha512-WigyLn144R3+lGATXW4nNcDJ9JlTkG8YdBWHkDlN0lC3gUGtDi7Pe3h5GPvFKMcRz8KbZpm9FJV9NTW8CpRHpg==",
"dev": true,
"requires": {
"@types/json-schema": "^7.0.3",
- "@typescript-eslint/typescript-estree": "2.34.0",
+ "@typescript-eslint/scope-manager": "4.8.1",
+ "@typescript-eslint/types": "4.8.1",
+ "@typescript-eslint/typescript-estree": "4.8.1",
"eslint-scope": "^5.0.0",
"eslint-utils": "^2.0.0"
},
"dependencies": {
"eslint-scope": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz",
- "integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==",
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
+ "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
"dev": true,
"requires": {
- "esrecurse": "^4.1.0",
+ "esrecurse": "^4.3.0",
"estraverse": "^4.1.1"
}
+ },
+ "esrecurse": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
+ "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
+ "dev": true,
+ "requires": {
+ "estraverse": "^5.2.0"
+ },
+ "dependencies": {
+ "estraverse": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
+ "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
+ "dev": true
+ }
+ }
}
}
},
+ "@typescript-eslint/scope-manager": {
+ "version": "4.8.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.8.1.tgz",
+ "integrity": "sha512-r0iUOc41KFFbZdPAdCS4K1mXivnSZqXS5D9oW+iykQsRlTbQRfuFRSW20xKDdYiaCoH+SkSLeIF484g3kWzwOQ==",
+ "dev": true,
+ "requires": {
+ "@typescript-eslint/types": "4.8.1",
+ "@typescript-eslint/visitor-keys": "4.8.1"
+ }
+ },
+ "@typescript-eslint/types": {
+ "version": "4.8.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.8.1.tgz",
+ "integrity": "sha512-ave2a18x2Y25q5K05K/U3JQIe2Av4+TNi/2YuzyaXLAsDx6UZkz1boZ7nR/N6Wwae2PpudTZmHFXqu7faXfHmA==",
+ "dev": true
+ },
"@typescript-eslint/typescript-estree": {
- "version": "2.34.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.34.0.tgz",
- "integrity": "sha512-OMAr+nJWKdlVM9LOqCqh3pQQPwxHAN7Du8DR6dmwCrAmxtiXQnhHJ6tBNtf+cggqfo51SG/FCwnKhXCIM7hnVg==",
+ "version": "4.8.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.8.1.tgz",
+ "integrity": "sha512-bJ6Fn/6tW2g7WIkCWh3QRlaSU7CdUUK52shx36/J7T5oTQzANvi6raoTsbwGM11+7eBbeem8hCCKbyvAc0X3sQ==",
"dev": true,
"requires": {
+ "@typescript-eslint/types": "4.8.1",
+ "@typescript-eslint/visitor-keys": "4.8.1",
"debug": "^4.1.1",
- "eslint-visitor-keys": "^1.1.0",
- "glob": "^7.1.6",
+ "globby": "^11.0.1",
"is-glob": "^4.0.1",
"lodash": "^4.17.15",
"semver": "^7.3.2",
@@ -5289,12 +5343,12 @@
},
"dependencies": {
"debug": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
- "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+ "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
"dev": true,
"requires": {
- "ms": "^2.1.1"
+ "ms": "2.1.2"
}
},
"ms": {
@@ -5311,6 +5365,24 @@
}
}
},
+ "@typescript-eslint/visitor-keys": {
+ "version": "4.8.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.8.1.tgz",
+ "integrity": "sha512-3nrwXFdEYALQh/zW8rFwP4QltqsanCDz4CwWMPiIZmwlk9GlvBeueEIbq05SEq4ganqM0g9nh02xXgv5XI3PeQ==",
+ "dev": true,
+ "requires": {
+ "@typescript-eslint/types": "4.8.1",
+ "eslint-visitor-keys": "^2.0.0"
+ },
+ "dependencies": {
+ "eslint-visitor-keys": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz",
+ "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==",
+ "dev": true
+ }
+ }
+ },
"@vue/babel-helper-vue-jsx-merge-props": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.2.1.tgz",
@@ -6104,13 +6176,63 @@
"integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg="
},
"array.prototype.flat": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz",
- "integrity": "sha512-gBlRZV0VSmfPIeWfuuy56XZMvbVfbEUnOXUvt3F/eUUUSyzlgLxhEX4YAEpxNAogRGehPSnfXyPtYyKAhkzQhQ==",
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz",
+ "integrity": "sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==",
"dev": true,
"requires": {
+ "call-bind": "^1.0.0",
"define-properties": "^1.1.3",
- "es-abstract": "^1.17.0-next.1"
+ "es-abstract": "^1.18.0-next.1"
+ },
+ "dependencies": {
+ "es-abstract": {
+ "version": "1.18.0-next.1",
+ "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz",
+ "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==",
+ "dev": true,
+ "requires": {
+ "es-to-primitive": "^1.2.1",
+ "function-bind": "^1.1.1",
+ "has": "^1.0.3",
+ "has-symbols": "^1.0.1",
+ "is-callable": "^1.2.2",
+ "is-negative-zero": "^2.0.0",
+ "is-regex": "^1.1.1",
+ "object-inspect": "^1.8.0",
+ "object-keys": "^1.1.1",
+ "object.assign": "^4.1.1",
+ "string.prototype.trimend": "^1.0.1",
+ "string.prototype.trimstart": "^1.0.1"
+ }
+ },
+ "is-callable": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz",
+ "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==",
+ "dev": true
+ },
+ "is-regex": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz",
+ "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==",
+ "dev": true,
+ "requires": {
+ "has-symbols": "^1.0.1"
+ }
+ },
+ "object.assign": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz",
+ "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==",
+ "dev": true,
+ "requires": {
+ "call-bind": "^1.0.0",
+ "define-properties": "^1.1.3",
+ "has-symbols": "^1.0.1",
+ "object-keys": "^1.1.1"
+ }
+ }
}
},
"arrify": {
@@ -8023,9 +8145,9 @@
}
},
"dayjs": {
- "version": "1.9.5",
- "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.9.5.tgz",
- "integrity": "sha512-WULIw7UpW/E0y6VywewpbXAMH3d5cZijEhoHLwM+OMVbk/NtchKS/W+57H/0P1rqU7gHrAArjiRLHCUhgMQl6w=="
+ "version": "1.9.6",
+ "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.9.6.tgz",
+ "integrity": "sha512-HngNLtPEBWRo8EFVmHFmSXAjtCX8rGNqeXQI0Gh7wCTSqwaKgPIDqu9m07wABVopNwzvOeCb+2711vQhDlcIXw=="
},
"de-indent": {
"version": "1.0.2",
@@ -8848,9 +8970,9 @@
}
},
"eslint-config-standard": {
- "version": "14.1.1",
- "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-14.1.1.tgz",
- "integrity": "sha512-Z9B+VR+JIXRxz21udPTL9HpFMyoMUEeX1G251EQ6e05WD9aPVtVBn09XUmZ259wCMlCDmYDSZG62Hhm+ZTJcUg==",
+ "version": "16.0.2",
+ "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-16.0.2.tgz",
+ "integrity": "sha512-fx3f1rJDsl9bY7qzyX8SAtP8GBSk6MfXFaTfaGgk12aAYW4gJSyRm7dM790L6cbXv63fvjY4XeSzXnb4WM+SKw==",
"dev": true
},
"eslint-import-resolver-node": {
@@ -8924,9 +9046,9 @@
}
},
"eslint-plugin-import": {
- "version": "2.22.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.0.tgz",
- "integrity": "sha512-66Fpf1Ln6aIS5Gr/55ts19eUuoDhAbZgnr6UxK5hbDx6l/QgQgx61AePq+BV4PP2uXQFClgMVzep5zZ94qqsxg==",
+ "version": "2.22.1",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz",
+ "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==",
"dev": true,
"requires": {
"array-includes": "^3.1.1",
@@ -8934,7 +9056,7 @@
"contains-path": "^0.1.0",
"debug": "^2.6.9",
"doctrine": "1.5.0",
- "eslint-import-resolver-node": "^0.3.3",
+ "eslint-import-resolver-node": "^0.3.4",
"eslint-module-utils": "^2.6.0",
"has": "^1.0.3",
"minimatch": "^3.0.4",
@@ -9013,12 +9135,12 @@
}
},
"eslint-plugin-jest": {
- "version": "23.20.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-23.20.0.tgz",
- "integrity": "sha512-+6BGQt85OREevBDWCvhqj1yYA4+BFK4XnRZSGJionuEYmcglMZYLNNBBemwzbqUAckURaHdJSBcjHPyrtypZOw==",
+ "version": "24.1.3",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-24.1.3.tgz",
+ "integrity": "sha512-dNGGjzuEzCE3d5EPZQ/QGtmlMotqnYWD/QpCZ1UuZlrMAdhG5rldh0N0haCvhGnUkSeuORS5VNROwF9Hrgn3Lg==",
"dev": true,
"requires": {
- "@typescript-eslint/experimental-utils": "^2.5.0"
+ "@typescript-eslint/experimental-utils": "^4.0.1"
}
},
"eslint-plugin-node": {
@@ -9036,14 +9158,14 @@
}
},
"eslint-plugin-nuxt": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-nuxt/-/eslint-plugin-nuxt-1.0.0.tgz",
- "integrity": "sha512-/wStWT367UXimakvNkYmG66dlP+O4CIEDS7Kg8BrwSlLX/ubQRZowVT3oJqspJJvR6jqJPMdGym5PBYd5iE+xg==",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-nuxt/-/eslint-plugin-nuxt-2.0.0.tgz",
+ "integrity": "sha512-0VaG4SlKeGwMKSmOug/gNjliKoDNM/XfgiPhJ4v6FnjYrM3zSwTQVMH6vPjI8Gs722NjgwOZTucvmYbHzYEp5A==",
"dev": true,
"requires": {
- "eslint-plugin-vue": "^6.2.2",
+ "eslint-plugin-vue": "^7.1.0",
"semver": "^7.3.2",
- "vue-eslint-parser": "^7.0.0"
+ "vue-eslint-parser": "^7.1.1"
},
"dependencies": {
"semver": {
@@ -9061,24 +9183,24 @@
"dev": true
},
"eslint-plugin-standard": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-4.0.1.tgz",
- "integrity": "sha512-v/KBnfyaOMPmZc/dmc6ozOdWqekGp7bBGq4jLAecEfPGmfKiWS4sA8sC0LqiV9w5qmXAtXVn4M3p1jSyhY85SQ==",
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-4.1.0.tgz",
+ "integrity": "sha512-ZL7+QRixjTR6/528YNGyDotyffm5OQst/sGxKDwGb9Uqs4In5Egi4+jbobhqJoyoCM6/7v/1A5fhQ7ScMtDjaQ==",
"dev": true
},
"eslint-plugin-unicorn": {
- "version": "21.0.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-21.0.0.tgz",
- "integrity": "sha512-S8v7+v4gZTQPj4pKKvexhgSUaLQSyItvxW2SVZDaX9Iu5IjlAmF2eni+L6w8a2aqshxgU8Lle4FIAVDtuejSKQ==",
+ "version": "23.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-23.0.0.tgz",
+ "integrity": "sha512-Vabo3cjl6cjyhcf+76CdQEY6suOFzK0Xh3xo0uL9VDYrDJP5+B6PjV0tHTYm82WZmFWniugFJM3ywHSNYTi/ZQ==",
"dev": true,
"requires": {
"ci-info": "^2.0.0",
"clean-regexp": "^1.0.0",
"eslint-ast-utils": "^1.1.0",
- "eslint-template-visitor": "^2.0.0",
+ "eslint-template-visitor": "^2.2.1",
"eslint-utils": "^2.1.0",
"import-modules": "^2.0.0",
- "lodash": "^4.17.15",
+ "lodash": "^4.17.20",
"pluralize": "^8.0.0",
"read-pkg-up": "^7.0.1",
"regexp-tree": "^0.1.21",
@@ -9137,14 +9259,14 @@
"dev": true
},
"parse-json": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.1.tgz",
- "integrity": "sha512-ztoZ4/DYeXQq4E21v169sC8qWINGpcosGv9XhTDvg9/hWvx/zrFkc9BiWxR58OJLHGk28j5BL0SDLeV2WmFZlQ==",
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz",
+ "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
"error-ex": "^1.3.1",
- "json-parse-better-errors": "^1.0.1",
+ "json-parse-even-better-errors": "^2.3.0",
"lines-and-columns": "^1.1.6"
}
},
@@ -9209,20 +9331,21 @@
}
},
"eslint-plugin-vue": {
- "version": "6.2.2",
- "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-6.2.2.tgz",
- "integrity": "sha512-Nhc+oVAHm0uz/PkJAWscwIT4ijTrK5fqNqz9QB1D35SbbuMG1uB6Yr5AJpvPSWg+WOw7nYNswerYh0kOk64gqQ==",
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-7.1.0.tgz",
+ "integrity": "sha512-9dW7kj8/d2IkDdgNpvIhJdJ3XzU3x4PThXYMzWt49taktYnGyrTY6/bXCYZ/VtQKU9kXPntPrZ41+8Pw0Nxblg==",
"dev": true,
"requires": {
+ "eslint-utils": "^2.1.0",
"natural-compare": "^1.4.0",
- "semver": "^5.6.0",
- "vue-eslint-parser": "^7.0.0"
+ "semver": "^7.3.2",
+ "vue-eslint-parser": "^7.1.1"
},
"dependencies": {
"semver": {
- "version": "5.7.1",
- "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
- "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
+ "version": "7.3.2",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
+ "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==",
"dev": true
}
}
@@ -9280,9 +9403,9 @@
},
"dependencies": {
"acorn": {
- "version": "7.3.1",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.3.1.tgz",
- "integrity": "sha512-tLc0wSnatxAQHVHUapaHdz72pi9KUyHjq5KyHjGg9Y8Ifdc79pTh2XvI6I1/chZbnM7QtNKzh66ooDogPZSleA==",
+ "version": "7.4.1",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
+ "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
"dev": true
}
}
@@ -11018,11 +11141,6 @@
"resolved": "https://registry.npmjs.org/highcharts/-/highcharts-8.2.2.tgz",
"integrity": "sha512-F63TXO7RxsvTcpO/KOubQZWualYpCMyCTuKtoWbt7KCsfQ3Kl7Fr6HEyyJdjkYl+XlnmnKlSRi9d3HjLK9Q0wg=="
},
- "highcharts-border-radius": {
- "version": "0.0.2",
- "resolved": "https://registry.npmjs.org/highcharts-border-radius/-/highcharts-border-radius-0.0.2.tgz",
- "integrity": "sha512-lN9vxrzOx8AFwX3ZmR8lNy/TV68hNz2zZ5HatCFUGVofP7nzxw+rwIh1aYDLVzp5Oprwkw2CBAcARitfDhtCVg=="
- },
"highcharts-vue": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/highcharts-vue/-/highcharts-vue-1.3.5.tgz",
@@ -12069,9 +12187,9 @@
"integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw=="
},
"known-css-properties": {
- "version": "0.19.0",
- "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.19.0.tgz",
- "integrity": "sha512-eYboRV94Vco725nKMlpkn3nV2+96p9c3gKXRsYqAJSswSENvBhN7n5L+uDhY58xQa0UukWsDMTGELzmD8Q+wTA==",
+ "version": "0.20.0",
+ "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.20.0.tgz",
+ "integrity": "sha512-URvsjaA9ypfreqJ2/ylDr5MUERhJZ+DhguoWRr2xgS5C7aGCalXo+ewL+GixgKBfhT2vuL02nbIgNGqVWgTOYw==",
"dev": true
},
"last-call-webpack-plugin": {
@@ -12650,16 +12768,16 @@
}
},
"mathjs": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-7.6.0.tgz",
- "integrity": "sha512-abywR28hUpKF4at5jE8Ys+Kigk40eKMT5mcBLD0/dtsqjfOLbtzd3WjlRqIopNo7oQ6FME51qph6lb8h/bhpUg==",
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-8.0.1.tgz",
+ "integrity": "sha512-lvdYNHLNrRORYKRpRs22RMeeAoqVxRePUCjDealCZLfN5io0tJHqQLyNZuJJSXWa8Pl0dkM434D4cIUsbYR1Mg==",
"requires": {
"complex.js": "^2.0.11",
"decimal.js": "^10.2.1",
"escape-latex": "^1.2.0",
"fraction.js": "^4.0.12",
"javascript-natural-sort": "^0.7.1",
- "seed-random": "^2.2.0",
+ "seedrandom": "^3.0.5",
"tiny-emitter": "^2.1.0",
"typed-function": "^2.0.0"
}
@@ -12689,6 +12807,38 @@
"unist-util-visit": "^2.0.0"
}
},
+ "mdast-util-from-markdown": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.1.tgz",
+ "integrity": "sha512-qJXNcFcuCSPqUF0Tb0uYcFDIq67qwB3sxo9RPdf9vG8T90ViKnksFqdB/Coq2a7sTnxL/Ify2y7aIQXDkQFH0w==",
+ "dev": true,
+ "requires": {
+ "@types/mdast": "^3.0.0",
+ "mdast-util-to-string": "^1.0.0",
+ "micromark": "~2.10.0",
+ "parse-entities": "^2.0.0"
+ }
+ },
+ "mdast-util-to-markdown": {
+ "version": "0.5.3",
+ "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-0.5.3.tgz",
+ "integrity": "sha512-sr8q7fQJ1xoCqZSXW6dO/MYu2Md+a4Hfk9uO+XHCfiBhVM0EgWtfAV7BuN+ff6otUeu2xDyt1o7vhZGwOG3+BA==",
+ "dev": true,
+ "requires": {
+ "@types/unist": "^2.0.0",
+ "longest-streak": "^2.0.0",
+ "mdast-util-to-string": "^1.0.0",
+ "parse-entities": "^2.0.0",
+ "repeat-string": "^1.0.0",
+ "zwitch": "^1.0.0"
+ }
+ },
+ "mdast-util-to-string": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz",
+ "integrity": "sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==",
+ "dev": true
+ },
"mdn-data": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz",
@@ -12718,9 +12868,9 @@
}
},
"meow": {
- "version": "7.1.1",
- "resolved": "https://registry.npmjs.org/meow/-/meow-7.1.1.tgz",
- "integrity": "sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA==",
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/meow/-/meow-8.0.0.tgz",
+ "integrity": "sha512-nbsTRz2fwniJBFgUkcdISq8y/q9n9VbiHYbfwklFh5V4V2uAcxtKQkDc0yCLPM/kP0d+inZBewn3zJqewHE7kg==",
"dev": true,
"requires": {
"@types/minimist": "^1.2.0",
@@ -12728,20 +12878,14 @@
"decamelize-keys": "^1.1.0",
"hard-rejection": "^2.1.0",
"minimist-options": "4.1.0",
- "normalize-package-data": "^2.5.0",
+ "normalize-package-data": "^3.0.0",
"read-pkg-up": "^7.0.1",
"redent": "^3.0.0",
"trim-newlines": "^3.0.0",
- "type-fest": "^0.13.1",
- "yargs-parser": "^18.1.3"
+ "type-fest": "^0.18.0",
+ "yargs-parser": "^20.2.3"
},
"dependencies": {
- "camelcase": {
- "version": "5.3.1",
- "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
- "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
- "dev": true
- },
"find-up": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
@@ -12752,6 +12896,15 @@
"path-exists": "^4.0.0"
}
},
+ "hosted-git-info": {
+ "version": "3.0.7",
+ "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.7.tgz",
+ "integrity": "sha512-fWqc0IcuXs+BmE9orLDyVykAG9GJtGLGuZAAqgcckPgv5xad4AcXGIv8galtQvlwutxSlaMcdw7BUtq2EIvqCQ==",
+ "dev": true,
+ "requires": {
+ "lru-cache": "^6.0.0"
+ }
+ },
"locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
@@ -12761,6 +12914,18 @@
"p-locate": "^4.1.0"
}
},
+ "normalize-package-data": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.0.tgz",
+ "integrity": "sha512-6lUjEI0d3v6kFrtgA/lOx4zHCWULXsFNIjHolnZCKCTLA6m/G625cdn3O7eNmT0iD3jfo6HZ9cdImGZwf21prw==",
+ "dev": true,
+ "requires": {
+ "hosted-git-info": "^3.0.6",
+ "resolve": "^1.17.0",
+ "semver": "^7.3.2",
+ "validate-npm-package-license": "^3.0.1"
+ }
+ },
"p-limit": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
@@ -12815,6 +12980,30 @@
"type-fest": "^0.6.0"
},
"dependencies": {
+ "hosted-git-info": {
+ "version": "2.8.8",
+ "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz",
+ "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==",
+ "dev": true
+ },
+ "normalize-package-data": {
+ "version": "2.5.0",
+ "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
+ "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==",
+ "dev": true,
+ "requires": {
+ "hosted-git-info": "^2.1.4",
+ "resolve": "^1.10.0",
+ "semver": "2 || 3 || 4 || 5",
+ "validate-npm-package-license": "^3.0.1"
+ }
+ },
+ "semver": {
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
+ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
+ "dev": true
+ },
"type-fest": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz",
@@ -12842,21 +13031,23 @@
}
}
},
+ "semver": {
+ "version": "7.3.2",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
+ "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==",
+ "dev": true
+ },
"type-fest": {
- "version": "0.13.1",
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz",
- "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==",
+ "version": "0.18.1",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz",
+ "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==",
"dev": true
},
"yargs-parser": {
- "version": "18.1.3",
- "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
- "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
- "dev": true,
- "requires": {
- "camelcase": "^5.0.0",
- "decamelize": "^1.2.0"
- }
+ "version": "20.2.4",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz",
+ "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==",
+ "dev": true
}
}
},
@@ -12895,6 +13086,33 @@
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
},
+ "micromark": {
+ "version": "2.10.1",
+ "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.10.1.tgz",
+ "integrity": "sha512-fUuVF8sC1X7wsCS29SYQ2ZfIZYbTymp0EYr6sab3idFjigFFjGa5UwoniPlV9tAgntjuapW1t9U+S0yDYeGKHQ==",
+ "dev": true,
+ "requires": {
+ "debug": "^4.0.0",
+ "parse-entities": "^2.0.0"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+ "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
+ "dev": true,
+ "requires": {
+ "ms": "2.1.2"
+ }
+ },
+ "ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+ "dev": true
+ }
+ }
+ },
"micromatch": {
"version": "3.1.10",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
@@ -13158,6 +13376,11 @@
"to-regex": "^3.0.1"
}
},
+ "nanopop": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/nanopop/-/nanopop-2.1.0.tgz",
+ "integrity": "sha512-jGTwpFRexSH+fxappnGQtN9dspgE2ipa1aOjtR24igG0pv6JCxImIAmrLRHX+zUF5+1wtsFVbKyfP51kIGAVNw=="
+ },
"natural-compare": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
@@ -16309,10 +16532,10 @@
"ajv-keywords": "^3.4.1"
}
},
- "seed-random": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/seed-random/-/seed-random-2.2.0.tgz",
- "integrity": "sha1-KpsZ4lCoFwmSMaW5mk2vgLf77VQ="
+ "seedrandom": {
+ "version": "3.0.5",
+ "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz",
+ "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg=="
},
"semver": {
"version": "6.3.0",
@@ -17024,22 +17247,22 @@
}
},
"stylelint": {
- "version": "13.7.2",
- "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-13.7.2.tgz",
- "integrity": "sha512-mmieorkfmO+ZA6CNDu1ic9qpt4tFvH2QUB7vqXgrMVHe5ENU69q7YDq0YUg/UHLuCsZOWhUAvcMcLzLDIERzSg==",
+ "version": "13.8.0",
+ "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-13.8.0.tgz",
+ "integrity": "sha512-iHH3dv3UI23SLDrH4zMQDjLT9/dDIz/IpoFeuNxZmEx86KtfpjDOscxLTFioQyv+2vQjPlRZnK0UoJtfxLICXQ==",
"dev": true,
"requires": {
"@stylelint/postcss-css-in-js": "^0.37.2",
- "@stylelint/postcss-markdown": "^0.36.1",
+ "@stylelint/postcss-markdown": "^0.36.2",
"autoprefixer": "^9.8.6",
"balanced-match": "^1.0.0",
"chalk": "^4.1.0",
"cosmiconfig": "^7.0.0",
- "debug": "^4.1.1",
+ "debug": "^4.2.0",
"execall": "^2.0.0",
"fast-glob": "^3.2.4",
"fastest-levenshtein": "^1.0.12",
- "file-entry-cache": "^5.0.1",
+ "file-entry-cache": "^6.0.0",
"get-stdin": "^8.0.0",
"global-modules": "^2.0.0",
"globby": "^11.0.1",
@@ -17048,14 +17271,14 @@
"ignore": "^5.1.8",
"import-lazy": "^4.0.0",
"imurmurhash": "^0.1.4",
- "known-css-properties": "^0.19.0",
+ "known-css-properties": "^0.20.0",
"lodash": "^4.17.20",
"log-symbols": "^4.0.0",
"mathml-tag-names": "^2.1.3",
- "meow": "^7.1.1",
+ "meow": "^8.0.0",
"micromatch": "^4.0.2",
"normalize-selector": "^0.2.0",
- "postcss": "^7.0.32",
+ "postcss": "^7.0.35",
"postcss-html": "^0.36.0",
"postcss-less": "^3.1.4",
"postcss-media-query-parser": "^0.2.3",
@@ -17063,7 +17286,7 @@
"postcss-safe-parser": "^4.0.2",
"postcss-sass": "^0.4.4",
"postcss-scss": "^2.1.1",
- "postcss-selector-parser": "^6.0.2",
+ "postcss-selector-parser": "^6.0.4",
"postcss-syntax": "^0.36.2",
"postcss-value-parser": "^4.1.0",
"resolve-from": "^5.0.0",
@@ -17074,8 +17297,8 @@
"style-search": "^0.1.0",
"sugarss": "^2.0.0",
"svg-tags": "^1.0.0",
- "table": "^6.0.1",
- "v8-compile-cache": "^2.1.1",
+ "table": "^6.0.3",
+ "v8-compile-cache": "^2.2.0",
"write-file-atomic": "^3.0.3"
},
"dependencies": {
@@ -17088,6 +17311,16 @@
"@babel/core": ">=7.9.0"
}
},
+ "@stylelint/postcss-markdown": {
+ "version": "0.36.2",
+ "resolved": "https://registry.npmjs.org/@stylelint/postcss-markdown/-/postcss-markdown-0.36.2.tgz",
+ "integrity": "sha512-2kGbqUVJUGE8dM+bMzXG/PYUWKkjLIkRLWNh39OaADkiabDRdw8ATFCgbMz5xdIcvwspPAluSL7uY+ZiTWdWmQ==",
+ "dev": true,
+ "requires": {
+ "remark": "^13.0.0",
+ "unist-util-find-all-after": "^3.0.2"
+ }
+ },
"ajv": {
"version": "6.12.6",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
@@ -17169,14 +17402,23 @@
}
},
"debug": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz",
- "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==",
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+ "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
"dev": true,
"requires": {
"ms": "2.1.2"
}
},
+ "file-entry-cache": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz",
+ "integrity": "sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA==",
+ "dev": true,
+ "requires": {
+ "flat-cache": "^3.0.4"
+ }
+ },
"fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
@@ -17186,6 +17428,22 @@
"to-regex-range": "^5.0.1"
}
},
+ "flat-cache": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz",
+ "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==",
+ "dev": true,
+ "requires": {
+ "flatted": "^3.1.0",
+ "rimraf": "^3.0.2"
+ }
+ },
+ "flatted": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.0.tgz",
+ "integrity": "sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA==",
+ "dev": true
+ },
"global-modules": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz",
@@ -17236,6 +17494,12 @@
}
}
},
+ "is-buffer": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz",
+ "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==",
+ "dev": true
+ },
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
@@ -17248,6 +17512,12 @@
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true
},
+ "is-plain-obj": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz",
+ "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==",
+ "dev": true
+ },
"micromatch": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz",
@@ -17282,12 +17552,136 @@
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
"dev": true
},
+ "postcss": {
+ "version": "7.0.35",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz",
+ "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==",
+ "dev": true,
+ "requires": {
+ "chalk": "^2.4.2",
+ "source-map": "^0.6.1",
+ "supports-color": "^6.1.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^1.9.0"
+ }
+ },
+ "chalk": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
+ "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
+ },
+ "dependencies": {
+ "supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^3.0.0"
+ }
+ }
+ }
+ },
+ "color-convert": {
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+ "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+ "dev": true,
+ "requires": {
+ "color-name": "1.1.3"
+ }
+ },
+ "color-name": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
+ "dev": true
+ },
+ "has-flag": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
+ "dev": true
+ },
+ "supports-color": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
+ "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^3.0.0"
+ }
+ }
+ }
+ },
+ "postcss-selector-parser": {
+ "version": "6.0.4",
+ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.4.tgz",
+ "integrity": "sha512-gjMeXBempyInaBqpp8gODmwZ52WaYsVOsfr4L4lDQ7n3ncD6mEyySiDtgzCT+NYC0mmeOLvtsF8iaEf0YT6dBw==",
+ "dev": true,
+ "requires": {
+ "cssesc": "^3.0.0",
+ "indexes-of": "^1.0.1",
+ "uniq": "^1.0.1",
+ "util-deprecate": "^1.0.2"
+ }
+ },
+ "remark": {
+ "version": "13.0.0",
+ "resolved": "https://registry.npmjs.org/remark/-/remark-13.0.0.tgz",
+ "integrity": "sha512-HDz1+IKGtOyWN+QgBiAT0kn+2s6ovOxHyPAFGKVE81VSzJ+mq7RwHFledEvB5F1p4iJvOah/LOKdFuzvRnNLCA==",
+ "dev": true,
+ "requires": {
+ "remark-parse": "^9.0.0",
+ "remark-stringify": "^9.0.0",
+ "unified": "^9.1.0"
+ }
+ },
+ "remark-parse": {
+ "version": "9.0.0",
+ "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-9.0.0.tgz",
+ "integrity": "sha512-geKatMwSzEXKHuzBNU1z676sGcDcFoChMK38TgdHJNAYfFtsfHDQG7MoJAjs6sgYMqyLduCYWDIWZIxiPeafEw==",
+ "dev": true,
+ "requires": {
+ "mdast-util-from-markdown": "^0.8.0"
+ }
+ },
+ "remark-stringify": {
+ "version": "9.0.0",
+ "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-9.0.0.tgz",
+ "integrity": "sha512-8x29DpTbVzEc6Dwb90qhxCtbZ6hmj3BxWWDpMhA+1WM4dOEGH5U5/GFe3Be5Hns5MvPSFAr1e2KSVtKZkK5nUw==",
+ "dev": true,
+ "requires": {
+ "mdast-util-to-markdown": "^0.5.0"
+ }
+ },
"resolve-from": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
"integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==",
"dev": true
},
+ "rimraf": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
+ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
+ "dev": true,
+ "requires": {
+ "glob": "^7.1.3"
+ }
+ },
"slice-ansi": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz",
@@ -17299,6 +17693,12 @@
"is-fullwidth-code-point": "^3.0.0"
}
},
+ "source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true
+ },
"string-width": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
@@ -17329,9 +17729,9 @@
}
},
"table": {
- "version": "6.0.3",
- "resolved": "https://registry.npmjs.org/table/-/table-6.0.3.tgz",
- "integrity": "sha512-8321ZMcf1B9HvVX/btKv8mMZahCjn2aYrDlpqHaBFCfnox64edeH9kEid0vTLTRR8gWR2A20aDgeuTTea4sVtw==",
+ "version": "6.0.4",
+ "resolved": "https://registry.npmjs.org/table/-/table-6.0.4.tgz",
+ "integrity": "sha512-sBT4xRLdALd+NFBvwOz8bw4b15htyythha+q+DVZqy2RS08PPC8O2sZFgJYEY7bJvbCFKccs+WIZ/cd+xxTWCw==",
"dev": true,
"requires": {
"ajv": "^6.12.4",
@@ -17349,6 +17749,29 @@
"is-number": "^7.0.0"
}
},
+ "unified": {
+ "version": "9.2.0",
+ "resolved": "https://registry.npmjs.org/unified/-/unified-9.2.0.tgz",
+ "integrity": "sha512-vx2Z0vY+a3YoTj8+pttM3tiJHCwY5UFbYdiWrwBEbHmK8pvsPj2rtAX2BFfgXen8T39CJWblWRDT4L5WGXtDdg==",
+ "dev": true,
+ "requires": {
+ "bail": "^1.0.0",
+ "extend": "^3.0.0",
+ "is-buffer": "^2.0.0",
+ "is-plain-obj": "^2.0.0",
+ "trough": "^1.0.0",
+ "vfile": "^4.0.0"
+ }
+ },
+ "unist-util-find-all-after": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/unist-util-find-all-after/-/unist-util-find-all-after-3.0.2.tgz",
+ "integrity": "sha512-xaTC/AGZ0rIM2gM28YVRAFPIZpzbpDtU3dRmp7EXlNVA8ziQc4hY3H7BHXM1J49nEmiqc3svnqMReW+PGqbZKQ==",
+ "dev": true,
+ "requires": {
+ "unist-util-is": "^4.0.0"
+ }
+ },
"write-file-atomic": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz",
@@ -18529,9 +18952,9 @@
"integrity": "sha512-arhk1wtWAfLsJyxGMoEYhoBowM87/i6HLSG2LH/03Yog6i2d9JEN1peMP0Ceis+/n9DxdenGYZZTxbPPJyHciA=="
},
"vue-eslint-parser": {
- "version": "7.1.0",
- "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.1.0.tgz",
- "integrity": "sha512-Kr21uPfthDc63nDl27AGQEhtt9VrZ9nkYk/NTftJ2ws9XiJwzJJCnCr3AITQ2jpRMA0XPGDECxYH8E027qMK9Q==",
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.1.1.tgz",
+ "integrity": "sha512-8FdXi0gieEwh1IprIBafpiJWcApwrU+l2FEj8c1HtHFdNXMd0+2jUSjBVmcQYohf/E72irwAXEXLga6TQcB3FA==",
"dev": true,
"requires": {
"debug": "^4.1.1",
@@ -18543,24 +18966,41 @@
},
"dependencies": {
"debug": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
- "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+ "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
"dev": true,
"requires": {
- "ms": "^2.1.1"
+ "ms": "2.1.2"
}
},
"eslint-scope": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz",
- "integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==",
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
+ "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
"dev": true,
"requires": {
- "esrecurse": "^4.1.0",
+ "esrecurse": "^4.3.0",
"estraverse": "^4.1.1"
}
},
+ "esrecurse": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
+ "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
+ "dev": true,
+ "requires": {
+ "estraverse": "^5.2.0"
+ },
+ "dependencies": {
+ "estraverse": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
+ "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
+ "dev": true
+ }
+ }
+ },
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
@@ -19471,6 +19911,12 @@
"camelcase": "^3.0.0",
"object.assign": "^4.1.0"
}
+ },
+ "zwitch": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-1.0.5.tgz",
+ "integrity": "sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==",
+ "dev": true
}
}
}
diff --git a/package.json b/package.json
index 11e8a8b4..beb1337b 100644
--- a/package.json
+++ b/package.json
@@ -1,27 +1,27 @@
{
"name": "finapp",
- "version": "3.2.6",
+ "version": "3.3.7",
"scripts": {
"dev": "cross-env NUXT_HOST=0.0.0.0 nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
- "build-upload-all": "npm run build && npm run upload-all",
- "build-upload-min": "npm run build && npm run upload-min",
+ "build-upload-all": "npm run generate && npm run upload-all",
+ "build-upload-min": "npm run generate && npm run upload-min",
"upload-all": "NODE_ENV=production node node_modules/gulp/bin/gulp.js uploadAll",
"upload-min": "NODE_ENV=production node node_modules/gulp/bin/gulp.js uploadMin"
},
"dependencies": {
"@nuxtjs/style-resources": "^1.0.0",
+ "@simonwep/pickr": "^1.7.4",
"axios": "^0.21.0",
- "dayjs": "^1.9.5",
+ "dayjs": "^1.9.6",
"fancy-log": "^1.3.3",
"firebase": "^7.24.0",
"highcharts": "^8.2.2",
- "highcharts-border-radius": "0.0.2",
"highcharts-vue": "^1.3.5",
"localforage": "^1.9.0",
- "mathjs": "^7.6.0",
+ "mathjs": "^8.0.1",
"nuxt": "^2.14.7",
"nuxt-composition-api": "^0.11.0",
"nuxt-i18n": "^6.15.4",
@@ -35,12 +35,12 @@
},
"devDependencies": {
"@nuxtjs/color-mode": "^2.0.0",
- "@nuxtjs/eslint-config": "^3.1.0",
+ "@nuxtjs/eslint-config": "^5.0.0",
"@nuxtjs/pwa": "3.2.2",
"babel-eslint": "^10.1.0",
"cross-env": "^7.0.2",
- "eslint": "^7.13.0",
- "eslint-plugin-nuxt": "^1.0.0",
+ "eslint": "^7.14.0",
+ "eslint-plugin-nuxt": "^2.0.0",
"gulp": "^4.0.2",
"gulp-notify": "^3.2.0",
"gulp-plumber": "^1.2.1",
@@ -48,7 +48,7 @@
"pug": "^3.0.0",
"pug-plain-loader": "^1.0.0",
"style-loader": "^1.3.0",
- "stylelint": "^13.7.2",
+ "stylelint": "^13.8.0",
"stylelint-order": "^4.1.0",
"stylelint-plugin-stylus": "^0.9.0",
"stylus": "^0.54.8",
diff --git a/pages/clear.vue b/pages/clear.vue
new file mode 100644
index 00000000..f7480600
--- /dev/null
+++ b/pages/clear.vue
@@ -0,0 +1,28 @@
+<script>
+import localforage from 'localforage'
+
+export default {
+ auth: false,
+
+ data () {
+ return {
+ done: false
+ }
+ },
+
+ mounted () {
+ localforage.clear()
+ this.done = true
+ }
+}
+</script>
+
+<template lang="pug">
+div
+ template(v-if="done") Ура, кеш почистился
+ h1(@click="$router.push('/')") Index
+</template>
+
+<style lang="stylus" scoped>
+
+</style>
diff --git a/pages/components.vue b/pages/components.vue
new file mode 100644
index 00000000..9bb7ff6e
--- /dev/null
+++ b/pages/components.vue
@@ -0,0 +1,86 @@
+<script>
+export default {
+ name: 'ComponentsPage'
+}
+</script>
+
+<template lang="pug">
+.wrap
+ .page
+ .pageSection._sidebar
+ .pageSection__title Sidebar
+ .pageSection__content
+
+
+ .pageSection._main
+ .pageSection__title Main
+ .pageSection__content
+ .box
+ .box__title {{ $t('money.averageExpenses') }}
+ .box__subTitle 1
+
+ .pageSection._modal
+ .pageSection__title Modal
+
+ ContextMenuItem(
+ :title="$t('theme.change')"
+ icon="mdi mdi-palette"
+ @onClick="$store.dispatch('ui/changeTheme')"
+ )
+</template>
+
+<style lang="stylus">
+html
+ --border rgba(0, 0, 0, .07)
+ --shadow rgba(0, 0, 0, .05)
+
+ &.dark-mode
+ --border rgba(0, 0, 0, .7)
+ --shadow rgba(0, 0, 0, .2)
+</style>
+
+<style lang="stylus" scoped>
+@import "~assets/stylus/variables"
+
+
+.box
+ padding $m7
+ background var(--c-bg-2)
+ border 1px solid var(--border)
+ border-radius $m5
+ box-shadow 0 0px 10px 10px var(--shadow)
+
+ &__title
+ padding-bottom $m4
+ color var(--c-font-5)
+ font-size 12px
+
+ &__subTitle
+ // color #0e0e0e
+ color var(--c-font-2)
+ font-size 16px
+
+.wrap
+ height 100%
+
+.page
+ display grid
+ grid-template-columns .3fr auto .3fr
+ // height 100%
+ padding-bottom $mb2
+
+.pageSection
+ padding $m9
+ background var(--c-bg-2)
+
+ &._sidebar
+ background var(--c-bg-4)
+ border-right 1px solid var(--c-bg-1)
+
+ &._modal
+ background var(--c-bg-2)
+
+ &__title
+ font-h1()
+ padding-bottom $m8
+</style>
diff --git a/pages/history.vue b/pages/history.vue
new file mode 100644
index 00000000..49253a3c
--- /dev/null
+++ b/pages/history.vue
@@ -0,0 +1,866 @@
+<script>
+import localforage from 'localforage'
+
+export default {
+ name: 'HistoryPage'
+}
+</script>
+
+<template lang="pug">
+LayoutMobileWrap
+ //- Wallets
+ //---------------------------------------------------------------------------
+ template(v-if="activeTab === 'wallets'")
+ WalletsPageMobile
+
+ //- Categories
+ //---------------------------------------------------------------------------
+ template(v-if="activeTabViewName === 'wallets'")
+ ComponentWrap(:contentPadding="false")
+ template(slot="headerLeft") {{ $t('categories.name') }}
+
+ template(slot="content")
+ CategoriesList(
+ :style="{ paddingTop: '16px' }"
+ @onClick="(id) => $store.dispatch('categories/showCategoryModal', id)"
+ )
+
+ template(slot="bottom")
+ .flex
+ .col
+ Button(
+ :title="$t('categories.new')"
+ className="_inline _small"
+ @onClick="$store.dispatch('ui/setActiveTab', 'createCategory')"
+ )
+
+ //- Stat
+ //---------------------------------------------------------------------------
+ .page(v-if="activeTab === 'stat'")
+ .page__content.pageScrollerJsContent
+
+ //- Daily & History
+ //-----------------------------------------------------------------------
+ .page__block.pageScrollerJsHeader
+ .box._nobd.boxSwitcher
+ .switcher2._bg
+ .switcher2__item(
+ :class="{ _active: activeTabViewName === 'chart' }"
+ @click="onClickTopMenu('chart')"
+ ) {{ $t('stat.periods') }}
+ .switcher2__item(
+ v-if="statAverage.incomes !== 0"
+ :class="{ _active: activeTabViewName === 'incomes' }"
+ @click="onClickTopMenu('incomes')"
+ ) {{ $t('money.incomes') }}
+ .switcher2__item(
+ v-if="statAverage.expenses !== 0"
+ :class="{ _active: activeTabViewName === 'expenses' }"
+ @click="onClickTopMenu('expenses')"
+ ) {{ $t('money.expenses') }}
+ .switcher2__item(
+ :class="{ _active: activeTabViewName === 'history' }"
+ @click="onClickTopMenu('history')"
+ ) {{ $t('trns.history') }}
+ .switcher2__item(
+ @click="$store.dispatch('ui/changeTheme')"
+ ) {{ $t('theme.title') }}
+
+ .box._h272(
+ v-if="filterPeriod !== 'all'"
+ v-show="activeTabViewName !== 'history' && activeTabViewName !== 'chart'"
+ )
+ StatChartDonut2(
+ v-if="filterPeriod !== 'all'"
+ :isShowIncomes="activeTabViewName === 'incomes' || activeTabViewName === 'chart'"
+ :isShowExpenses="activeTabViewName === 'expenses' || activeTabViewName === 'chart'"
+ :key="activeTabViewName + period + filterPeriod + $store.state.chart.periods[filterPeriod].showedPeriods + this.$store.state.filter.categoryId + this.$store.state.filter.walletId"
+ )
+ ChartMenu2
+
+ template(v-if="activeTabViewName === 'history'")
+ .box
+ TrnsList3
+
+ template(v-if="activeTabViewName === 'chart'")
+ .page__grid
+ .box._h272(
+ v-if="filterPeriod !== 'all'"
+ v-show="activeTabViewName !== 'history'"
+ )
+ StatChartDonut2(
+ v-if="filterPeriod !== 'all'"
+ :isShowIncomes="activeTabViewName === 'incomes' || activeTabViewName === 'chart'"
+ :isShowExpenses="activeTabViewName === 'expenses' || activeTabViewName === 'chart'"
+ :key="activeTabViewName + period + filterPeriod + $store.state.chart.periods[filterPeriod].showedPeriods + this.$store.state.filter.categoryId + this.$store.state.filter.walletId"
+ )
+ ChartMenu2
+
+ .box._periods
+ .periods
+ .periodItem(@click="removePeriodOrGroup"): .mdi.mdi-minus
+ .periodItem(
+ v-for="periodItem in periodsNames"
+ :key="periodItem.slug"
+ :class="{ _active: $store.state.filter.period === periodItem.slug }"
+ @click="$store.dispatch('filter/setPeriod', periodItem.slug)"
+ )
+ .periodItem__count(
+ v-if="filterPeriod !== 'all'"
+ ) {{ $store.state.chart.periods[periodItem.slug].showedPeriods }}
+ .periodItem__name {{ periodItem.name }}
+ .periodItem(@click="addPeriodOrGroup"): .mdi.mdi-plus
+
+ //- Period Selector
+ //---------------------------
+ .box__nav._noMargin
+ ContextMenu(
+ :position="{ right: '-50px', top: '38px' }"
+ :visible="isShowPeriodsNames"
+ @onClickOpener="isShowPeriodsNames = !isShowPeriodsNames"
+ )
+ template(slot="opener")
+ Dropdown._noBd.date(:active="isShowPeriodsNames")
+ template(slot="title")
+ Date
+
+ template(slot="content")
+ ContextMenuItem(
+ :selected="$store.state.filter.period === 'day'"
+ :title="$t('dates.day.simple')"
+ icon="mdi mdi-weather-sunset-up"
+ @onClick="$store.dispatch('filter/setPeriod', 'day')"
+ @onClose="isShowPeriodsNames = !isShowPeriodsNames"
+ )
+ ContextMenuItem(
+ :selected="$store.state.filter.period === 'week'"
+ :title="$t('dates.week.simple')"
+ icon="mdi mdi-calendar-week"
+ @onClick="$store.dispatch('filter/setPeriod', 'week')"
+ @onClose="isShowPeriodsNames = !isShowPeriodsNames"
+ )
+ ContextMenuItem(
+ :selected="$store.state.filter.period === 'month'"
+ :title="$t('dates.month.simple')"
+ icon="mdi mdi-calendar"
+ @onClick="$store.dispatch('filter/setPeriod', 'month')"
+ @onClose="isShowPeriodsNames = !isShowPeriodsNames"
+ )
+ ContextMenuItem(
+ :selected="$store.state.filter.period === 'year'"
+ :title="$t('dates.year.simple')"
+ icon="mdi mdi-calendar-star"
+ @onClick="$store.dispatch('filter/setPeriod', 'year')"
+ @onClose="isShowPeriodsNames = !isShowPeriodsNames"
+ )
+ ContextMenuItem(
+ :selected="$store.state.filter.period === 'all'"
+ :title="$t('dates.all.simple')"
+ icon="mdi mdi-database"
+ @onClick="$store.dispatch('filter/setPeriod', 'all')"
+ @onClose="isShowPeriodsNames = !isShowPeriodsNames"
+ )
+
+ //- Filter
+ //---------------------------
+ .page__filter(v-if="isShowFilter")
+ FilterRow
+
+ //- Incomes
+ //---------------------------
+ template(v-if="statAverage.incomes !== 0")
+ .boxTitle {{ $t('money.incomes') }}
+
+ .boxSummary2
+ .boxSummary2__item
+ Amount(
+ :currency="$store.state.currencies.base"
+ :type="1"
+ :value="statCurrentPeriod.incomes.total"
+ size="xl"
+ vertical="left"
+ )
+ SummaryRowItemView(
+ :type="1"
+ :amount="statAverage.incomes"
+ :title="$t('money.averageIncomes')"
+ )
+
+ .boxEmpty(v-if="statCurrentPeriod.incomes.categoriesIds.length === 0") {{ $t('stat.empty') }}
+
+ //- Cats incomes
+ //---------------------------
+ .box._stat(v-if="$store.state.ui.catsChart === 'visible' && statCurrentPeriod.incomes.categoriesIds.length > 0")
+ .box__content
+ PeriodCatsChart(type="incomes")
+
+ //- Stat incomes
+ //---------------------------
+ .box._stat(v-if="$store.state.ui.statItems === 'visible' && statCurrentPeriod.incomes.categoriesIds.length > 0")
+ .box__content
+ LazyStatItem(
+ v-if="$store.state.ui.pc"
+ v-for="categoryId in statCurrentPeriod.incomes.categoriesIds"
+ :biggest="statCurrentPeriod.incomes.biggest"
+ :category="$store.state.categories.items[categoryId]"
+ :categoryId="categoryId"
+ :currency="$store.state.currencies.base"
+ :key="categoryId"
+ :total="statCurrentPeriod.categories[categoryId].incomes"
+ :type="1"
+ )
+ LazyStatItemMobile(
+ v-if="$store.state.ui.mobile"
+ v-for="categoryId in statCurrentPeriod.incomes.categoriesIds"
+ :biggest="statCurrentPeriod.incomes.biggest"
+ :category="$store.state.categories.items[categoryId]"
+ :categoryId="categoryId"
+ :currency="$store.state.currencies.base"
+ :key="categoryId"
+ :total="statCurrentPeriod.categories[categoryId].incomes"
+ :type="1"
+ )
+
+ //- Expenses
+ //---------------------------
+ template(v-if="statAverage.expenses !== 0")
+ .boxTitle {{ $t('money.expenses') }}
+
+ .boxSummary2
+ .boxSummary2__item
+ Amount(
+ :currency="$store.state.currencies.base"
+ :type="0"
+ :value="statCurrentPeriod.expenses.total"
+ size="xl"
+ vertical="left"
+ )
+ SummaryRowItemView(
+ :type="0"
+ :amount="statAverage.expenses"
+ :title="$t('money.averageExpenses')"
+ )
+
+ .boxEmpty(v-if="statCurrentPeriod.expenses.categoriesIds.length === 0") {{ $t('stat.empty') }}
+
+ //---------------------------
+ .box._stat(v-if="$store.state.ui.catsChart === 'visible' && statCurrentPeriod.expenses.categoriesIds.length > 0")
+ .box__content
+ PeriodCatsChart(type="expenses")
+
+ //---------------------------
+ .box._stat(v-if="$store.state.ui.statItems === 'visible' && statCurrentPeriod.expenses.categoriesIds.length > 0")
+ .box__content
+ LazyStatItem(
+ v-if="$store.state.ui.pc"
+ v-for="categoryId in statCurrentPeriod.expenses.categoriesIds"
+ :biggest="statCurrentPeriod.expenses.biggest"
+ :category="$store.state.categories.items[categoryId]"
+ :categoryId="categoryId"
+ :currency="$store.state.currencies.base"
+ :key="categoryId"
+ :total="statCurrentPeriod.categories[categoryId].expenses"
+ :type="0"
+ )
+ LazyStatItemMobile(
+ v-if="$store.state.ui.mobile"
+ v-for="categoryId in statCurrentPeriod.expenses.categoriesIds"
+ :biggest="statCurrentPeriod.expenses.biggest"
+ :category="$store.state.categories.items[categoryId]"
+ :categoryId="categoryId"
+ :currency="$store.state.currencies.base"
+ :key="categoryId"
+ :total="statCurrentPeriod.categories[categoryId].expenses"
+ :type="0"
+ )
+
+ //- Customize
+ //---------------------------
+ .box._periods
+ .periods
+ .periodItem(
+ @click="$store.dispatch('ui/toogleVisibleCatsChart')"
+ :class="{ _active: $store.state.ui.catsChart === 'visible' }"
+ ) {{ $t('stat.customize.showCategorisChart') }}
+ .periodItem(
+ :class="{ _active: $store.state.ui.statItems === 'visible' }"
+ @click="$store.dispatch('ui/toogleVisibilityStatItems')"
+ ) {{ $t('stat.customize.showCategorisList') }}
+
+ //- Stat
+ //-----------------------------------------------------------------------
+ template(v-if="activeTabViewName === 'incomes' || activeTabViewName === 'expenses'")
+ .page__wrap
+ //- Color Line Chart
+ //---------------------------
+ .box._line(
+ v-if="statCurrentPeriod[activeTabStat].categoriesIds.length > 1 && !this.$store.state.filter.categoryId"
+ )
+ PeriodCatsChart2(:type="activeTabStat")
+
+ //- Period Selector
+ //---------------------------
+ .box__nav
+ ContextMenu(
+ :position="{ right: '-50px', top: '38px' }"
+ :visible="isShowPeriodsNames"
+ @onClickOpener="isShowPeriodsNames = !isShowPeriodsNames"
+ )
+ template(slot="opener")
+ Dropdown._noBd.date(:active="isShowPeriodsNames")
+ template(slot="title")
+ Date(
+ :type="activeTabStat === 'incomes' ? 1 : 0"
+ )
+
+ template(slot="content")
+ ContextMenuItem(
+ :selected="$store.state.filter.period === 'day'"
+ :title="$t('dates.day.simple')"
+ icon="mdi mdi-weather-sunset-up"
+ @onClick="$store.dispatch('filter/setPeriod', 'day')"
+ @onClose="isShowPeriodsNames = !isShowPeriodsNames"
+ )
+ ContextMenuItem(
+ :selected="$store.state.filter.period === 'week'"
+ :title="$t('dates.week.simple')"
+ icon="mdi mdi-calendar-week"
+ @onClick="$store.dispatch('filter/setPeriod', 'week')"
+ @onClose="isShowPeriodsNames = !isShowPeriodsNames"
+ )
+ ContextMenuItem(
+ :selected="$store.state.filter.period === 'month'"
+ :title="$t('dates.month.simple')"
+ icon="mdi mdi-calendar"
+ @onClick="$store.dispatch('filter/setPeriod', 'month')"
+ @onClose="isShowPeriodsNames = !isShowPeriodsNames"
+ )
+ ContextMenuItem(
+ :selected="$store.state.filter.period === 'year'"
+ :title="$t('dates.year.simple')"
+ icon="mdi mdi-calendar-star"
+ @onClick="$store.dispatch('filter/setPeriod', 'year')"
+ @onClose="isShowPeriodsNames = !isShowPeriodsNames"
+ )
+ ContextMenuItem(
+ :selected="$store.state.filter.period === 'all'"
+ :title="$t('dates.all.simple')"
+ icon="mdi mdi-database"
+ @onClick="$store.dispatch('filter/setPeriod', 'all')"
+ @onClose="isShowPeriodsNames = !isShowPeriodsNames"
+ )
+
+ //-
+ //---------------------------
+ .boxSummary2._simple._pad
+ .boxSummary2__item
+ Amount(
+ :currency="$store.state.currencies.base"
+ :type="activeTabStat === 'incomes' ? 1 : 0"
+ :value="statCurrentPeriod[activeTabStat].total"
+ size="xl"
+ vertical="left"
+ )
+ SummaryRowItemView(
+ :type="activeTabStat === 'incomes' ? 1 : 0"
+ :amount="statAverage[activeTabStat]"
+ :title="activeTabStat === 'incomes' ? $t('money.averageIncomes') : $t('money.averageExpenses')"
+ )
+
+ .boxEmpty(v-if="statCurrentPeriod[activeTabStat].categoriesIds.length === 0") {{ $t('stat.empty') }}
+
+ .box(v-if="$store.state.ui.catsChart === 'visible' && statCurrentPeriod[activeTabStat].categoriesIds.length > 1")
+ //- .box__title Periods
+ .box__content
+ PeriodCatsChart(:type="activeTabStat")
+
+ .box(v-if="$store.state.ui.statItems === 'visible' && statCurrentPeriod[activeTabStat].categoriesIds.length > 1")
+ //- .box__title Categories
+ .box__content
+ LazyStatItem(
+ v-if="$store.state.ui.pc"
+ v-for="categoryId in statCurrentPeriod[activeTabStat].categoriesIds"
+ :biggest="statCurrentPeriod[activeTabStat].biggest"
+ :category="$store.state.categories.items[categoryId]"
+ :categoryId="categoryId"
+ :currency="$store.state.currencies.base"
+ :key="categoryId"
+ :total="statCurrentPeriod.categories[categoryId][activeTabStat]"
+ :type="activeTabStat === 'incomes' ? 1 : 0"
+ )
+ LazyStatItemMobile(
+ v-if="$store.state.ui.mobile"
+ v-for="categoryId in statCurrentPeriod[activeTabStat].categoriesIds"
+ :biggest="statCurrentPeriod[activeTabStat].biggest"
+ :category="$store.state.categories.items[categoryId]"
+ :categoryId="categoryId"
+ :currency="$store.state.currencies.base"
+ :key="categoryId"
+ :total="statCurrentPeriod.categories[categoryId][activeTabStat]"
+ :type="activeTabStat === 'incomes' ? 1 : 0"
+ )
+
+ .box._periods
+ .periods
+ .periodItem(
+ @click="$store.dispatch('ui/toogleVisibleCatsChart')"
+ :class="{ _active: $store.state.ui.catsChart === 'visible' }"
+ ) {{ $t('stat.customize.showCategorisChart') }}
+ .periodItem(
+ :class="{ _active: $store.state.ui.statItems === 'visible' }"
+ @click="$store.dispatch('ui/toogleVisibilityStatItems')"
+ ) {{ $t('stat.customize.showCategorisList') }}
+</template>
+
+<style lang="stylus">
+@import '~assets/stylus/variables'
+
+.highcharts-crosshair
+ cursor pointer
+
+.finapp .box .cats-chart__items
+ margin 0 (- $m7)
+ padding-top $m5
+ padding-right $m7
+ padding-bottom 0
+ padding-left $m7
+
+ &:before
+ left (- $m7)
+ background linear-gradient(to right, var(--c-bg-4), rgba(0,0,0,0))
+
+ &:after
+ right (- $m7)
+ background linear-gradient(to right, rgba(0,0,0,0), var(--c-bg-4))
+
+ &:before
+ &:after
+ z-index 10
+ content ''
+ position absolute
+ top 0
+ width $m7
+ height 100%
+
+.finapp .page__header
+ .filterRow
+ padding $m6
+
+ .filterItem
+ padding $m6 $m5
+
+.finapp .page__content .trnsList
+ .trnItem._history
+ margin-right (- $m6)
+ margin-left (- $m6)
+ padding-right $m7
+ padding-left $m7
+
+.finapp .page__content .dropdown._noBd
+ margin 0 $m2 !important
+ border-radius $m6
+</style>
+
+<style lang="stylus" scoped>
+@import '~assets/stylus/variables'
+
+.boxEmpty
+ padding 0 $m7
+ padding-top $m6
+ padding-bottom $m10
+ color var(--c-font-5)
+ font-size 10px
+
+.boxSummary2
+ z-index 9
+ position sticky
+ top 60px
+ display flex
+ align-items center
+ justify-content flex-start
+ margin-bottom $m3
+ padding 0 $m7
+ padding-bottom $m5
+ background var(--c-bg-4)
+
+ &._simple
+ top 42px
+ padding-top $m6
+
+ &._pad
+ top 38px
+
+ &._pad22
+ padding-top $m7
+
+ &__item
+ padding-right $m9
+
+.boxSummary
+ padding-top 8px
+ padding-bottom $m6
+
+.boxSwitcher
+ max-width 640px
+ margin 0 auto
+
+ .switcher2
+ .switcher2__item
+ +media-tablet()
+ padding $m7 $m6
+ font-size 14px
+ font-weight 400
+
+$border = 1px
+
+.periods
+ display flex
+ align-items center
+ margin -1px 0
+ background var(--c-bg-5)
+
+ +media-tablet()
+ background var(--c-bg-4)
+
+.periodItem
+ flex-grow 1
+ display flex
+ align-items center
+ justify-content center
+ min-width 50px
+ padding 12px $m6
+ color var(--c-font-5)
+ font-size 12px
+
+ &:active
+ background var(--c-bg-5)
+
+ &._active
+ color var(--c-font-3)
+
+ &__count
+ padding-right $m4
+
+.date
+ color var(--c-font-3)
+ font-size 18px
+ font-weight 600
+
+.switcher
+ overflow hidden
+ position relative
+ display flex
+ align-items stretch
+ justify-content stretch
+ margin 0 $m6
+
+ &__item
+ opacity .6
+ flex 1 1 1%
+ display flex
+ align-items center
+ justify-content center
+ padding $m6 $m5
+ color var(--c-font-4)
+ font-size 14px
+ border-radius $m7
+
+ +media-hover()
+ background var(--c-bg-3)
+
+ &:active
+ opacity 1
+ background var(--c-bg-3)
+
+ &._active
+ opacity 1
+ color var(--c-font-2)
+ background var(--c-bg-5)
+
+.week
+ display flex
+ align-items center
+ margin 0 (- $m6)
+ padding $m6 0
+ border 1px solid transparent
+ border-bottom-color var(--c-bg-5)
+
+ &:last-child
+ border-bottom-color transparent
+
+ &:active:not(._header._bottom)
+ background var(--c-bg-5)
+ border-radius $m5
+
+ &._active
+ background var(--c-bg-3)
+ border 1px solid var(--c-bg-6)
+ border-radius $m5
+
+ &._header
+ opacity .6
+ border-bottom-color var(--c-bg-7)
+ border-bottom-width 2px
+ margin-bottom $m4
+
+ &._bottom
+ opacity .6
+ border-top-color var(--c-bg-7)
+ border-top-width 2px
+ margin-top (- $m3)
+
+ > div
+ flex 1 0 1%
+ padding 0 $m6
+
+ &__name
+ color var(--c-font-2)
+ font-size 12px
+ text-transform capitalize
+
+ ~/._header &
+ font-weight 500
+
+ &:last-child
+ // padding-bottom 0
+
+.box2
+ position relative
+ margin $m7
+ margin-top $m9
+ margin-bottom $m7
+
+.boxNavItem
+ cursor pointer
+ padding 0 $m5
+ color var(--c-font-4)
+ font-size 32px
+ font-weight 400
+ transform translateY(-22px)
+ transition all .3s ease
+
+ &:active
+ background var(--c-bg-5)
+
+ &._disable
+ opacity .2
+
+ &._last
+ //
+
+.activrPeriodName
+ font-size 14px
+
+.boxTitle
+ z-index 9
+ position sticky
+ top 37px
+ display flex
+ align-items center
+ padding $m6 $m7
+ color var(--c-font-4)
+ font-size 10px
+ font-weight 600
+ text-transform uppercase
+ background var(--c-bg-4)
+
+// Box
+// ----------------------------------------------------------------------------
+.box
+ position relative
+ padding $m7 $m7
+ padding-bottom $m9
+ background var(--c-bg-4)
+
+ +media-tablet()
+ border-bottom 0
+
+ &._stat
+ padding-top $m6
+
+ &._h272
+ height 232px
+ padding-bottom 0
+ border-bottom 0
+
+ &._line
+ padding-top 0
+ padding-bottom $m6
+ border-bottom 0
+
+ &._nobd
+ padding 0
+
+ &._simple
+ padding-top $m7
+ padding-bottom $m7
+ border-bottom 0
+
+ &._periods
+ padding 0
+ padding-bottom $m6
+
+ &__title
+ &__title2
+ display flex
+ // display none
+ align-items center
+ padding-top $m5
+ padding-bottom $m8
+ color var(--c-font-4)
+ font-size 10px
+ font-weight 600
+ text-transform uppercase
+
+ &__title2
+ margin-left (- $m8)
+ padding-bottom 0
+ font-size 14px
+
+ &__title
+ z-index 9
+ position sticky
+ top 37px
+ padding-top $m6
+ padding-bottom $m6
+ background var(--c-bg-4)
+
+ &__nav
+ z-index 10
+ position sticky
+ top 0
+ display flex
+ justify-content center
+ height 38px
+ margin-bottom $m3
+ background var(--c-bg-4)
+
+ &._noMargin
+ margin-bottom 0
+
+ &__control
+ flex-grow 1
+ display flex
+ align-items center
+ justify-content flex-end
+ margin-top (- $m6)
+ color var(--c-font-3)
+ font-size 29px
+
+.page
+ overflow hidden
+ display grid
+ height 100%
+ max-width 900px
+ margin 0 auto
+ background var(--c-bg-4)
+ box-shadow 0 10px 30px 10px var(--c-bg-1)
+
+ &__line
+ width 90%
+ height 1px
+ margin 0 auto
+ // background var(--c-bg-3)
+
+ &__content
+ overflow hidden
+ overflow-y auto
+ scrollbar()
+ height 100%
+
+ &__grid
+ +media-tablet()
+ display grid
+ grid-template-columns repeat(auto-fill, minmax(300px, 1fr))
+ grid-column-gap 40px
+ grid-row-gap 40px
+ padding 40px
+
+ &__block
+ z-index 10
+ opacity .99
+ position sticky
+ top 0
+ width 100%
+ padding 0 0
+ // padding-top $m4
+ background var(--c-bg-3)
+ box-shadow 0 0 12px 5px rgba(0, 0, 0, .4)
+ transition all .3s ease
+
+ /.light-mode &
+ box-shadow 0 0 12px 5px rgba(120, 120, 120, .5)
+
+ &._hide
+ transform translateY(-100%)
+
+ &__header
+ overflow hidden
+ z-index 2
+ position fixed
+ bottom 44px
+ width 100%
+ background var(--c-bg-3)
+ transition all .3s ease
+ border-top 1px solid var(--c-bg-6)
+
+ &._hide
+ transform translateY(calc(100% + 56px))
+
+ &__period
+ padding $m6
+ padding-bottom 0
+
+ &__summary
+ flex-grow 1
+ display flex
+ align-items center
+ justify-content space-between
+ padding-bottom $m5
+ background var(--c-bg-3)
+
+ +media-tablet()
+ max-width 500px
+ margin 0 auto
+ padding $m8 0
+
+ &__nav
+ border-top 1px solid var(--c-bg-6)
+ border-bottom 1px solid var(--c-bg-6)
+
+ &._active
+ color var(--c-font-2)
+ border-bottom 2px solid var(--c-bg-9)
+
+.switcher2
+ display flex
+ align-items center
+
+ &._bg
+ overflow hidden
+ overflow-x auto
+ margin-bottom (- $border)
+ background var(--c-bg-3)
+
+.switcher2__item
+ cursor pointer
+ flex-grow 1
+ padding 12px $m7
+ color var(--c-font-5)
+ font-size 12px
+ font-weight 500
+ font-roboto()
+ text-align center
+ border-bottom $border solid var(--c-bg-5)
+
+ &:active
+ background var(--c-bg-5)
+ border-radius $m6 $m6 0 0
+ border-bottom $border solid var(--c-bg-5)
+
+ &._active
+ cursor default
+ color var(--c-font-3)
+ background none
+ border-bottom $border solid var(--c-blue-1)
+</style>
diff --git a/pages/login.vue b/pages/login.vue
index 0d14e511..b9733299 100644
--- a/pages/login.vue
+++ b/pages/login.vue
@@ -21,7 +21,7 @@ export default {
this.loading = true
const provider = new auth.GoogleAuthProvider()
auth()
- .signInWithPopup(provider)
+ .signInWithRedirect(provider)
.catch(e => this.notifyAboutError(e))
},
diff --git a/store/app/actions.js b/store/app/actions.js
index d8782cfa..ac4e78d8 100644
--- a/store/app/actions.js
+++ b/store/app/actions.js
@@ -19,7 +19,6 @@ export default {
if (rootState.user.user && rootState.user.user.uid && rootState.user.user.uid !== user.uid) {
dispatch('clearUserData')
}
- dispatch('trns/initOfflineTrns', null, { root: true })
await dispatch('user/initUser', user, { root: true })
await dispatch('currencies/initCurrencies', null, { root: true })
await dispatch('categories/initCategories', null, { root: true })
@@ -28,6 +27,8 @@ export default {
await dispatch('groups/initGroups', null, { root: true })
await dispatch('budgets/initBudgets', null, { root: true })
await dispatch('lang/initDbLang', null, { root: true })
+ dispatch('trns/uploadOfflineTrns', null, { root: true })
+
if (this.$router.currentRoute.name === 'login') {
this.app.context.redirect('/')
setTimeout(() => {
diff --git a/store/categories/getters.js b/store/categories/getters.js
index 6bba0367..b0e0a51b 100644
--- a/store/categories/getters.js
+++ b/store/categories/getters.js
@@ -8,7 +8,12 @@ export default {
return false
},
- categoriesRootIds (state, getters, rootState) {
+ categoriesIds (state, getters) {
+ if (!getters.hasCategories) { return [] }
+ return Object.keys(state.items)
+ },
+
+ categoriesRootIds (state, getters) {
if (!getters.hasCategories) { return [] }
return Object.keys(state.items)
diff --git a/store/chart/actions.js b/store/chart/actions.js
index 7eba374c..5d57b2df 100644
--- a/store/chart/actions.js
+++ b/store/chart/actions.js
@@ -8,7 +8,7 @@ export default {
if (!localPeriods) { return }
for (const periodName in localPeriods) {
- if (!localPeriods[periodName] || localPeriods[periodName].showedGroups) { return }
+ if (!localPeriods[periodName]) { return }
Number.isInteger(localPeriods[periodName].showedGroups)
? showedGroups = localPeriods[periodName].showedGroups
diff --git a/store/chart/index.js b/store/chart/index.js
index de557d79..0883fa01 100644
--- a/store/chart/index.js
+++ b/store/chart/index.js
@@ -18,7 +18,7 @@ const state = () => ({
groupedBy: 'month',
showedGroups: 3,
showedPeriods: 6,
- grouped: true
+ grouped: false
},
month: {
groupedBy: 'year',
@@ -29,7 +29,7 @@ const state = () => ({
year: {
groupedBy: 'year',
showedGroups: 2,
- showedPeriods: 2,
+ showedPeriods: 3,
grouped: false
}
}
diff --git a/store/currencies/index.js b/store/currencies/index.js
index 4ec4fd6d..c9deba47 100644
--- a/store/currencies/index.js
+++ b/store/currencies/index.js
@@ -1,10 +1,6 @@
import dayjs from 'dayjs'
-import actions from './actions'
-import getters from './getters'
-import mutations from './mutations'
-
-const state = () => ({
+export const state = () => ({
base: 'RUB',
date: dayjs().valueOf(),
rates: {},
@@ -12,10 +8,3 @@ const state = () => ({
show: false
}
})
-
-export default {
- state,
- actions,
- getters,
- mutations
-}
diff --git a/store/filter/index.js b/store/filter/index.js
index dc2689d8..1296abfb 100644
--- a/store/filter/index.js
+++ b/store/filter/index.js
@@ -1,19 +1,8 @@
import dayjs from 'dayjs'
-import actions from './actions'
-import getters from './getters'
-import mutations from './mutations'
-
-const state = () => ({
+export const state = () => ({
categoryId: null,
walletId: null,
date: dayjs().valueOf(),
period: 'month'
})
-
-export default {
- state,
- actions,
- getters,
- mutations
-}
diff --git a/store/periods/index.js b/store/periods/index.js
new file mode 100644
index 00000000..6d8485fe
--- /dev/null
+++ b/store/periods/index.js
@@ -0,0 +1,2 @@
+export const state = () => ({
+})
diff --git a/store/stat/getters.js b/store/stat/getters.js
index 2beb8bde..76226641 100644
--- a/store/stat/getters.js
+++ b/store/stat/getters.js
@@ -12,28 +12,33 @@ export default {
statAverage (state, getters, rootState) {
const statPeriods = getters.statByPeriods
- let notEmptyPeriods = 0
- if (statPeriods) {
- notEmptyPeriods = Object.keys(statPeriods).filter(id => statPeriods[id].total !== 0).length
- }
-
let incomes = 0
let expenses = 0
let total = 0
+ const periodsCounter = {
+ incomes: 0,
+ expenses: 0,
+ total: 0
+ }
for (const idx in statPeriods) {
const period = statPeriods[idx]
incomes = incomes + period.incomes
+ periodsCounter.incomes = periodsCounter.incomes + 1
+
expenses = expenses + period.expenses
+ periodsCounter.expenses = periodsCounter.expenses + 1
+
if (incomes > 0 && expenses > 0) {
total = incomes - expenses
+ periodsCounter.total = periodsCounter.total + 1
}
}
return {
- incomes: Math.ceil(incomes / notEmptyPeriods),
- expenses: Math.ceil(expenses / notEmptyPeriods),
- total: Math.ceil(total / notEmptyPeriods)
+ 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
}
},
@@ -49,23 +54,32 @@ export default {
statByPeriods (state, getters, rootState, rootGetters) {
const trns = rootState.trns.items
const transferCategoryId = rootGetters['categories/transferCategoryId']
- const diff = rootState.stat.showedPeriods
const trnsIds = rootGetters['trns/selectedTrnsIds']
+ const periodName = rootState.filter.period
+ if (periodName === 'all') { return }
- const periodGroup = rootState.filter.period
+ const oldestTrnDate = dayjs(trns[rootGetters['trns/firstCreatedTrnId']].date).endOf(periodName)
+ let periodsToShow = dayjs().endOf(periodName).diff(oldestTrnDate, periodName) + 1
+ periodsToShow = rootState.chart.periods[periodName].showedPeriods >= periodsToShow ? periodsToShow : rootState.chart.periods[periodName].showedPeriods
const stat = {}
- for (let period = 0; period < diff; period++) {
- const dateStartOfPeriod = dayjs().subtract(period, periodGroup).startOf(periodGroup)
- const dateEndOfPeriod = dayjs().subtract(period, periodGroup).endOf(periodGroup)
+ // Start from 1 to remove last period from average
+ for (let period = 1; period < periodsToShow; period++) {
+ const dateStartOfPeriod = dayjs().subtract(period, periodName).startOf(periodName)
+ 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))
+ .filter(trnId =>
+ trns[trnId].date >= dateStartOfPeriod &&
+ trns[trnId].date <= dateEndOfPeriod &&
+ trns[trnId].categoryId !== transferCategoryId
+ )
stat[dateStartOfPeriod.valueOf()] = {
date: dateStartOfPeriod.valueOf(),
...rootGetters['trns/getTotalOfTrnsIds'](ids)
}
}
+
return stat
},
@@ -102,12 +116,21 @@ export default {
getRootCategoryIdFromTrnId: (state, getters, rootState) => (trnId) => {
const trns = rootState.trns.items
const categories = rootState.categories.items
+ const wallets = rootState.wallets.items
const trnCategoryId = trns[trnId].categoryId
+
+ if (!wallets[trns[trnId].walletId]) {
+ console.log('no wallet for trn', trnId, trns[trnId])
+ console.log('walletId', trns[trnId].walletId)
+ console.log(`https://finapp-17474.firebaseio.com/users/${rootState.user.user.uid}/trns/${trnId}`)
+ }
+
if (!categories[trnCategoryId]) {
console.log('no category for trn', trnId, trns[trnId], categories[trnCategoryId])
console.log(`https://finapp-17474.firebaseio.com/users/${rootState.user.user.uid}/trns/${trnId}`)
return trnCategoryId
}
+
const trnCategoryParentId = categories[trnCategoryId].parentId
return trnCategoryParentId || trnCategoryId
},
diff --git a/store/stat/index.js b/store/stat/index.js
index ccbe6232..65c9d4e6 100644
--- a/store/stat/index.js
+++ b/store/stat/index.js
@@ -1,18 +1,7 @@
-import actions from './actions'
-import getters from './getters'
-import mutations from './mutations'
-
-const state = () => ({
+export const state = () => ({
showedPeriods: 10,
categoryModal: {
id: null,
- show: false
+ type: null
}
})
-
-export default {
- state,
- actions,
- getters,
- mutations
-}
diff --git a/store/stat/mutations.js b/store/stat/mutations.js
index 7148d8ba..58364a76 100644
--- a/store/stat/mutations.js
+++ b/store/stat/mutations.js
@@ -4,11 +4,8 @@ export default {
state.showedPeriods = number
},
- setCategoryModalId (state, id) {
+ setCategoryModal (state, { id, type }) {
state.categoryModal.id = id
- },
-
- setCategoryModalShow (state, value) {
- state.categoryModal.show = value
+ state.categoryModal.type = type
}
}
diff --git a/store/trnForm/index.js b/store/trnForm/index.js
index 02ac92e8..9e141aa7 100644
--- a/store/trnForm/index.js
+++ b/store/trnForm/index.js
@@ -1,6 +1,4 @@
import dayjs from 'dayjs'
-import actions from './actions'
-import mutations from './mutations'
export const baseModalState = {
calendar: false,
@@ -13,7 +11,7 @@ export const baseModalState = {
trn: false
}
-const state = () => ({
+export const state = () => ({
action: 'create',
height: 0,
@@ -39,9 +37,3 @@ const state = () => ({
walletId: null
}
})
-
-export default {
- state,
- actions,
- mutations
-}
diff --git a/store/trns/actions.js b/store/trns/actions.js
index 21120f9f..647f67dd 100644
--- a/store/trns/actions.js
+++ b/store/trns/actions.js
@@ -4,13 +4,22 @@ import dayjs from 'dayjs'
import {
removeTrnToAddLaterLocal,
saveTrnToAddLaterLocal,
- saveTrnToDeleteLaterLocal,
+ saveTrnIDforDeleteWhenClientOnline,
removeTrnToDeleteLaterLocal
} from './helpers'
import { db } from '~/services/firebaseConfig'
export default {
- // create new trn and save it to offline
+ /**
+ * Create new trn
+ * and save it to local storage when Client offline
+ *
+ * @param {object}
+ * @param {string} {}.id
+ * @param {object} {}.values
+ * @param {string} {}.values.amount
+ * @param {string} {}.values.category
+ */
addTrn ({ commit, rootState }, { id, values }) {
const uid = rootState.user.user.uid
const trns = rootState.trns.items
@@ -56,7 +65,7 @@ export default {
delete trns[id]
commit('setTrns', Object.freeze(trns))
localforage.setItem('finapp.trns', trns)
- saveTrnToDeleteLaterLocal(id)
+ saveTrnIDforDeleteWhenClientOnline(id)
db.ref(`users/${uid}/trns/${id}`)
.remove()
@@ -115,25 +124,51 @@ export default {
db.ref(`users/${uid}/trns`).off()
},
- initOfflineTrns ({ dispatch }) {
+ /**
+ * Add and delete trns with had been created in offline mode
+ *
+ * When user online
+ * get trns from local storage
+ * and add them to database
+ */
+ uploadOfflineTrns ({ dispatch, rootState }) {
+ console.log('uploadOfflineTrns')
db.ref('.info/connected').on('value', async (snap) => {
- const isConnected = snap.val()
+ // const isConnected = snap.val()
+ const isConnected = true
if (isConnected) {
- // add
- const trnsOfflineUpdate = await localforage.getItem('finapp.trns.offline.update') || {}
- for (const trnId in trnsOfflineUpdate) {
- if (trnsOfflineUpdate[trnId] && trnsOfflineUpdate[trnId].amount) {
+ console.log('isConnected')
+ const trnsArrayForDelete = await localforage.getItem('finapp.trns.offline.delete') || []
+ const trnsItemsForUpdate = await localforage.getItem('finapp.trns.offline.update') || {}
+
+ // delete trns
+ for (const trnId of trnsArrayForDelete) {
+ dispatch('deleteTrn', trnId)
+ delete trnsItemsForUpdate[trnId]
+ }
+
+ await localforage.setItem('finapp.trns.offline.update', trnsItemsForUpdate)
+
+ // add trns
+ for (const trnId in trnsItemsForUpdate) {
+ const wallet = rootState.wallets.items[trnsItemsForUpdate[trnId].walletId]
+ const category = rootState.categories.items[trnsItemsForUpdate[trnId].categoryId]
+
+ // delete trn from local storage if no wallet or category
+ if (!wallet || !category) {
+ delete trnsItemsForUpdate[trnId]
+ await localforage.setItem('finapp.trns.offline.update', trnsItemsForUpdate)
+ }
+
+ // add
+ else if (trnsItemsForUpdate[trnId] && trnsItemsForUpdate[trnId].amount) {
+ console.log('update', trnsItemsForUpdate[trnId])
dispatch('addTrn', {
id: trnId,
- values: trnsOfflineUpdate[trnId]
+ values: trnsItemsForUpdate[trnId]
})
}
}
- // delete
- const trnsOfflineDelete = await localforage.getItem('finapp.trns.offline.delete') || []
- for (const trnId of trnsOfflineDelete) {
- dispatch('deleteTrn', trnId)
- }
}
})
}
diff --git a/store/trns/getters.js b/store/trns/getters.js
index 64500ef3..e8c9c3ff 100644
--- a/store/trns/getters.js
+++ b/store/trns/getters.js
@@ -12,6 +12,7 @@ export default {
/**
* Return total amounts of trnsIds
+ * * Refactor params should be Object
*
* @param {Array} trnsIds
* @return {Object} return
@@ -196,7 +197,7 @@ export default {
getTrns: (state, getters, rootState) => (props) => {
if (!getters.hasTrns) { return [] }
- const { date, periodName, description, categoryId } = props
+ const { date, periodName, description, categoryId, type } = props
const categories = rootState.categories.items
const categoriesIds = Object.keys(categories)
const filterCategoryId = rootState.filter.categoryId || categoryId
@@ -210,6 +211,12 @@ export default {
const startDateValue = filterDate.startOf(filterPeriod).valueOf()
const endDateValue = filterDate.endOf(filterPeriod).valueOf()
+ // filter type
+ if (type) {
+ trnsIds = trnsIds
+ .filter(trnId => (trns[trnId].type === type))
+ }
+
// filter date
if (date && filterPeriod !== 'all') {
trnsIds = trnsIds
@@ -292,6 +299,7 @@ export default {
for (const categoryId of childCategoriesIds) {
if (trnCategoryId === categoryId) { return true }
}
+ return false
})
}
else {
diff --git a/store/trns/helpers.js b/store/trns/helpers.js
index 5b24b0e0..976ea8d8 100644
--- a/store/trns/helpers.js
+++ b/store/trns/helpers.js
@@ -19,8 +19,11 @@ export const removeTrnToAddLaterLocal = async (id) => {
}
// save deleted trn to local
-export const saveTrnToDeleteLaterLocal = 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
diff --git a/store/ui/actions.js b/store/ui/actions.js
index 810722f7..25293510 100644
--- a/store/ui/actions.js
+++ b/store/ui/actions.js
@@ -3,6 +3,11 @@ import localforage from 'localforage'
export default {
async initUi ({ commit, dispatch }) {
const uiLocalStore = await localforage.getItem('finapp.statActiveTab')
+ const activeTabViewName = await localforage.getItem('finapp.activeTabViewName')
+
+ if (activeTabViewName) {
+ commit('setActiveTabViewName', activeTabViewName)
+ }
// ui
if (uiLocalStore) {
@@ -17,6 +22,14 @@ export default {
dispatch('setUiView')
},
+ setActiveTabViewName ({ state, commit, dispatch }, value) {
+ if (state.activeTab !== value) {
+ commit('setActiveTabViewName', value)
+ localforage.setItem('finapp.activeTabViewName', value)
+ dispatch('ui/setUiView', null, { root: true })
+ }
+ },
+
/**
* Change theme
* Commit new theme and save to localStorage
@@ -146,8 +159,10 @@ export default {
const localName = 'finapp.statViewConfig'
const localFilterUi = await localforage.getItem(localName)
const walletName = rootState.filter.walletId || 'root'
+ const periodName = rootState.filter.period || 'month'
const categoryName = rootState.filter.categoryId || 'root'
- const uiItemName = `${walletName}${categoryName}`
+ const activeTabViewName = rootState.ui.activeTabViewName || 'expenses'
+ const uiItemName = `${walletName}${categoryName}${periodName}${activeTabViewName}`
await localforage.setItem(localName, {
...localFilterUi,
@@ -162,6 +177,9 @@ export default {
}
}
})
+
+ const periods = rootState.chart.periods
+ localforage.setItem('finapp.chart.periods', periods)
},
/**
@@ -171,8 +189,10 @@ export default {
const localName = 'finapp.statViewConfig'
const localFilterUi = await localforage.getItem(localName)
const walletName = rootState.filter.walletId || 'root'
+ const periodName = rootState.filter.period || 'month'
const categoryName = rootState.filter.categoryId || 'root'
- const uiItemName = `${walletName}${categoryName}`
+ const activeTabViewName = rootState.ui.activeTabViewName || 'expenses'
+ const uiItemName = `${walletName}${categoryName}${periodName}${activeTabViewName}`
if (localFilterUi && localFilterUi[uiItemName]) {
const localFilterUiItem = localFilterUi[uiItemName]
diff --git a/store/ui/index.js b/store/ui/index.js
index f53d1aef..6350bf68 100644
--- a/store/ui/index.js
+++ b/store/ui/index.js
@@ -14,7 +14,9 @@ const state = () => ({
activeTab: 'incomes',
averageStatVisibility: 'visible'
},
- width: 0
+
+ // Active tab for stat v2
+ activeTabViewName: 'incomes'
})
export default {
diff --git a/store/ui/mutations.js b/store/ui/mutations.js
index df91062a..030c8fab 100644
--- a/store/ui/mutations.js
+++ b/store/ui/mutations.js
@@ -1,7 +1,13 @@
export default {
+ // Active Tab in stat v2
+ setActiveTabViewName (state, tabViewName) {
+ state.activeTabViewName = tabViewName
+ },
+
setActiveTab (state, tabName) {
state.activeTab = tabName
},
+
setActiveTabStat (state, tabName) {
state.stat.activeTab = tabName
},
@@ -22,7 +28,6 @@ export default {
},
setVisibleCatsChart (state, status) {
- console.log('setVisibleCatsChart', status)
state.catsChart = status
},
diff --git a/store/wallets/index.js b/store/wallets/index.js
index 271f95ab..e50c1c2f 100644
--- a/store/wallets/index.js
+++ b/store/wallets/index.js
@@ -1,8 +1,4 @@
-import actions from './actions'
-import getters from './getters'
-import mutations from './mutations'
-
-const state = () => ({
+export const state = () => ({
items: {},
editId: null,
modal: {
@@ -10,10 +6,3 @@ const state = () => ({
id: null
}
})
-
-export default {
- state,
- actions,
- getters,
- mutations
-}
diff --git a/utils/formatDate.js b/utils/formatDate.js
index 3386a7bd..d899b6af 100644
--- a/utils/formatDate.js
+++ b/utils/formatDate.js
@@ -12,10 +12,10 @@ export const formatDate = (value, type) => {
return {
day: dayjs(+value).format('D'),
weekday: dayjs(+value).calendar(null, {
- sameDay: `[${currentLocale === 'ru' ? 'Сегодня' : 'Today'}] ddd`,
- nextDay: `[${currentLocale === 'ru' ? 'Завтра' : 'Tomorrow'}] ddd`,
+ sameDay: `[${currentLocale === 'ru' ? 'Сегодня' : 'Today'}] dddd`,
+ nextDay: `[${currentLocale === 'ru' ? 'Завтра' : 'Tomorrow'}] dddd`,
nextWeek: 'dddd',
- lastDay: `[${currentLocale === 'ru' ? 'Вчера' : 'Yesterday'}] ddd`,
+ lastDay: `[${currentLocale === 'ru' ? 'Вчера' : 'Yesterday'}] dddd`,
lastWeek: 'dddd',
sameElse: 'dddd'
}),