<template>
  <div class="multiple-radio" :style="iconStyleExtra">
    <WlRadioIcon
      v-if="!isSelect"
      :isChoosed="false"
      v-bind="$attrs"
      :style="`background-color: ${unSelectColor}`"
      @onClick="$emit('onClick')"
    />
    <div v-else class="multiple-radio-select" :style="`background-color: ${themeColor}`">
      <i
        v-if="selectIcon"
        :style="[{ backgroundColor: themeColor }, selectStyle]"
        class="iconfont"
        :class="selectIcon"
      ></i>
      <div v-else>{{ selectText }}</div>
    </div>
  </div>
</template>

<script>
/*
 * @Author: yangxin
 * @Date: 2021-09-18 18:23:35
 * @Last Modified by: yangxin
 * @Last Modified time: 2022-07-21 16:18:24
 */
import WlRadioIcon from "@packages/components/Common/WlRadioIcon/src/index.vue";
export default {
  name: "MultipleRadio",
  components: { WlRadioIcon },
  props: {
    isSelect: {
      type: Boolean,
      default: false,
    },
    themeColor: {
      type: String,
      default: "#1C9FFF",
    },
    unSelectColor: {
      type: String,
      default: "rgba(0,0,0,0.03)",
    },
    selectIcon: {
      type: String,
      default: "",
    },
    selectStyle: {
      type: Object,
      default: () => {},
    },
    selectText: {
      type: String,
      default: "1",
    },
    iconStyleExtra: {
      type: Object,
      default: () => {},
    },
  },
};
</script>

<style lang="scss" scoped>
.multiple-radio {
  width: j(20);
  height: j(20);
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  &-select {
    @include textEllipsis(1);
    width: 100%;
    height: 100%;
    color: white;
    text-align: center;
    div {
      height: 100%;
      @extend %flex-middle-center;
    }
  }
}
</style>
