<commit_before>import { classes, getChildProps, getElementType } from '../../lib';

export default {
  name: 'SuiRating',
  binding: {
    prop: 'rating',
    event: 'changed',
  },
  props: {
    icon: String,
    maxRating: Number,
    rating: Number,
  },
  render() {
    const ElementType = getElementType(this);
    return (
      <ElementType
        {...getChildProps(this)}
        class={classes(
          'ui',
          this.icon,
          'rating',
        )}
        role="radiogroup"
      >
        {[...new Array(this.maxRating)].map((v, i) => {
          const active = this.rating > i;
          return (
            <i
              aria-checked={active.toString()}
              aria-posinset={i + 1}
              aria-setsize={this.maxRating}
              class={classes(active && 'active', 'icon')}
              tabindex="0"
              role="radio"
            />
          );<commit_msg>Add mouse over/leave to Rating<commit_after>import { classes, getChildProps, getElementType } from '../../lib';

export default {
  name: 'SuiRating',
  binding: {
    prop: 'rating',
    event: 'changed',
  },
  props: {
    icon: String,
    maxRating: Number,
    rating: Number,
  },
  data() {
    return {
      selected: 0,
    };
  },
  render() {
    const ElementType = getElementType(this);
    return (
      <ElementType
        {...getChildProps(this)}
        class={classes(
          'ui',
          this.icon,
          'rating',
        )}
        role="radiogroup"
      >
        {[...new Array(this.maxRating)].map((v, i) => {
          const elementValue = i + 1;
          const active = this.rating > i;
          const selected = this.selected > i;
          return (
            <i
              aria-checked={active.toString()}
              aria-posinset={elementValue}
              aria-setsize={this.maxRating}
              class={classes(active && 'active', selected && 'selected', 'icon')}
              tabindex="0"
              role="radio"
              onMouseover={() => {
                this.selected = elementValue;
              }}
              onMouseleave={() => {
                this.selected = 0;
              }}
            />
          );
{'fraction_non_alphanumeric': 0.1456354590682949, 'fraction_numerical': 0.0027137042062415195, 'mean_word_length': 1.5136363636363637, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 14, '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': '2736451', 'n_tokens_mistral': 646, 'n_tokens_neox': 629, 'n_words': 127}