Toggleable Panel
parent
344154e8fe
commit
f8edaffc7f
|
@ -13,11 +13,15 @@
|
||||||
width: 1.25em;
|
width: 1.25em;
|
||||||
line-height: 1.25em;
|
line-height: 1.25em;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-khtml-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-o-user-select: none;
|
||||||
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.p-panel .p-panel-titlebar-icon span {
|
.p-panel .p-panel-titlebar-icon span {
|
||||||
line-height: inherit;
|
line-height: inherit;
|
||||||
margin-top: -1px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.p-panel .p-panel-content {
|
.p-panel .p-panel-content {
|
||||||
|
@ -32,17 +36,22 @@
|
||||||
text-align:left;
|
text-align:left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.p-panel-content-wrapper-collapsed {
|
.p-panel-content-wrapper-enter,
|
||||||
overflow: hidden;
|
.p-panel-content-wrapper-leave-to {
|
||||||
max-height: 0;
|
max-height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p-panel-content-wrapper-enter-to,
|
||||||
|
.p-panel-content-wrapper-leave {
|
||||||
|
max-height: 1000px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p-panel-content-wrapper-leave-active {
|
||||||
|
overflow: hidden;
|
||||||
transition: max-height 0.5s cubic-bezier(0, 1, 0, 1);
|
transition: max-height 0.5s cubic-bezier(0, 1, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.p-panel-content-wrapper-expanded {
|
.p-panel-content-wrapper-enter-active {
|
||||||
max-height: 1000px;
|
overflow: hidden;
|
||||||
transition: max-height 1s ease-in-out;
|
transition: max-height 1s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
.p-panel-content-wrapper-expanding {
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
|
@ -4,12 +4,17 @@
|
||||||
<slot name="header">
|
<slot name="header">
|
||||||
<span class="p-panel-title" v-if="header">{{header}}</span>
|
<span class="p-panel-title" v-if="header">{{header}}</span>
|
||||||
</slot>
|
</slot>
|
||||||
|
<a v-if="toggleable" tabindex="0" class="p-panel-titlebar-icon p-panel-titlebar-toggler" @click="toggle">
|
||||||
|
<span :class="{'pi pi-minus': !d_collapsed, 'pi pi-plus': d_collapsed}"></span>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-panel-content-wrapper">
|
<transition name="p-panel-content-wrapper">
|
||||||
<div class="p-panel-content">
|
<div class="p-panel-content-wrapper" v-show="!d_collapsed">
|
||||||
<slot></slot>
|
<div class="p-panel-content">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</transition>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -17,7 +22,18 @@
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
header: String,
|
header: String,
|
||||||
toggleable: Boolean
|
toggleable: Boolean,
|
||||||
|
collapsed: Boolean
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
d_collapsed: this.collapsed
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
toggle() {
|
||||||
|
this.d_collapsed = !this.d_collapsed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content-section implementation">
|
<div class="content-section implementation">
|
||||||
|
<h3 class="first">Regular</h3>
|
||||||
<p-panel header="Godfather I">
|
<p-panel header="Godfather I">
|
||||||
The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding.
|
The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding.
|
||||||
His beloved son Michael has just come home from the war, but does not intend to become part of his father's business.
|
His beloved son Michael has just come home from the war, but does not intend to become part of his father's business.
|
||||||
|
@ -15,7 +16,8 @@
|
||||||
kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family.
|
kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family.
|
||||||
</p-panel>
|
</p-panel>
|
||||||
|
|
||||||
<p-panel header="Godfather I" style="margin-top:2em" :toggleable="true">
|
<h3>Toggleable</h3>
|
||||||
|
<p-panel header="Godfather I" :toggleable="true">
|
||||||
The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding.
|
The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding.
|
||||||
His beloved son Michael has just come home from the war, but does not intend to become part of his father's business.
|
His beloved son Michael has just come home from the war, but does not intend to become part of his father's business.
|
||||||
Through Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family,
|
Through Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family,
|
||||||
|
|
Loading…
Reference in New Issue