mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-11-04 03:03:18 -05:00 
			
		
		
		
	* feat(frontend): ✨ add back support for assets * feat(backend): ✨ add back support for assets * feat(frontend): ✨ add support for recipe tools * feat(backend): ✨ add support for recipe tools * feat(frontend): ✨ add onHand support for recipe toosl * feat(backend): ✨ add onHand support for backend * refactor(frontend): ♻️ move items to recipe folder and break apart types * feat(frontend): ✨ add support for recipe comments * feat(backend): ✨ Add support for recipe comments * fix(backend): 💥 disable comments import * fix(frontend): 🐛 fix rendering issue with titles when moving steps * add tools to changelog * fix type errors Co-authored-by: hay-kot <hay-kot@pm.me>
		
			
				
	
	
		
			83 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
			
		
		
	
	
			83 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
<template>
 | 
						|
  <v-tooltip
 | 
						|
    ref="copyToolTip"
 | 
						|
    v-model="show"
 | 
						|
    color="success lighten-1"
 | 
						|
    top
 | 
						|
    :open-on-hover="false"
 | 
						|
    :open-on-click="true"
 | 
						|
    close-delay="500"
 | 
						|
    transition="slide-y-transition"
 | 
						|
  >
 | 
						|
    <template #activator="{ on }">
 | 
						|
      <v-btn
 | 
						|
        :icon="icon"
 | 
						|
        :color="color"
 | 
						|
        retain-focus-on-click
 | 
						|
        :class="btnClass"
 | 
						|
        @click="
 | 
						|
          on.click;
 | 
						|
          textToClipboard();
 | 
						|
        "
 | 
						|
        @blur="on.blur"
 | 
						|
      >
 | 
						|
        <v-icon>{{ $globals.icons.contentCopy }}</v-icon>
 | 
						|
        {{ icon ? "" : "Copy" }}
 | 
						|
      </v-btn>
 | 
						|
    </template>
 | 
						|
    <span>
 | 
						|
      <v-icon left dark>
 | 
						|
        {{ $globals.icons.clipboardCheck }}
 | 
						|
      </v-icon>
 | 
						|
      <slot> {{ $t("general.copied") }}! </slot>
 | 
						|
    </span>
 | 
						|
  </v-tooltip>
 | 
						|
</template>
 | 
						|
 | 
						|
<script>
 | 
						|
export default {
 | 
						|
  props: {
 | 
						|
    copyText: {
 | 
						|
      type: String,
 | 
						|
      default: "Default Copy Text",
 | 
						|
    },
 | 
						|
    color: {
 | 
						|
      type: String,
 | 
						|
      default: "",
 | 
						|
    },
 | 
						|
    icon: {
 | 
						|
      type: Boolean,
 | 
						|
      default: true,
 | 
						|
    },
 | 
						|
    btnClass: {
 | 
						|
      type: String,
 | 
						|
      default: "",
 | 
						|
    },
 | 
						|
  },
 | 
						|
  data() {
 | 
						|
    return {
 | 
						|
      show: false,
 | 
						|
    };
 | 
						|
  },
 | 
						|
 | 
						|
  methods: {
 | 
						|
    toggleBlur() {
 | 
						|
      this.$refs.copyToolTip.deactivate();
 | 
						|
    },
 | 
						|
    textToClipboard() {
 | 
						|
      this.show = true;
 | 
						|
      const copyText = this.copyText;
 | 
						|
      navigator.clipboard.writeText(copyText).then(
 | 
						|
        () => console.log(`Copied\n${copyText}`),
 | 
						|
        () => console.log(`Copied Failed\n${copyText}`)
 | 
						|
      );
 | 
						|
      setTimeout(() => {
 | 
						|
        this.toggleBlur();
 | 
						|
      }, 500);
 | 
						|
    },
 | 
						|
  },
 | 
						|
};
 | 
						|
</script>
 | 
						|
 | 
						|
<style lang="scss" scoped>
 | 
						|
</style> |