Open source personal finance application
Small refactor
Ilya Komichev6d535e484b39
diff --git a/src/components/settings/Settings.vue b/src/components/settings/Settings.vueindex 738a2f2d..858a33b8 100644--- a/src/components/settings/Settings.vue+++ b/src/components/settings/Settings.vue@@ -106,18 +106,29 @@ export default {max-width 380px&__group- padding-bottom $m10+ padding-bottom 48px+ &._paddingTop+ padding-top 48px++ &__item+ padding-bottom $m7+ &:last-child+ padding-bottom 0&__desc- padding-bottom $m5+ padding-bottom 8pxfont-size 14pxcolor var(--c-red-1)&__headerfont-header-4()+ font-weight 500+ font-size 24pxpadding-bottom $mn2&__subHeaderfont-header-1()- padding-bottom $m7+ font-size 16px+ font-weight 500+ padding-bottom 16px</style>diff --git a/src/components/shared/button/Button.vue b/src/components/shared/button/Button.vueindex 45b4efdd..7bbddb34 100644--- a/src/components/shared/button/Button.vue+++ b/src/components/shared/button/Button.vue@@ -1,9 +1,11 @@<script>import Icon from '@/components/icon/Icon'+import Checkbox from '@/components/shared/inputs/Checkbox'export default {components: {- Icon+ Icon,+ Checkbox},props: {@@ -22,6 +24,14 @@ export default {title: {type: String,default: null+ },+ showCheckbox: {+ type: Boolean,+ default: false+ },+ checkboxValue: {+ type: Boolean,+ default: false}}}@@ -36,6 +46,9 @@ export default {.d-button__icon(v-if="icon")div(:class="icon").d-button__title {{ title }}+ .d-button__check(v-if="showCheckbox" @click.prevent="")+ Checkbox._small(v-model="checkboxValue")+</template><style lang="stylus">@@ -81,10 +94,11 @@ export default {width 100%display flexalign-items center- // min-height 40pxpadding $m7 $m8color var(--c-font-2)cursor pointer+ border-radius $m3+ font-size 15pxanim-background()&:active@@ -94,7 +108,6 @@ export default {display inline-flexalign-items centerjustify-content center- // height 52pxfont-header-2()font-size 16pxcolor var(--c-font-1)@@ -108,7 +121,8 @@ export default {background var(--c-blue-2)&._bdb- border-bottom 1px solid var(--c-bg-5)+ padding 12px $m7+ border 1px solid var(--c-bg-5)&:hover@media $media-laptopbackground var(--c-bg-5)@@ -167,4 +181,8 @@ export default {font-size 20pxtext-align centeropacity .85++ &__check+ margin-left auto+ padding-left 32px</style>diff --git a/src/components/shared/contextMenu/ContextMenuItem.vue b/src/components/shared/contextMenu/ContextMenuItem.vueindex eda7889a..6af680ee 100644--- a/src/components/shared/contextMenu/ContextMenuItem.vue+++ b/src/components/shared/contextMenu/ContextMenuItem.vue@@ -1,5 +1,11 @@<script>+import Checkbox from '@/components/shared/inputs/Checkbox'+export default {+ components: {+ Checkbox+ },+props: {icon: {type: String,@@ -16,6 +22,14 @@ export default {selected: {type: Boolean,default: false+ },+ showCheckbox: {+ type: Boolean,+ default: false+ },+ checkboxValue: {+ type: Boolean,+ default: false}},@@ -35,6 +49,8 @@ export default {.item__icon(v-if="icon"): div(:class="icon").item__title {{ title }}.item__check(v-if="checkValue"): .mdi.mdi-check-circle-outline+ .item__check(v-if="showCheckbox" @click.prevent="")+ Checkbox._small(v-model="checkboxValue")</template><style lang="stylus" scoped>@@ -81,9 +97,6 @@ export default {color var(--c-font-3)&__check- opacity .80margin-left auto- padding-left $m7- color var(--c-incomes-1)- font-size 20px+ padding-left 32px</style>diff --git a/src/components/shared/dropdown/Dropdown.vue b/src/components/shared/dropdown/Dropdown.vueindex 427c0553..a4c649ad 100644--- a/src/components/shared/dropdown/Dropdown.vue+++ b/src/components/shared/dropdown/Dropdown.vue@@ -38,7 +38,6 @@ export default {margin-left autoborder-radius $m3font-size 16px- text-transform capitalize&._inlinedisplay inline-flexdiff --git a/src/components/shared/inputs/Checkbox.vue b/src/components/shared/inputs/Checkbox.vueindex a3715a64..a4020873 100644--- a/src/components/shared/inputs/Checkbox.vue+++ b/src/components/shared/inputs/Checkbox.vue@@ -8,7 +8,7 @@ export default {},title: {type: String,- required: true+ default: null}}}@@ -21,22 +21,30 @@ label.checkbox:checked="value"v-on:input="$emit('input', $event.target.checked)")- .checkbox__helper: .checkbox__toogle- .checkbox__title {{ title }}+ .checkbox__helper+ .checkbox__toogle+ .checkbox__toogle__item._on on+ .checkbox__toogle__item._off off+ .checkbox__title(v-if="title") {{ title }}</template><style lang="stylus" scoped>-$width = 3.4em-$height = 1.6em-$left = 1.8em-$color-rail = var(--c-font-2)-.checkboxposition relativedisplay flexalign-items centerfont-size 16px+ --width 3.4em+ --height 1.6em+ --left 1.8em+ $color-rail = var(--c-font-2)++ &._small+ --width 2.6em+ --height 1.2em+ --left 1.5em+&__titlepadding 0 1emfont-size 1em@@ -47,35 +55,38 @@ $color-rail = var(--c-font-2)&:checked+ .checkbox__helper:before- background var(--c-incomes-1)- box-shadow inset 0px 1px 1px rgba(84, 152, 140, 0.5)+ background var(--c-bg-1)+ box-shadow inset 0px 1px 1px background var(--c-bg-12)+ /.theme-light &+ background var(--c-bg-13)+ .checkbox__helper:afteranimation switch .2s ease-out- left $left+ left var(--left)&__helperflex-shrink 0position relative- width $width- height $height+ width var(--width)+ height var(--height)cursor pointer&:beforecontent ''position absolute- width $width- height $height+ width var(--width)+ height var(--height)left 0transition background 0.1s easebackground var(--c-bg-8)border-radius 50px+ top .5px// trail&:afterz-index 1content ''position absolute- width $height- height $height+ width var(--height)+ height var(--height)border-radius 50pxleft 0emtransition all 0.2s ease@@ -91,23 +102,27 @@ $color-rail = var(--c-font-2)top 0display flexalign-items center- width $width- height $height+ width var(--width)+ height var(--height)padding 0 .3empadding-top .1em+ ^[0]._small &+ padding-left .02em+ padding-right .02em- &:before- &:after+ &__itemflex 1 1color var(--c-font-2)font-size .7emtext-align centertext-transform uppercase+ ^[0]._small &+ font-size .5em/.theme-light &color var(--c-font-1)- &:before+ &._oncontent 'on'- &:after+ &._offcontent 'off'@keyframes switchdiff --git a/src/components/wallets/form/WalletForm.vue b/src/components/wallets/form/WalletForm.vueindex 86dc7bdc..f990898b 100644--- a/src/components/wallets/form/WalletForm.vue+++ b/src/components/wallets/form/WalletForm.vue@@ -185,15 +185,13 @@ export default {.form-line._p0._cleanCheckbox(v-model="wallet.countTotal"- title="Count amount of this wallet in total"- )+ title="Count amount of this wallet in total").form__actionsButton(className="_blue"title="Save wallet"- v-on:onClick="handleSubmit"- )+ v-on:onClick="handleSubmit")//- colorsModalBottom(@@ -218,8 +216,7 @@ export default {:center="true":show="showCurrencies"title="Select currency"- v-on:onClose="showCurrencies = false"- )+ v-on:onClose="showCurrencies = false").inputText.currencies.currencies__item(