<template>
  <table :class="[$style.tableLinkList,{[$style['style-stripe']]:tableStyle=='stripe'}]" :style="{marginTop: marginTop}">
    <thead :class="$style.thead">
      <slot name="thead"></slot>
    </thead>
    <tbody>
      <slot name="tbody"></slot>
    </tbody>
  </table>
</template>

<script>
export default {
  props: {
    tableStyle: {
      type: String,
      default: 'stripe'
    },
    marginTop: {
      type: String,
      default: 'default',
      required: false
    }
  }
}
</script>

<style module lang="scss">
.customScroll {
  padding: 0;
}
.wrapper {
  overflow-y: scroll;
  height: 500px;
  --ps-height: 500px;
  -ms-overflow-style: none;    /* IE, Edge 対応 */
  scrollbar-width: none;       /* Firefox 対応 */
  margin-top: 3rem;
}
.wrapper::-webkit-scrollbar {  /* Chrome, Safari 対応 */
  display:none;
}

.thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.tableLinkList {
  width: 100%;
  background-color: #fff;
  /* margin-top: 1rem; */
}

.tableLinkList tbody tr {
  cursor: pointer;
}

/* .tableLinkList thead,
.tableLinkList tbody {
  display: block;
  width: 100%;
  overflow-x: hidden;
  overflow-y: scroll;
}
.tableLinkList thead {
  width: 100%;
}
.tableLinkList tbody {
  height: 65rem;
  overflow-y: scroll;
} */
.tableLinkList th,
.tableLinkList td {
  padding: 1.7rem 0.6rem;
  border-bottom: 1px #f1effd solid;
  text-align: center;
  vertical-align: middle;
  font-size: 1.4rem;
}
.tableLinkList.style-stripe th,
.tableLinkList.style-stripe td {
  border-bottom: 1px #f3f2fe solid;
}
.tableLinkList.style-stripe tr:nth-child(even) td {
  background-color: #F1EFFD;
  /* border-bottom: #E5E1FB 1px solid; */
}
.tableLinkList th {
  background-color: #EEEBFD;
  /* border-bottom: #DCD9EF 1px solid; */
  font-weight: bold;
  text-align: center;
}
.tableLinkList td:nth-child(1) img {
  /* width: 100%; */
  border-radius: 0.4rem;
}
.tableLinkList__img {
  position: relative;
}
/* .tableLinkList th.-img {
  width: 22.3rem;
}
.tableLinkList th.-thumbnail01 {
  width: 8.2rem;
}
.tableLinkList th.-thumbnail02 {
  width: 21rem;
}
.tableLinkList th.-date {
  width: 17%;
}
.tableLinkList th.-name {
  width: 23.2%;
}
.tableLinkList th.-amount {
  width: 20%;
}
.tableLinkList th.-tag {
  width: 16%;
} */
.tableLinkList .m-postTag {
  white-space: nowrap;
}
/* .tableLinkList th.-status {
  width: 16%;
}
.tableLinkList th.-button {
  width: 9.9%;
}
.tableLinkList th.-button.-narrow {
  width: 7.2%;
} */
.tableLinkList select {
  background: url("~assets/images/shared/arrow-select.svg") right 1.5rem center
    no-repeat;
  border: 1px #e7e3fb solid;
  padding: 0.5rem 2.4rem 0.5rem 1.4rem;
}
.tableLinkList select:hover {
  background-color: #fff;
  background-size: 1rem auto;
  box-shadow: 0 0.1rem 0.5rem rgba(0, 0, 0, 0.1);
  border: 1px #bfb5f7 solid;
  border-radius: 3rem;
  cursor: pointer;
}
.tableLinkList td:last-child:before,
.tableLinkList td:last-child:after {
  width: 2.4rem;
  height: 2.4rem;
  content: "";
  background-position: center 0.65em;
  background-repeat: no-repeat;
  background-size: 1rem auto;
  display: inline-block;
  vertical-align: middle;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 2.5rem;
  border: 1px #969698 solid;
  border-radius: 50%;
  cursor: pointer;
  transition: opacity .3s ease;
}
.tableLinkList td:last-child:before {
  background-image: url("~assets/images/shared/arrow-next-short.svg");
}
.tableLinkList td:last-child:after {
  background-image: url("~assets/images/shared/arrow-next-short-white.svg");
  background-color: #2f2f33;
  border: 1px #2f2f33 solid;
  opacity: 0;
}
.tableLinkList tr:hover td:last-child:before {
  opacity: 0;
}
.tableLinkList tr:hover td:last-child:after {
  opacity: 1;
}
.tableLinkList tr:hover td:last-child:after,
.tableLinkList tr:hover td:last-child:after {

  display: block;
}
.tableLinkList td {
  background-color: #fff;
  position: relative;
}
/* .tableLinkList tr td:first-child {
  padding: 1.7rem 3rem;
} */

@include mq-pc {
  // .tableLinkList .tr {
  //   transition: 0.3s;
  // }
  // .tableLinkList .tr:hover {
  //   .thumbnail {
  //     opacity: 0.6;
  //   }
  // }
}
@include mq-sp {
  .tableLinkList td:last-child:before {
    display: none;
  }
  .tableLinkList td:last-child:after {
    display: none;
  }
}

</style>
