2020-01-29 13:37:25 -06:00
|
|
|
<template>
|
2020-10-17 06:12:00 -05:00
|
|
|
<MkModal ref="modal" @click="$emit('click')" @closed="$emit('closed')">
|
|
|
|
<div class="ebkgoccj _popup _narrow_" @keydown="onKeydown" :style="{ width: `${width}px`, height: height ? `${height}px` : null }">
|
2020-01-29 13:37:25 -06:00
|
|
|
<div class="header">
|
2020-10-17 06:12:00 -05:00
|
|
|
<button class="_button" v-if="withOkButton" @click="$emit('close')"><Fa :icon="faTimes"/></button>
|
2020-01-29 13:37:25 -06:00
|
|
|
<span class="title">
|
|
|
|
<slot name="header"></slot>
|
|
|
|
</span>
|
2020-10-17 06:12:00 -05:00
|
|
|
<button class="_button" v-if="!withOkButton" @click="$emit('close')"><Fa :icon="faTimes"/></button>
|
|
|
|
<button class="_button" v-if="withOkButton" @click="$emit('ok')" :disabled="okButtonDisabled"><Fa :icon="faCheck"/></button>
|
2020-01-29 13:37:25 -06:00
|
|
|
</div>
|
2020-10-17 06:12:00 -05:00
|
|
|
<div class="body" v-if="padding">
|
|
|
|
<div class="_section">
|
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="body" v-else>
|
2020-01-29 13:37:25 -06:00
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-10-17 06:12:00 -05:00
|
|
|
</MkModal>
|
2020-01-29 13:37:25 -06:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-10-17 06:12:00 -05:00
|
|
|
import { defineComponent } from 'vue';
|
2020-01-29 13:37:25 -06:00
|
|
|
import { faTimes, faCheck } from '@fortawesome/free-solid-svg-icons';
|
2020-10-17 06:12:00 -05:00
|
|
|
import MkModal from './modal.vue';
|
2020-01-29 13:37:25 -06:00
|
|
|
|
2020-10-17 06:12:00 -05:00
|
|
|
export default defineComponent({
|
2020-01-29 13:37:25 -06:00
|
|
|
components: {
|
2020-10-17 06:12:00 -05:00
|
|
|
MkModal
|
2020-01-29 13:37:25 -06:00
|
|
|
},
|
|
|
|
props: {
|
|
|
|
withOkButton: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
okButtonDisabled: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
default: false
|
|
|
|
},
|
2020-10-17 06:12:00 -05:00
|
|
|
padding: {
|
2020-01-29 13:37:25 -06:00
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
default: false
|
2020-04-21 10:34:56 -05:00
|
|
|
},
|
|
|
|
width: {
|
|
|
|
type: Number,
|
|
|
|
required: false,
|
|
|
|
default: 400
|
|
|
|
},
|
|
|
|
height: {
|
|
|
|
type: Number,
|
|
|
|
required: false,
|
2020-10-17 06:12:00 -05:00
|
|
|
default: null
|
2020-04-21 10:34:56 -05:00
|
|
|
},
|
2020-07-10 20:13:11 -05:00
|
|
|
canClose: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
default: true,
|
|
|
|
},
|
2020-01-29 13:37:25 -06:00
|
|
|
},
|
|
|
|
|
2020-10-17 06:12:00 -05:00
|
|
|
emits: ['click', 'close', 'closed', 'ok'],
|
|
|
|
|
2020-01-29 13:37:25 -06:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
faTimes, faCheck
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
close() {
|
|
|
|
this.$refs.modal.close();
|
|
|
|
},
|
|
|
|
|
|
|
|
onKeydown(e) {
|
|
|
|
if (e.which === 27) { // Esc
|
|
|
|
e.preventDefault();
|
|
|
|
e.stopPropagation();
|
|
|
|
this.close();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.ebkgoccj {
|
2021-03-02 07:57:16 -06:00
|
|
|
overflow: hidden;
|
2020-01-29 13:37:25 -06:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2020-10-17 06:12:00 -05:00
|
|
|
contain: content;
|
|
|
|
|
2021-04-09 22:40:50 -05:00
|
|
|
--root-margin: 24px;
|
2020-10-17 06:12:00 -05:00
|
|
|
|
|
|
|
@media (max-width: 500px) {
|
2021-04-09 22:40:50 -05:00
|
|
|
--root-margin: 16px;
|
2020-10-17 06:12:00 -05:00
|
|
|
}
|
2020-01-29 13:37:25 -06:00
|
|
|
|
|
|
|
> .header {
|
|
|
|
$height: 58px;
|
|
|
|
$height-narrow: 42px;
|
|
|
|
display: flex;
|
|
|
|
flex-shrink: 0;
|
2020-10-17 06:12:00 -05:00
|
|
|
box-shadow: 0px 1px var(--divider);
|
2020-01-29 13:37:25 -06:00
|
|
|
|
|
|
|
> button {
|
|
|
|
height: $height;
|
|
|
|
width: $height;
|
|
|
|
|
|
|
|
@media (max-width: 500px) {
|
|
|
|
height: $height-narrow;
|
|
|
|
width: $height-narrow;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .title {
|
|
|
|
flex: 1;
|
|
|
|
line-height: $height;
|
|
|
|
padding-left: 32px;
|
|
|
|
font-weight: bold;
|
|
|
|
white-space: nowrap;
|
2021-03-02 07:57:16 -06:00
|
|
|
overflow: hidden;
|
2020-01-29 13:37:25 -06:00
|
|
|
text-overflow: ellipsis;
|
|
|
|
pointer-events: none;
|
|
|
|
|
|
|
|
@media (max-width: 500px) {
|
|
|
|
line-height: $height-narrow;
|
|
|
|
padding-left: 16px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> button + .title {
|
|
|
|
padding-left: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .body {
|
|
|
|
overflow: auto;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|