forked from EnergySage/es-ds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEsModal.vue
99 lines (93 loc) · 2.01 KB
/
EsModal.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<template>
<b-modal
:id="id"
:size="size"
:scrollable="scrollable"
:visible="visible"
title-class="h2"
:hide-footer="hideFooter"
centered
static
class="modal-lightbox"
v-bind="$attrs"
v-on="$listeners">
<template #modal-title>
<slot name="modal-title" />
</template>
<template #modal-header-close>
<x-icon
class="text-gray-900"
height="2rem"
width="2rem" />
</template>
<slot />
<template #modal-footer>
<slot name="modal-footer" />
</template>
</b-modal>
</template>
<script lang="js">
import { BModal } from 'bootstrap-vue';
import XIcon from '../lib-icons/icon-x.vue';
export default {
name: 'EsModal',
components: {
BModal,
XIcon,
},
props: {
/**
* ID
*/
id: {
type: String,
required: true,
},
/**
* Size
*/
size: {
type: String,
default: 'md',
validator: (val) => ['sm', 'md', 'lg', 'xl'].includes(val),
},
/**
* Scrollable
*/
scrollable: {
type: Boolean,
default: true,
},
/**
* Visible
*/
visible: {
type: Boolean,
default: false,
},
/**
* Hide Footer
*/
hideFooter: {
type: Boolean,
default: false,
},
},
};
</script>
<style lang="scss">
@use "~@energysage/es-bs-base/scss/mixins/breakpoints" as breakpoints;
// TODO: Move this into es-bs-base ?
.modal-lightbox {
@include breakpoints.media-breakpoint-down(md) {
.modal-dialog {
margin: 0;
min-height: 100%;
min-width: 100%;
.modal-content {
border-radius: 0;
}
}
}
}
</style>