2018-08-23 15:55:53 +00:00
|
|
|
<template>
|
2018-08-27 14:21:36 +00:00
|
|
|
<div class="empty-state flex flex-column"
|
|
|
|
:class="{ 'bordered': bordered, 'align-center': centered, 'justify-center': centered }"
|
2018-08-23 15:55:53 +00:00
|
|
|
:style="{ height: height + 'px' }"
|
|
|
|
>
|
|
|
|
<p class="text-muted">{{ message }}</p>
|
2018-08-26 12:57:04 +00:00
|
|
|
<p v-if="action">
|
|
|
|
<button class="btn btn-default btn-xs"
|
|
|
|
@click="action.on_click"
|
|
|
|
>
|
|
|
|
{{ action.label }}
|
|
|
|
</button>
|
|
|
|
</p>
|
2018-08-23 15:55:53 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'empty-state',
|
|
|
|
props: {
|
|
|
|
message: String,
|
|
|
|
bordered: Boolean,
|
|
|
|
height: Number,
|
2018-08-27 14:21:36 +00:00
|
|
|
action: Object,
|
|
|
|
centered: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true
|
|
|
|
}
|
2018-08-23 15:55:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2018-08-27 14:21:36 +00:00
|
|
|
<style lang="less">
|
2018-08-23 17:12:41 +00:00
|
|
|
@import "../../../../../../frappe/frappe/public/less/variables.less";
|
|
|
|
|
|
|
|
.empty-state {
|
|
|
|
height: 500px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.empty-state.bordered {
|
|
|
|
border-radius: 4px;
|
|
|
|
border: 1px solid @border-color;
|
|
|
|
border-style: dashed;
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|