<commit_before><template>
  <select v-selectpicker class="selectpicker" data-width="100%" :multiple="multiple" :data-actions-box="actions_box" data-none-selected-text="Ничего не выбрано" data-select-all-text="Выбрать всё"
          data-deselect-all-text="Отменить весь выбор">
    <option :value="option.value" v-for="option in options" :selected="option.value === val">{{ option.label }}</option>
  </select>
</template>

<script>
  export default {
    name: 'select-picker-m',
    props: {
      options: {
        type: Array,
        required: true
      },
      value: {},
      multiple: {
        type: Boolean,
        default: false
      },
      actions_box: {
        type: Boolean,
        default: false
      }
    },
    methods: {
      update_val(v) {
        this.$emit('input', v)
      }
    },
    created() {
      this.update_val(this.value)
    },
    directives: {
      selectpicker: {
        bind(el, binding, vnode) {
          let $el = $(el).parent().children('select')
          let v = vnode.context.value
          if (v === '-1' || !v) {
            if (vnode.context.multiple)
              v = []
            else if (vnode.context.options.length > 0)
              v = vnode.context.options[0].value
            else
              v = ''
          }
          if (vnode.context.multiple && !Array.isArray(v)) {
            v = v.split(',')
          } else if (!vnode.context.multiple && typeof v !== 'string' && !(v instanceof String)) {
            v = v.toString()
          }
          $el.selectpicker('val', v)
          vnode.context.update_val(v)
          $(el).change(function () {
            let lval = $(this).selectpicker('val')
            vnode.context.update_val(lval)
          })
        }
      }
    }
  }
</script>
<commit_msg>bugfix<commit_after><template>
  <select v-selectpicker class="selectpicker" data-width="100%" :multiple="multiple" :data-actions-box="actions_box" data-none-selected-text="Ничего не выбрано" data-select-all-text="Выбрать всё"
          data-deselect-all-text="Отменить весь выбор">
    <option :value="option.value" v-for="option in options" :selected="option.value === value">{{ option.label }}</option>
  </select>
</template>

<script>
  export default {
    name: 'select-picker-m',
    props: {
      options: {
        type: Array,
        required: true
      },
      value: {},
      multiple: {
        type: Boolean,
        default: false
      },
      actions_box: {
        type: Boolean,
        default: false
      }
    },
    methods: {
      update_val(v) {
        this.$emit('input', v)
      }
    },
    created() {
      this.update_val(this.value)
    },
    directives: {
      selectpicker: {
        bind(el, binding, vnode) {
          let $el = $(el).parent().children('select')
          let v = vnode.context.value
          if (v === '-1' || !v) {
            if (vnode.context.multiple)
              v = []
            else if (vnode.context.options.length > 0)
              v = vnode.context.options[0].value
            else
              v = ''
          }
          if (vnode.context.multiple && !Array.isArray(v)) {
            v = v.split(',')
          } else if (!vnode.context.multiple && typeof v !== 'string' && !(v instanceof String)) {
            v = v.toString()
          }
          $el.selectpicker('val', v)
          vnode.context.update_val(v)
          $(el).change(function () {
            let lval = $(this).selectpicker('val')
            vnode.context.update_val(lval)
          })
        }
      }
    }
  }
</script>

{'fraction_non_alphanumeric': 0.15711490075482248, 'fraction_numerical': 0.0033547665641599105, 'mean_word_length': 1.762934362934363, 'pattern_counts': {'":': 0, '<': 19, '<?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': '3083169', 'n_tokens_mistral': 1122, 'n_tokens_neox': 1123, 'n_words': 210}