<commit_before>import cloneDeep from 'clone-deep'
import deepEqual from 'deep-equal'
import { objectDiff } from '@/services/utils'

export default {
  props: {
    value: { required: true },
  },
  data () {
    return {
      edit: cloneDeep(this.value),
    }
  },
  watch: {
    value (current, previous) {
      // we want to make sure it's _really_ changed or we risk undoing the users changes
      if (current !== previous || !deepEqual(current, previous)) {
        this.reset()
      }
    },
  },<commit_msg>apply outside changes to edited values (#775)<commit_after>import cloneDeep from 'clone-deep'
import deepEqual from 'deep-equal'
import { objectDiff } from '@/services/utils'

export default {
  props: {
    value: { required: true },
  },
  data () {
    return {
      edit: cloneDeep(this.value),
    }
  },
  watch: {
    value (current, previous) {
      const changes = objectDiff(previous, current)
      this.edit = cloneDeep({ ...this.edit, ...changes })
    },
  },
{'fraction_non_alphanumeric': 0.13695871097683787, 'fraction_numerical': 0.0030211480362537764, 'mean_word_length': 2.779467680608365, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7624482', 'n_tokens_mistral': 308, 'n_tokens_neox': 300, 'n_words': 87}