<commit_before><!--
Created by Bane.Shi.
Copyright MoenSun
User: Bane.Shi
Date: 2017/1/13
Time: 09:33-->
<template>
  <tr v-show="show">
    <td v-for="(column,index) in columns"
        key="index"
        is="ms-grid-body-cell"
        :position="position"
        :tree-structure="treeStructure"
        :row-index="rowIndex"
        :cell-index="index"
        :record="record"
        :column="column" :ms-grid-id="msGridId" :has-left="hasLeft" >
    </td>
  </tr>
</template>
<script>
    import PropsMixin from "./mixins/PropsMixin";
    import MethodsMixin from "./mixins/MethodsMixin";

    import MsGridBodyCell from "./grid-body-cell.vue";
    import bus from "./GridEvents";
    export default {
      name:'ms-grid-body-row',
      mixins:[PropsMixin,MethodsMixin],
      data(){
        return {}
      },
      mounted(){

      },
      computed:{
        show:function(){
          let me = this;
          let record = me.record;
          let show = (record._parent?(record._parent._expanded && record._parent._show):true);
          bus.$emit('show-children',me.msGridId,me.rowIndex,show);
          return show;
        }
      },
      beforeUpdate(){

      },
      watch:{

      },
      methods:{
        toggle:function(){
          console.log("toggle");
        }
      },
      components: {
        MsGridBodyCell
      }
    }
</script>
<style>

</style><commit_msg>[Bane.Shi]<commit_after><!--
Created by Bane.Shi.
Copyright MoenSun
User: Bane.Shi
Date: 2017/1/13
Time: 09:33-->
<template>
  <tr v-show="show" :style="[heightStyleCompute]">
    <td v-for="(column,index) in columns"
        key="index"
        is="ms-grid-body-cell"
        :position="position"
        :tree-structure="treeStructure"
        :row-index="rowIndex"
        :cell-index="index"
        :record="record"
        :column="column" :ms-grid-id="msGridId" :has-left="hasLeft" >
    </td>
  </tr>
</template>
<script>
    import Vue from "vue";

    import PropsMixin from "./mixins/PropsMixin";
    import MethodsMixin from "./mixins/MethodsMixin";
    import LifecycleMixin from "./mixins/LifecycleMixin";

    import MsGridBodyCell from "./grid-body-cell.vue";
    import bus from "./GridEvents";
    export default {
      name:'ms-grid-body-row',
      mixins:[PropsMixin,MethodsMixin,LifecycleMixin],
      data(){
        return {}
      },
      computed:{
        show:function(){
          let me = this;
          let record = me.record;
          let show = (record._parent?(record._parent._expanded && record._parent._show):true);
          bus.$emit('show-children',me.msGridId,me.rowIndex,show);
          return show;
        },
        heightStyleCompute:function(){
          let me = this;
          if(me.componentReady && me.show){
            let trHeight = me.$el.clientHeight;
            if(me.record._height){
              if(me.record._height < trHeight){
                me.record._height = trHeight;
              }
            }else {
              Vue.set(me.record,'_height',trHeight);
            }
            return {height:me.record._height+"px"};
          }
        }
      },
      mounted(){
        let me = this;

      },
      beforeUpdate(){

      },
      methods:{
        setTrHeight:function(){
          let me = this;
          if(me.componentReady){
            let trHeight = me.$el.clientHeight;
            if(me.record._height){
             if(me.record._height < trHeight){
              me.record._height = trHeight;
             }
            }else {
              Vue.set(me.record,'_height',trHeight);
            }
          }
        }
      },
      components: {
        MsGridBodyCell
      }
    }
</script>
<style>

</style>
{'fraction_non_alphanumeric': 0.14975715056664868, 'fraction_numerical': 0.0059363194819212085, 'mean_word_length': 1.8581341557440247, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 25, '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': '2538353', 'n_tokens_mistral': 1169, 'n_tokens_neox': 1142, 'n_words': 203}