<template>
  <button
    v-bind:class="[componentClass]"
    v-on:click="onClickDeleteAllSelectedRow"
    v-if="selectedRowsCount > 0"
  >{{getLabel}} ({{selectedRowsCount}})</button>
</template>


<script>
import btnbase from "./c-btnbase";
import { mapActions } from "vuex";

export default {
  extends: btnbase,
  data: function () {
    return {
      componentClass: 'c-btn-clear-selected'
    };
  },
  methods: {
    ...mapActions("csAppWindowsUtils", ["deleteAllSelectedRow"]),
    onClickDeleteAllSelectedRow: async function() {
      await this.deleteAllSelectedRow(
        { 
          appWindowIdent: this.appWindowIdent, 
          dataSetIdent: this.dataSetIdent
        }
      );
    }
  }
};
</script>