use background color

This commit is contained in:
Pete Matsyburka committed 2026-09-23 11:00:17 +03:00
1 parent eafae4cda2
commit 827850646d
2 files changed
+16 -1

No files matched your search

@@ -30,6 +30,7 @@
side="left" side="left"
:inline="isDocumentsView" :inline="isDocumentsView"
:open="isDocumentsDrawerOpen" :open="isDocumentsDrawerOpen"
:background-color="backgroundColor"
@close="isDocumentsDrawerOpen = false" @close="isDocumentsDrawerOpen = false"
> >
<div class="pt-3 space-y-3"> <div class="pt-3 space-y-3">
@@ -62,6 +63,7 @@
v-if="editable && (withUploadButton || withAddPageButton)" v-if="editable && (withUploadButton || withAddPageButton)"
class="pt-3 space-y-2" class="pt-3 space-y-2"
:class="isDocumentsView ? 'pb-6' : 'sticky bottom-0 bg-base-100 pb-3'" :class="isDocumentsView ? 'pb-6' : 'sticky bottom-0 bg-base-100 pb-3'"
:style="['', null, 'transparent'].includes(backgroundColor) ? {} : { backgroundColor }"
> >
<Upload <Upload
v-if="withUploadButton" v-if="withUploadButton"
@@ -93,6 +95,7 @@
side="right" side="right"
:inline="isFieldsView" :inline="isFieldsView"
:open="isFieldsDrawerOpen" :open="isFieldsDrawerOpen"
:background-color="backgroundColor"
class="md:hidden" class="md:hidden"
@close="isFieldsDrawerOpen = false" @close="isFieldsDrawerOpen = false"
> >
@@ -114,6 +117,7 @@
:default-required-fields="defaultRequiredFields" :default-required-fields="defaultRequiredFields"
:detect-custom-fields-index="detectCustomFieldsIndex" :detect-custom-fields-index="detectCustomFieldsIndex"
:field-types="fieldTypes" :field-types="fieldTypes"
:with-sticky-submitters="withStickySubmitters"
:with-fields-detection="withFieldsDetection" :with-fields-detection="withFieldsDetection"
:with-detect-existing-fields="withDetectExistingFields" :with-detect-existing-fields="withDetectExistingFields"
:with-signature-id="withSignatureId" :with-signature-id="withSignatureId"
@@ -17,7 +17,7 @@
<div <div
class="absolute bottom-3 flex items-center justify-center w-10 h-10 rounded-full bg-base-100 shadow-lg pointer-events-none transition-opacity duration-300" class="absolute bottom-3 flex items-center justify-center w-10 h-10 rounded-full bg-base-100 shadow-lg pointer-events-none transition-opacity duration-300"
:class="open ? 'opacity-100' : 'opacity-0'" :class="open ? 'opacity-100' : 'opacity-0'"
:style="side === 'left' ? 'left: calc(min(82%, 340px) + 0.75rem)' : 'right: calc(min(82%, 340px) + 0.75rem)'" :style="[side === 'left' ? 'left: calc(min(82%, 340px) + 0.75rem)' : 'right: calc(min(82%, 340px) + 0.75rem)', backgroundStyle]"
> >
<IconX class="w-5 h-5" /> <IconX class="w-5 h-5" />
</div> </div>
@@ -25,6 +25,7 @@
ref="panel" ref="panel"
class="absolute top-0 bottom-0 bg-base-100 shadow-xl overflow-y-auto overflow-x-hidden overscroll-contain px-4 transition-transform duration-300 ease-out" class="absolute top-0 bottom-0 bg-base-100 shadow-xl overflow-y-auto overflow-x-hidden overscroll-contain px-4 transition-transform duration-300 ease-out"
style="width: 82%; max-width: 340px" style="width: 82%; max-width: 340px"
:style="backgroundStyle"
:class="[side === 'left' ? 'left-0' : 'right-0', open ? 'translate-x-0' : (side === 'left' ? '-translate-x-full' : 'translate-x-full')]" :class="[side === 'left' ? 'left-0' : 'right-0', open ? 'translate-x-0' : (side === 'left' ? '-translate-x-full' : 'translate-x-full')]"
@touchmove="onPanelTouchmove" @touchmove="onPanelTouchmove"
> >
@@ -56,9 +57,19 @@ export default {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false
},
backgroundColor: {
type: String,
required: false,
default: ''
} }
}, },
emits: ['close'], emits: ['close'],
computed: {
backgroundStyle () {
return ['', null, 'transparent'].includes(this.backgroundColor) ? {} : { backgroundColor: this.backgroundColor }
}
},
watch: { watch: {
open (value) { open (value) {
document.body.style.overflow = value ? 'hidden' : '' document.body.style.overflow = value ? 'hidden' : ''