2017-07-28 17:36:07 +00:00
|
|
|
<script>
|
2017-08-15 18:16:42 +00:00
|
|
|
export default {
|
2017-07-28 17:36:07 +00:00
|
|
|
name: 'popup-dialog',
|
|
|
|
|
|
|
|
props: {
|
2017-08-15 18:16:42 +00:00
|
|
|
title: {
|
|
|
|
type: String,
|
2017-10-24 13:48:41 +00:00
|
|
|
required: false,
|
2017-08-15 18:16:42 +00:00
|
|
|
},
|
2017-10-06 20:40:41 +00:00
|
|
|
text: {
|
2017-08-15 18:16:42 +00:00
|
|
|
type: String,
|
2017-10-12 09:55:11 +00:00
|
|
|
required: false,
|
2017-10-24 13:48:41 +00:00
|
|
|
},
|
|
|
|
hideFooter: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
default: false,
|
2017-08-15 18:16:42 +00:00
|
|
|
},
|
2017-07-28 17:36:07 +00:00
|
|
|
kind: {
|
|
|
|
type: String,
|
2017-08-15 18:16:42 +00:00
|
|
|
required: false,
|
2017-07-28 17:36:07 +00:00
|
|
|
default: 'primary',
|
|
|
|
},
|
2017-10-24 13:48:41 +00:00
|
|
|
modalDialogClass: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
default: '',
|
|
|
|
},
|
2017-10-12 21:04:17 +00:00
|
|
|
closeKind: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
default: 'default',
|
|
|
|
},
|
2017-07-28 17:36:07 +00:00
|
|
|
closeButtonLabel: {
|
|
|
|
type: String,
|
2017-08-15 18:16:42 +00:00
|
|
|
required: false,
|
2017-07-28 17:36:07 +00:00
|
|
|
default: 'Cancel',
|
|
|
|
},
|
|
|
|
primaryButtonLabel: {
|
|
|
|
type: String,
|
2017-08-15 18:16:42 +00:00
|
|
|
required: true,
|
2017-07-28 17:36:07 +00:00
|
|
|
},
|
2017-10-24 13:48:41 +00:00
|
|
|
submitDisabled: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
default: false,
|
|
|
|
},
|
2017-07-28 17:36:07 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
2017-08-15 18:16:42 +00:00
|
|
|
btnKindClass() {
|
|
|
|
return {
|
|
|
|
[`btn-${this.kind}`]: true,
|
|
|
|
};
|
2017-08-01 13:41:24 +00:00
|
|
|
},
|
2017-10-12 21:04:17 +00:00
|
|
|
btnCancelKindClass() {
|
|
|
|
return {
|
|
|
|
[`btn-${this.closeKind}`]: true,
|
|
|
|
};
|
|
|
|
},
|
2017-07-28 17:36:07 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
close() {
|
|
|
|
this.$emit('toggle', false);
|
|
|
|
},
|
2017-08-15 18:16:42 +00:00
|
|
|
emitSubmit(status) {
|
|
|
|
this.$emit('submit', status);
|
2017-08-01 13:41:24 +00:00
|
|
|
},
|
|
|
|
},
|
2017-07-28 17:36:07 +00:00
|
|
|
};
|
|
|
|
</script>
|
2017-08-15 18:16:42 +00:00
|
|
|
|
2017-07-28 17:36:07 +00:00
|
|
|
<template>
|
2017-10-24 13:48:41 +00:00
|
|
|
<div class="modal-open">
|
|
|
|
<div
|
|
|
|
class="modal popup-dialog"
|
|
|
|
role="dialog"
|
|
|
|
tabindex="-1"
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
:class="modalDialogClass"
|
|
|
|
class="modal-dialog"
|
|
|
|
role="document"
|
|
|
|
>
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<slot name="header">
|
|
|
|
<h4 class="modal-title pull-left">
|
|
|
|
{{this.title}}
|
|
|
|
</h4>
|
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
class="close pull-right"
|
|
|
|
@click="close"
|
|
|
|
aria-label="Close"
|
|
|
|
>
|
|
|
|
<span aria-hidden="true">×</span>
|
|
|
|
</button>
|
|
|
|
</slot>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
|
|
<slot name="body" :text="text">
|
|
|
|
<p>{{this.text}}</p>
|
|
|
|
</slot>
|
|
|
|
</div>
|
2017-10-31 19:02:11 +00:00
|
|
|
<div class="modal-footer" v-if="!hideFooter">
|
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
class="btn pull-left"
|
|
|
|
:class="btnCancelKindClass"
|
|
|
|
@click="close">
|
|
|
|
{{ closeButtonLabel }}
|
|
|
|
</button>
|
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
class="btn pull-right"
|
|
|
|
:disabled="submitDisabled"
|
|
|
|
:class="btnKindClass"
|
|
|
|
@click="emitSubmit(true)">
|
|
|
|
{{ primaryButtonLabel }}
|
|
|
|
</button>
|
|
|
|
</div>
|
2017-07-28 17:36:07 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-10-24 13:48:41 +00:00
|
|
|
<div class="modal-backdrop fade in" />
|
2017-07-28 17:36:07 +00:00
|
|
|
</div>
|
2017-08-01 13:41:24 +00:00
|
|
|
</template>
|