<template>
  <q-table
    row-key="id"
    :columns="columns"
    :data="data"
    wrap-cells
    :pagination.sync="pagination"
    :loading="loading"
    @request="onPageChange"
    @row-click="onRowClick"
  />
</template>

<script lang="ts">
import { Component, Emit, Prop } from 'vue-property-decorator';

@Component({})
export default class ULSearchResultTable {

  @Prop() data: Array<any>;
  @Prop() pagination;
  @Prop() loading;

  columns = [
    {
      align: 'left',
      label: 'Организация',
      field: 'fullName',
      name: 'fullName',
      style: 'white-space: normal;',
      required: true,
      headerStyle: 'font-weight: 600',
    },
    {
      align: 'left',
      label: 'ИНН',
      field: 'inn',
      name: 'inn',
      style: 'white-space: normal;',
      headerStyle: 'font-weight: 600',
    },
    {
      align: 'left',
      label: 'ОГРН',
      field: 'ogrn',
      name: 'ogrn',
      style: 'white-space: normal;',
      headerStyle: 'font-weight: 600',
    }
  ];

  @Emit('request')
  onPageChange() {
  }

  @Emit('row-click')
  onRowClick() {
  }

}

</script>
