<template>
  <div class="base-row">
    <BaseDraggable
      :isRow="true"
      ref="baseDraggable"
      type="Row"
      :config="config"
      :data="info"
      :curId="curId"
      @itemClick="v => $emit('itemClick', v)" />
  </div>
</template>

<script>
import { baseComponentMixins } from '../mixins'

export default {
  name: 'BaseRow',
  mixins: [ baseComponentMixins ],
  props: {
    curId: [Number, String],
    config: {
      type: Object,
      default: () => ({}),
    },
  },
  created() {
    if (!this.info.schema) {
      this.$set(this.info, 'schema', [])
    }
  },
}
</script>

<style lang="scss" scoped>
.base-row {
  min-height: 58px;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px dashed #ccc;
  border-radius: 6px;
  position: relative;
  &::before {
    content: 'row';
    display: inline-block;
    font-size: 12px;
    line-height: 1;
    color: #ccc;
    position: absolute;
    left: 5px;
    top: 5px;
  }
}
</style>
