<commit_before>// Components
import VCard from '../VCard'
import VCheckbox from '../VCheckbox'
import VDivider from '../VDivider'
import VSubheader from '../VSubheader'
import {
  VList,
  VListTile,
  VListTileAction,
  VListTileContent,
  VListTileTitle
} from '../VList'

// Mixins
import Colorable from '../../mixins/colorable'
import Themeable from '../../mixins/themeable'

// Helpers
import {
  escapeHTML,
  getObjectValueByPath
} from '../../util/helpers'

export default {
  name: 'v-select-list',

  mixins: [
    Colorable,
    Themeable
  ],

  props: {
    action: Boolean,
    dense: Boolean,
    items: {
      type: Array,
      default: () => []
    },
    itemAvatar: {
      type: String,
      default: 'avatar'
    },
    itemDisabled: {
      type: String,
      default: 'disabled'
    },
    itemText: {
      type: String,
      default: 'text'
    },
    itemValue: {
      type: String,
      default: 'value'
    },
    noDataText: String,
    selectedItems: {
      type: Array,
      default: () => []
    }
  },

  computed: {
    tileActiveClass () {
      return Object.keys(this.addTextColorClassChecks()).join(' ')
    }
  },

  methods: {
    genAction (item, inputValue) {
      const data = {
        on: {
          click: e => {
            e.stopPropagation()
            this.$emit('select', item)
          }
        }
      }

      return this.$createElement(VListTileAction, data, [
        this.$createElement(VCheckbox, {
          props: {
            color: this.computedColor,
            inputValue
          }
        })
      ])
    },
    genDivider (props) {
      return this.$createElement(VDivider, { props })
    },
    genHeader (props) {
      return this.$createElement(VSubheader, { props }, props.header)
    },
    genTile (
      item,
      disabled,
      avatar = false,
      value = this.selectedItems.indexOf(item) !== -1
    ) {
      if (item === Object(item)) {
        avatar = this.getAvatar(item)
        disabled = disabled != null
          ? disabled
          : this.getDisabled(item)
      }

      const tile = {
        on: {
          click: () => disabled || this.$emit('select', item)
        },
        props: {
          activeClass: this.tileActiveClass,
          avatar,
          disabled,<commit_msg>fix(v-select-list): avatar prop requires boolean<commit_after>// Components
import VCard from '../VCard'
import VCheckbox from '../VCheckbox'
import VDivider from '../VDivider'
import VSubheader from '../VSubheader'
import {
  VList,
  VListTile,
  VListTileAction,
  VListTileContent,
  VListTileTitle
} from '../VList'

// Mixins
import Colorable from '../../mixins/colorable'
import Themeable from '../../mixins/themeable'

// Helpers
import {
  escapeHTML,
  getObjectValueByPath
} from '../../util/helpers'

export default {
  name: 'v-select-list',

  mixins: [
    Colorable,
    Themeable
  ],

  props: {
    action: Boolean,
    dense: Boolean,
    items: {
      type: Array,
      default: () => []
    },
    itemAvatar: {
      type: String,
      default: 'avatar'
    },
    itemDisabled: {
      type: String,
      default: 'disabled'
    },
    itemText: {
      type: String,
      default: 'text'
    },
    itemValue: {
      type: String,
      default: 'value'
    },
    noDataText: String,
    selectedItems: {
      type: Array,
      default: () => []
    }
  },

  computed: {
    tileActiveClass () {
      return Object.keys(this.addTextColorClassChecks()).join(' ')
    }
  },

  methods: {
    genAction (item, inputValue) {
      const data = {
        on: {
          click: e => {
            e.stopPropagation()
            this.$emit('select', item)
          }
        }
      }

      return this.$createElement(VListTileAction, data, [
        this.$createElement(VCheckbox, {
          props: {
            color: this.computedColor,
            inputValue
          }
        })
      ])
    },
    genDivider (props) {
      return this.$createElement(VDivider, { props })
    },
    genHeader (props) {
      return this.$createElement(VSubheader, { props }, props.header)
    },
    genTile (
      item,
      disabled,
      avatar = false,
      value = this.selectedItems.indexOf(item) !== -1
    ) {
      if (item === Object(item)) {
        avatar = !!this.getAvatar(item)
        disabled = disabled != null
          ? disabled
          : this.getDisabled(item)
      }

      const tile = {
        on: {
          click: () => disabled || this.$emit('select', item)
        },
        props: {
          activeClass: this.tileActiveClass,
          avatar,
          disabled,
{'fraction_non_alphanumeric': 0.13625566832217664, 'fraction_numerical': 0.0004318721658389117, 'mean_word_length': 1.8330275229357798, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '5200921', 'n_tokens_mistral': 1424, 'n_tokens_neox': 1422, 'n_words': 299}