<template>
  <sd-table
    :class="$style.wrapper"
    :columns="columns"
    sortable
    :pagination="false"
    :data-source.sync="data"
    :row-selection="{ columnWidth: 20 }"
  />
</template>

<script>
import components from './_import-components/sd-data-sort-import'

export default {
  name: 'SdDataSort',
  components,
  props: {
    columns: {
      type: Array,
      default: () => [],
    },
    loadData: {
      type: Function,
      required: true,
    },
  },
  data() {
    return {
      data: [],
    }
  },
  created() {
    this.loadData?.().then((data) => {
      this.data = data
    })
  },
  methods: {
    getData() {
      return this.data
    },
  },
}
</script>

<style module lang="scss">
@use '@/common/design' as *;
.wrapper {
  :global(.ant-checkbox-wrapper) {
    display: none;
  }
}
</style>
