Ver código fonte

feat(treasury): add optional edit action to financial card

Opt-in pencil button that emits edit without triggering card selection.
ebagabee 1 dia atrás
pai
commit
173c6aa215
1 arquivos alterados com 15 adições e 2 exclusões
  1. 15 2
      src/components/financial/FinancialCard.vue

+ 15 - 2
src/components/financial/FinancialCard.vue

@@ -9,7 +9,19 @@
   >
     <div class="row justify-between items-start no-wrap">
       <span class="text-subtitle1 text-dark card-title">{{ title }}</span>
-      <q-icon :name="icon" size="22px" color="dark" />
+      <div class="row items-center no-wrap" style="gap: 4px">
+        <q-btn
+          v-if="editable"
+          flat
+          dense
+          round
+          size="sm"
+          icon="mdi-pencil-outline"
+          color="dark"
+          @click.stop="emit('edit')"
+        />
+        <q-icon :name="icon" size="22px" color="dark" />
+      </div>
     </div>
 
     <div class="bottom-area">
@@ -50,9 +62,10 @@ const props = defineProps({
   hideValues: { type: Boolean, default: false },
   clickable: { type: Boolean, default: false },
   selected: { type: Boolean, default: false },
+  editable: { type: Boolean, default: false },
 });
 
-const emit = defineEmits(["click"]);
+const emit = defineEmits(["click", "edit"]);
 
 const formattedValue = computed(() =>
   props.hideValues