added prettier

This commit is contained in:
Čarodej
2022-02-01 12:21:38 +01:00
parent 5ae875233b
commit b38b532cbe
284 changed files with 25410 additions and 25338 deletions

View File

@@ -1,55 +1,48 @@
<template>
<div class="ml-6 mb-6" :class="{'is-collapsed': ! isVisible, 'collapsable': canCollapse}">
<div @click="hideGroup" class="flex items-center justify-between mb-2">
<small class="text-xs font-bold dark:text-gray-700 text-gray-400">
{{ title }}
</small>
<chevron-up-icon v-if="canCollapseWrapper" size="12" class="mr-5 cursor-pointer vue-feather text-gray-300 transform" :class="{'rotate-180': ! isVisible}" />
<div class="ml-6 mb-6" :class="{ 'is-collapsed': !isVisible, collapsable: canCollapse }">
<div @click="hideGroup" class="mb-2 flex items-center justify-between">
<small class="text-xs font-bold text-gray-400 dark:text-gray-700">
{{ title }}
</small>
<chevron-up-icon v-if="canCollapseWrapper" size="12" class="vue-feather mr-5 transform cursor-pointer text-gray-300" :class="{ 'rotate-180': !isVisible }" />
</div>
<slot v-if="isVisible" />
<slot v-if="isVisible" />
</div>
</template>
<script>
import TextLabel from "../Others/TextLabel";
import { ChevronUpIcon } from 'vue-feather-icons'
import TextLabel from '../Others/TextLabel'
import { ChevronUpIcon } from 'vue-feather-icons'
export default {
name: 'ContentGroup',
props: [
'canCollapse',
'title',
'slug'
],
components: {
ChevronUpIcon,
TextLabel,
},
data() {
return {
isVisible: true,
canCollapseWrapper: false
}
},
methods: {
hideGroup() {
if (! this.canCollapseWrapper)
return
this.isVisible = !this.isVisible
localStorage.setItem('panel-group-' + this.slug, this.isVisible)
}
},
created() {
if (this.canCollapse) {
let savedVisibility = localStorage.getItem('panel-group-' + this.slug)
this.isVisible = savedVisibility ? !!JSON.parse(String(savedVisibility).toLowerCase()) : true
this.canCollapseWrapper = true
}
export default {
name: 'ContentGroup',
props: ['canCollapse', 'title', 'slug'],
components: {
ChevronUpIcon,
TextLabel,
},
data() {
return {
isVisible: true,
canCollapseWrapper: false,
}
}
},
methods: {
hideGroup() {
if (!this.canCollapseWrapper) return
this.isVisible = !this.isVisible
localStorage.setItem('panel-group-' + this.slug, this.isVisible)
},
},
created() {
if (this.canCollapse) {
let savedVisibility = localStorage.getItem('panel-group-' + this.slug)
this.isVisible = savedVisibility ? !!JSON.parse(String(savedVisibility).toLowerCase()) : true
this.canCollapseWrapper = true
}
},
}
</script>