Skip to content

Commit

Permalink
refactor(Price add): new Proof type form input (single button)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Dec 7, 2024
1 parent 5ba2210 commit 497b9a4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
4 changes: 4 additions & 0 deletions src/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
content:" *";
color: #F44336; /* red */
}

.v-btn-group--density-compact.v-btn-group {
height: 28px; /* default is 36px; match v-btn size="small" height */
}
21 changes: 10 additions & 11 deletions src/components/ProofTypeInputRow.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
<template>
<v-row>
<v-col cols="12">
<h3 class="required mb-1">
{{ $t('Common.Type') }}
</h3>
<v-item-group v-model="proofTypeForm.type" class="d-inline" mandatory>
<v-item v-for="pt in proofTypeList" :key="pt.key" v-slot="{ isSelected, toggle }" :value="pt.key">
<v-chip class="mr-1" :style="isSelected ? 'border: 1px solid #9E9E9E' : 'border: 1px solid transparent'" @click="toggle">
<v-icon start :icon="isSelected ? 'mdi-checkbox-marked-circle' : 'mdi-circle-outline'" />
{{ $t('ProofCard.' + pt.value) }}
</v-chip>
</v-item>
</v-item-group>
<v-btn-group divided density="compact" elevation="1" :style="proofTypeForm.type ? '' : 'border: 1px solid #F44336'">
<v-btn v-for="pt in proofTypeList" :key="pt.key" size="small" :value="pt.key" :prepend-icon="pt.icon" :style="isSelectedType(pt.key) ? 'border: 1px solid #4CAF50' : ''" @click="proofTypeForm.type = pt.key">
{{ $t('ProofCard.' + pt.value) }}
</v-btn>
</v-btn-group>
</v-col>
</v-row>
</template>
Expand All @@ -30,6 +24,11 @@ export default {
return {
proofTypeList: constants.PROOF_TYPE_LIST,
}
},
methods: {
isSelectedType(proofType) {
return this.proofTypeForm.type === proofType
}
}
}
</script>

0 comments on commit 497b9a4

Please sign in to comment.