1
0
forked from test/crm

fix: add padding with border is allowTabs is set

This commit is contained in:
Shariq Ansari 2024-12-05 17:59:36 +05:30
parent 878003909a
commit 1222cdd7d7
2 changed files with 15 additions and 5 deletions

View File

@ -35,7 +35,12 @@
v-else v-else
class="flex flex-col gap-3 border border-outline-gray-1 rounded-lg" class="flex flex-col gap-3 border border-outline-gray-1 rounded-lg"
> >
<Fields v-if="sections.data" :sections="sections.data" :data="data.doc" /> <Fields
v-if="sections.data"
:sections="sections.data"
:data="data.doc"
:allowTabs="true"
/>
</div> </div>
<DataFieldsModal <DataFieldsModal
v-if="showDataFieldsModal" v-if="showDataFieldsModal"

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="flex flex-col my-4 sm:my-6"> <div class="flex flex-col" :class="{ 'my-4 sm:my-6': allowTabs }">
<div <div
v-for="(section, i) in sections" v-for="(section, i) in sections"
:key="section.label" :key="section.label"
@ -10,15 +10,16 @@
class="h-px w-full border-t my-5" class="h-px w-full border-t my-5"
/> />
<Section <Section
class="text-lg font-medium px-3 sm:px-5" class="text-lg font-medium"
:class="{ 'px-3 sm:px-5': allowTabs }"
:label="section.label" :label="section.label"
:hideLabel="section.hideLabel" :hideLabel="section.hideLabel"
:opened="section.opened" :opened="section.opened"
collapseIconPosition="right" collapseIconPosition="right"
> >
<div <div
class="grid gap-4 mt-6 px-3 sm:px-5" class="grid gap-4 mt-6"
:class="gridClass(section.columns)" :class="[gridClass(section.columns), { 'px-3 sm:px-5': allowTabs }]"
> >
<div v-for="field in section.fields" :key="field.name"> <div v-for="field in section.fields" :key="field.name">
<div <div
@ -191,6 +192,10 @@ const { getUser } = usersStore()
const props = defineProps({ const props = defineProps({
sections: Array, sections: Array,
data: Object, data: Object,
allowTabs: {
type: Boolean,
default: false,
},
}) })
function gridClass(columns) { function gridClass(columns) {