2024-04-02 16:29:20 +08:00
|
|
|
<template>
|
|
|
|
<div ref="modal" class="modal" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false">
|
|
|
|
<div class="modal-dialog" role="document" :class="[{'!w-[900px]' : showingInfo}, {'!w-[600px]' : !showingInfo}]">
|
|
|
|
<div class="modal-content !p-0 bg-sn-white w-full h-full flex" :class="[{'flex-row': showingInfo}, {'flex-col': !showingInfo}]">
|
|
|
|
<div id="body-container" class="flex flex-row w-full h-full">
|
|
|
|
<!-- info -->
|
|
|
|
<div id="info-part">
|
|
|
|
<info-component
|
|
|
|
v-if="showingInfo"
|
2024-04-08 17:35:41 +08:00
|
|
|
:params="this.infoParams"
|
2024-04-02 16:29:20 +08:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<!-- content -->
|
|
|
|
<div id="content-part" class="flex flex-col w-full p-6 gap-3">
|
|
|
|
<!-- header -->
|
|
|
|
<div id="info-modal-header" class="flex flex-row h-fit w-full justify-between">
|
|
|
|
<div id="title-with-help" class="flex flex-row gap-3">
|
2024-04-08 17:35:41 +08:00
|
|
|
<h3 class="modal-title text-sn-dark-grey">{{ title }}</h3>
|
2024-04-02 16:29:20 +08:00
|
|
|
<button class="btn btn-light btn-sm" @click="showingInfo = !showingInfo">
|
|
|
|
<i class="sn-icon sn-icon-help-s"></i>
|
2024-04-08 17:35:41 +08:00
|
|
|
{{ helpText }}
|
2024-04-02 16:29:20 +08:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<button id="close-btn" type="button" class="close my-auto" data-dismiss="modal" aria-label="Close">
|
|
|
|
<i class="sn-icon sn-icon-close"></i>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<!-- main content -->
|
|
|
|
<div id="info-modal-main-content">
|
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import modalMixin from './modal_mixin';
|
|
|
|
import InfoComponent from './info_component.vue';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'InfoModal',
|
|
|
|
props: {
|
2024-04-08 17:35:41 +08:00
|
|
|
title: {
|
|
|
|
type: String, required: true
|
|
|
|
},
|
|
|
|
helpText: {
|
|
|
|
type: String, required: true
|
|
|
|
},
|
|
|
|
infoParams: {
|
2024-04-02 16:29:20 +08:00
|
|
|
type: Object,
|
|
|
|
required: true
|
2024-04-08 17:35:41 +08:00
|
|
|
},
|
|
|
|
startHidden: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
2024-04-02 16:29:20 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
mixins: [modalMixin],
|
|
|
|
components: {
|
|
|
|
'info-component': InfoComponent
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
showingInfo: true
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|