2018-08-23 06:52:20 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
2018-08-23 15:55:53 +00:00
|
|
|
<empty-state
|
|
|
|
v-if="items.length === 0"
|
|
|
|
:message="empty_state_message"
|
|
|
|
:bordered="true"
|
|
|
|
:height="80"
|
|
|
|
>
|
|
|
|
</empty-state>
|
2018-08-23 06:52:20 +00:00
|
|
|
<item-card
|
|
|
|
v-for="item in items"
|
|
|
|
:key="item[item_id]"
|
|
|
|
:item="item"
|
|
|
|
:is_local="is_local"
|
|
|
|
>
|
|
|
|
</item-card>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import ItemCard from './ItemCard.vue';
|
2018-08-23 15:55:53 +00:00
|
|
|
import EmptyState from './EmptyState.vue';
|
2018-08-23 06:52:20 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'item-cards-container',
|
2018-08-23 15:55:53 +00:00
|
|
|
props: {
|
|
|
|
'items': Array,
|
|
|
|
'is_local': Boolean,
|
|
|
|
|
|
|
|
'empty_state_message': String,
|
|
|
|
'empty_state_height': Number,
|
|
|
|
'empty_state_bordered': Boolean
|
|
|
|
},
|
2018-08-23 06:52:20 +00:00
|
|
|
components: {
|
2018-08-23 15:55:53 +00:00
|
|
|
ItemCard,
|
|
|
|
EmptyState
|
2018-08-23 06:52:20 +00:00
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
item_id() {
|
|
|
|
return this.is_local ? 'item_code' : 'hub_item_code';
|
|
|
|
}
|
2018-08-23 08:22:41 +00:00
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
items() {
|
|
|
|
frappe.dom.handle_broken_images($(this.$el));
|
|
|
|
}
|
2018-08-23 06:52:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped></style>
|