Skip to content

Commit

Permalink
refactor(Dialogs): full height & width on mobile (#1193)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn authored Dec 30, 2024
1 parent 252c74b commit 3b5f6a9
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 8 deletions.
8 changes: 7 additions & 1 deletion src/components/BarcodeManualInputDialog.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-dialog max-height="80%" min-width="50%" width="auto">
<v-dialog scrollable :height="dialogHeight" :width="dialogWidth">
<v-card>
<v-card-title>
{{ $t('BarcodeManualInput.Title') }} <v-btn style="float:right;" variant="text" density="compact" icon="mdi-close" @click="close" />
Expand Down Expand Up @@ -47,6 +47,12 @@ export default {
}
},
computed: {
dialogHeight() {
return this.$vuetify.display.smAndUp ? '80%' : '100%'
},
dialogWidth() {
return this.$vuetify.display.smAndUp ? '80%' : '100%'
},
formFilled() {
return Object.values(this.barcodeForm).every(x => !!x)
}
Expand Down
8 changes: 7 additions & 1 deletion src/components/BarcodeScannerDialog.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-dialog scrollable min-height="50%" max-height="80%" min-width="50%">
<v-dialog scrollable :height="dialogHeight" :width="dialogWidth">
<v-card>
<v-card-title>
{{ $t('Common.ProductFind') }} <v-btn style="float:right;" variant="text" density="compact" icon="mdi-close" @click="close" />
Expand Down Expand Up @@ -116,6 +116,12 @@ export default {
},
computed: {
...mapStores(useAppStore),
dialogHeight() {
return this.$vuetify.display.smAndUp ? '80%' : '100%'
},
dialogWidth() {
return this.$vuetify.display.smAndUp ? '80%' : '100%'
},
displayItems() {
if (this.hideBarcodeScannerTab) {
return constants.PRODUCT_SELECTOR_DISPLAY_LIST.filter(item => item.key !== constants.PRODUCT_SELECTOR_DISPLAY_LIST[0].key)
Expand Down
8 changes: 7 additions & 1 deletion src/components/LocationSelectorDialog.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-dialog scrollable height="80%" width="80%">
<v-dialog scrollable :height="dialogHeight" :width="dialogWidth">
<v-card>
<v-card-title>
{{ $t('Common.LocationFindShop') }} <v-btn
Expand Down Expand Up @@ -176,6 +176,12 @@ export default {
},
computed: {
...mapStores(useAppStore),
dialogHeight() {
return this.$vuetify.display.smAndUp ? '80%' : '100%'
},
dialogWidth() {
return this.$vuetify.display.smAndUp ? '80%' : '100%'
},
recentLocations() {
return this.appStore.getRecentLocations()
},
Expand Down
10 changes: 9 additions & 1 deletion src/components/PriceDeleteConfirmationDialog.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-dialog scrollable max-height="80%" min-width="50%" width="auto">
<v-dialog scrollable :height="dialogHeight" :width="dialogWidth">
<v-card>
<v-card-title>
{{ $t('PriceDelete.Title') }} <v-btn style="float:right;" variant="text" density="compact" icon="mdi-close" @click="closeDialog" />
Expand Down Expand Up @@ -56,6 +56,14 @@ export default {
loading: false,
}
},
computed: {
dialogHeight() {
return this.$vuetify.display.smAndUp ? '80%' : '100%'
},
dialogWidth() {
return this.$vuetify.display.smAndUp ? '80%' : '100%'
},
},
methods: {
deletePrice() {
this.loading = true
Expand Down
10 changes: 9 additions & 1 deletion src/components/PriceEditDialog.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-dialog scrollable max-height="80%" min-width="50%" width="auto">
<v-dialog scrollable :height="dialogHeight" :width="dialogWidth">
<v-card>
<v-card-title>
{{ $t('PriceEdit.Title') }} <v-btn style="float:right;" variant="text" density="compact" icon="mdi-close" @click="close" />
Expand Down Expand Up @@ -86,6 +86,14 @@ export default {
loading: false
}
},
computed: {
dialogHeight() {
return this.$vuetify.display.smAndUp ? '80%' : '100%'
},
dialogWidth() {
return this.$vuetify.display.smAndUp ? '80%' : '100%'
},
},
mounted() {
this.initUpdatePriceForm()
},
Expand Down
8 changes: 7 additions & 1 deletion src/components/ProofDeleteConfirmationDialog.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-dialog scrollable max-height="80%" min-width="50%" width="auto">
<v-dialog scrollable :height="dialogHeight" :width="dialogWidth">
<v-card>
<v-card-title>
{{ $t('ProofDelete.Title') }} <v-btn style="float:right;" variant="text" density="compact" icon="mdi-close" @click="closeDialog" />
Expand Down Expand Up @@ -53,6 +53,12 @@ export default {
}
},
computed: {
dialogHeight() {
return this.$vuetify.display.smAndUp ? '80%' : '100%'
},
dialogWidth() {
return this.$vuetify.display.smAndUp ? '80%' : '100%'
},
},
methods: {
deleteProof() {
Expand Down
8 changes: 7 additions & 1 deletion src/components/ProofEditDialog.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-dialog scrollable max-height="80%" min-width="50%" width="auto">
<v-dialog scrollable :height="dialogHeight" :width="dialogWidth">
<v-card>
<v-card-title>
{{ $t('ProofEdit.Title') }} <v-btn style="float:right;" variant="text" density="compact" icon="mdi-close" @click="close" />
Expand Down Expand Up @@ -67,6 +67,12 @@ export default {
}
},
computed: {
dialogHeight() {
return this.$vuetify.display.smAndUp ? '80%' : '100%'
},
dialogWidth() {
return this.$vuetify.display.smAndUp ? '80%' : '100%'
},
formFilled() {
let keys = ['type', 'date', 'currency']
return Object.values(this.updateProofForm).filter(k => keys.includes(k)).every(k => !!this.updateProofForm[k])
Expand Down
8 changes: 7 additions & 1 deletion src/components/UserRecentProofsDialog.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-dialog scrollable height="80%" width="80%">
<v-dialog scrollable :height="dialogHeight" :width="dialogWidth">
<v-card>
<v-card-title>
{{ $t('UserRecentProofsDialog.SelectRecentProof') }} <v-btn style="float:right;" variant="text" density="compact" icon="mdi-close" @click="close" />
Expand Down Expand Up @@ -57,6 +57,12 @@ export default {
username() {
return this.appStore.user.username
},
dialogHeight() {
return this.$vuetify.display.smAndUp ? '80%' : '100%'
},
dialogWidth() {
return this.$vuetify.display.smAndUp ? '80%' : '100%'
},
getProofParams() {
let defaultParams = { owner: this.username, page: this.userProofPage }
if (this.filterType) {
Expand Down

0 comments on commit 3b5f6a9

Please sign in to comment.