{"size": 1127, "ext": "js", "max_stars_repo_path": "src/components/common/CartLike/CartLikeContentDetail/CartLikeContentDetail.js", "max_stars_repo_name": "MahdiMontgomery/sunrise-spa", "max_stars_repo_stars_event_min_datetime": "2018-06-28T12:54:35.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-21T07:40:38.000Z", "max_issues_repo_path": "src/components/common/CartLike/CartLikeContentDetail/CartLikeContentDetail.js", "max_issues_repo_name": "MahdiMontgomery/sunrise-spa", "max_issues_repo_issues_event_min_datetime": "2018-07-04T14:49:46.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-25T16:39:39.000Z", "max_forks_repo_path": "src/components/common/CartLike/CartLikeContentDetail/CartLikeContentDetail.js", "max_forks_repo_name": "MahdiMontgomery/sunrise-spa", "max_forks_repo_forks_event_min_datetime": "2018-08-01T13:12:45.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-02T13:39:44.000Z"}
{"max_stars_count": 46, "max_issues_count": 179, "max_forks_count": 69, "avg_line_length": 23.0, "max_line_length": 101, "alphanum_fraction": 0.6308784383}
import BasePrice from '../../BasePrice/BasePrice.vue';
import LineItemQuantityForm from '../../../cartdetail/LineItemQuantityForm/LineItemQuantityForm.vue';
import LineItemDeleteForm from '../../../cartdetail/LineItemDeleteForm/LineItemDeleteForm.vue';
import LineItemInfo from '../LineItemInfo/LineItemInfo.vue';
import { totalPrice } from '../../shared';

export default {
  components: {
    LineItemDeleteForm,
    LineItemQuantityForm,
    BasePrice,
    LineItemInfo,
  },
  props: {
    cartLike: {
      type: Object,
      required: true,
    },
    editable: {
      type: Boolean,
      default: true,
    },
    selectable: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      selectedReturnItems: [],
    };
  },
  watch: {
    selectedReturnItems() {
      this.$emit('update-selected-items', this.selectedReturnItems);
    },
  },
  methods: {
    totalPrice,
    selectReturnItem(id) {
      this.selectedReturnItems.push(id);
    },
    unselectReturnItem(id) {
      const i = this.selectedReturnItems.indexOf(id);
      this.selectedReturnItems.splice(i, 1);
    },
  },
};
