<commit_before><template>
  <fieldset>
    <input
      v-for="option in options"
      :key="option.id"
      :value="option.value"
      :name="name"
      :checked="value === option.value"
      type="radio"
      @input="onInput($event.target.value)"
    >
  </fieldset>
</template>

<script>
import mapValueToElement from '../mixins/mapValueToElement';
import replaceSingleValueOnInput from '../mixins/replaceSingleValueOnInput';

export default {
  name: 'Frequency',

  mixins: [
    mapValueToElement,
    replaceSingleValueOnInput,
  ],

  props: {
    options: {
      type: Array,
      required: true,
    },
  },
};
</script><commit_msg>add dynamic classes support<commit_after><template>
  <ul
    :class="ulClass"
  >
    <li
      v-for="(option, index) in options"
      :key="option.id"
      :class="getClasses(option, 'li')"
    >
      <input
        :value="option.value"
        :name="name"
        :checked="value === option.value"
        :id="getLabelConnector(index)"
        class="hidden"
        type="radio"
        @input="onInput($event.target.value)"
      >
      <label
        :for="getLabelConnector(index)"
        :class="getClasses(option, 'label')"
      >
        {{ option.text }}
      </label>
    </li>
  </ul>
</template>

<script>
import mapValueToElement from '../mixins/mapValueToElement';
import replaceSingleValueOnInput from '../mixins/replaceSingleValueOnInput';

export default {
  name: 'Frequency',

  mixins: [
    mapValueToElement,
    replaceSingleValueOnInput,
  ],

  props: {
    options: {
      type: Array,
      required: true,
    },

    ulClass: {
      type: String,
      default: '',
    },
  },

  methods: {
    getLabelConnector(index) {
      return `${this.name}-${index}`;
    },

    getClasses(option, elName) {
      const { [`${elName}Classes`]: classes } = option;

      if (classes) {
        if (typeof classes === 'string') {
          return classes;
        } else if (Array.isArray(classes)) {
          return classes.join(' ');
        }
      }
      return '';
    },
  },
};
</script>
{'fraction_non_alphanumeric': 0.156985117618819, 'fraction_numerical': 0.0, 'mean_word_length': 2.399673735725938, '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': '5266289', 'n_tokens_mistral': 666, 'n_tokens_neox': 661, 'n_words': 120}