2020-01-30 04:37:25 +09:00
|
|
|
<template>
|
2023-05-14 11:43:56 +09:00
|
|
|
<div class="cpjygsrt">
|
2020-01-30 04:37:25 +09:00
|
|
|
<header>
|
|
|
|
<div class="title"><slot name="header"></slot></div>
|
|
|
|
<div class="buttons">
|
|
|
|
<slot name="func"></slot>
|
2021-11-19 19:36:12 +09:00
|
|
|
<button v-if="removable" class="_button" @click="remove()">
|
2022-12-19 19:01:30 +09:00
|
|
|
<i class="ti ti-trash"></i>
|
2020-01-30 04:37:25 +09:00
|
|
|
</button>
|
|
|
|
<button v-if="draggable" class="drag-handle _button">
|
2022-12-19 19:01:30 +09:00
|
|
|
<i class="ti ti-menu-2"></i>
|
2020-01-30 04:37:25 +09:00
|
|
|
</button>
|
2021-11-19 19:36:12 +09:00
|
|
|
<button class="_button" @click="toggleContent(!showBody)">
|
2022-12-19 19:01:30 +09:00
|
|
|
<template v-if="showBody"><i class="ti ti-chevron-up"></i></template>
|
|
|
|
<template v-else><i class="ti ti-chevron-down"></i></template>
|
2020-01-30 04:37:25 +09:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</header>
|
2020-04-16 23:13:33 +09:00
|
|
|
<div v-show="showBody" class="body">
|
2020-01-30 04:37:25 +09:00
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2023-05-14 11:43:56 +09:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { ref } from 'vue';
|
2023-04-01 14:01:57 +09:00
|
|
|
import { i18n } from '@/i18n';
|
2020-01-30 04:37:25 +09:00
|
|
|
|
2023-05-14 11:43:56 +09:00
|
|
|
const props = withDefaults(defineProps<{
|
|
|
|
expanded?: boolean;
|
|
|
|
removable?: boolean;
|
|
|
|
draggable?: boolean;
|
|
|
|
}>(), {
|
|
|
|
expanded: true,
|
|
|
|
removable: true,
|
2020-01-30 04:37:25 +09:00
|
|
|
});
|
2023-05-14 11:43:56 +09:00
|
|
|
|
|
|
|
const emit = defineEmits<{
|
|
|
|
(ev: 'toggle', show: boolean): void;
|
|
|
|
(ev: 'remove'): void;
|
|
|
|
}>();
|
|
|
|
|
|
|
|
const showBody = ref(props.expanded);
|
|
|
|
|
|
|
|
function toggleContent(show: boolean) {
|
|
|
|
showBody.value = show;
|
|
|
|
emit('toggle', show);
|
|
|
|
}
|
|
|
|
|
|
|
|
function remove() {
|
|
|
|
emit('remove');
|
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
</script>
|
|
|
|
|
2022-12-27 18:29:39 +09:00
|
|
|
<style lang="scss" scoped>
|
2020-01-30 04:37:25 +09:00
|
|
|
.cpjygsrt {
|
|
|
|
position: relative;
|
2021-03-02 22:57:16 +09:00
|
|
|
overflow: hidden;
|
2020-01-30 04:37:25 +09:00
|
|
|
background: var(--panel);
|
2020-07-05 03:49:58 +09:00
|
|
|
border: solid 2px var(--X12);
|
2022-12-24 11:57:06 +09:00
|
|
|
border-radius: 8px;
|
2020-01-30 04:37:25 +09:00
|
|
|
|
|
|
|
&:hover {
|
2020-07-05 03:49:58 +09:00
|
|
|
border: solid 2px var(--X13);
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
&.warn {
|
|
|
|
border: solid 2px #dec44c;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.error {
|
|
|
|
border: solid 2px #f00;
|
|
|
|
}
|
|
|
|
|
|
|
|
> header {
|
|
|
|
> .title {
|
|
|
|
z-index: 1;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0 16px;
|
|
|
|
line-height: 42px;
|
|
|
|
font-size: 0.9em;
|
|
|
|
font-weight: bold;
|
|
|
|
box-shadow: 0 1px rgba(#000, 0.07);
|
|
|
|
|
2021-04-20 23:22:59 +09:00
|
|
|
> i {
|
2020-01-30 04:37:25 +09:00
|
|
|
margin-right: 6px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:empty {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .buttons {
|
|
|
|
position: absolute;
|
|
|
|
z-index: 2;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
|
|
|
|
> button {
|
|
|
|
padding: 0;
|
|
|
|
width: 42px;
|
|
|
|
font-size: 0.9em;
|
|
|
|
line-height: 42px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.drag-handle {
|
|
|
|
cursor: move;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-16 23:13:33 +09:00
|
|
|
> .body {
|
2020-10-17 20:12:00 +09:00
|
|
|
::v-deep(.juejbjww), ::v-deep(.eiipwacr) {
|
2020-04-16 23:13:33 +09:00
|
|
|
&:not(.inline):first-child {
|
|
|
|
margin-top: 28px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:not(.inline):last-child {
|
|
|
|
margin-bottom: 20px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
|
|
|
</style>
|