<commit_before><template>
  <div class="v-input" :class="{effect: effect}">
    <div class="hidden-value" v-if="resize">{{content}}</div>
    <input class="input" :style="`min-width: ${width}px;`" :type="type" :name="name" v-model="content" :step="step" :min="min" :max="max"
           :placeholder="placeholder" :required="required" autocomplete="off" :disabled="disabled" :readonly="readonly"
           @keypress.enter="pressEnter">
    <hr v-if="effect">
  </div>
</template>

<script>
  export default {
    name: 'v-input',
    data() {
      return {
        width: this.resize ? 0 : undefined,
        content: this.value
      }
    },
    props: {
      value: [String, Number],
      effect: Boolean,
      type: String,
      name: String,
      placeholder: String,
      required: Boolean,
      disabled: Boolean,
      step: String,
      min: String,
      max: String,
      focus: Boolean,
      resize: Boolean,
      readonly: Boolean
    },
    watch: {
      value(val) {
        this.content = val
      },
      content(val) {
        this.resize && this.updateSize()
        this.$emit('input', val)<commit_msg>improve: Add props: pattern, minlength, maxlength<commit_after><template>
  <div class="v-input" :class="{effect: effect}">
    <div class="hidden-value" v-if="resize">{{content}}</div>
    <input class="input" :style="`min-width: ${width}px;`" :type="type" :name="name" v-model="content" :step="step" :min="min" :max="max"
           :placeholder="placeholder" :pattern="pattern" :required="required" autocomplete="off" :disabled="disabled" :readonly="readonly"
           :minlength="minlength" :maxlength="maxlength" @keypress.enter="pressEnter">
    <hr v-if="effect">
  </div>
</template>

<script>
  export default {
    name: 'v-input',
    data() {
      return {
        width: this.resize ? 0 : undefined,
        content: this.value
      }
    },
    props: {
      value: [String, Number],
      effect: Boolean,
      type: String,
      name: String,
      placeholder: String,
      pattern: String,
      required: Boolean,
      disabled: Boolean,
      step: String,
      min: [Number, String],
      max: [Number, String],
      minlength: [Number, String],
      maxlength: [Number, String],
      focus: Boolean,
      resize: Boolean,
      readonly: Boolean
    },
    watch: {
      value(val) {
        this.content = val
      },
      content(val) {
        this.resize && this.updateSize()
        this.$emit('input', val)
{'fraction_non_alphanumeric': 0.1670682730923695, 'fraction_numerical': 0.0008032128514056225, 'mean_word_length': 2.657856093979442, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '5798073', 'n_tokens_mistral': 781, 'n_tokens_neox': 763, 'n_words': 173}