Browse Source

fix : fixed width for field items

pull/7114/head
musharaf 1 year ago
parent
commit
7daf293006
  1. 38
      packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue

38
packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue

@ -371,7 +371,7 @@ useMenuCloseOnEsc(open)
<component :is="iconMap.drag" class="cursor-move !h-3.75 text-gray-600 mr-1" /> <component :is="iconMap.drag" class="cursor-move !h-3.75 text-gray-600 mr-1" />
<div <div
v-e="['a:fields:show-hide']" v-e="['a:fields:show-hide']"
class="flex flex-row items-center justify-between w-full cursor-pointer ml-1" class="flex flex-row items-center w-full truncate cursor-pointer ml-1"
@click=" @click="
() => { () => {
field.show = !field.show field.show = !field.show
@ -379,15 +379,13 @@ useMenuCloseOnEsc(open)
} }
" "
> >
<div class="flex items-center"> <component :is="getIcon(metaColumnById[field.fk_column_id])" />
<component :is="getIcon(metaColumnById[field.fk_column_id])" /> <NcTooltip :disabled="field.title.length < 30" class="flex-1 px-1 truncate">
<NcTooltip :disabled="field.title.length < 30"> <template #title>
<template #title> {{ field.title }}
{{ field.title }} </template>
</template> <span>{{ field.title }}</span>
<span class="px-1.5 max-w-60 line-clamp-1">{{ field.title }}</span> </NcTooltip>
</NcTooltip>
</div>
<NcSwitch v-e="['a:fields:show-hide']" :checked="field.show" :disabled="field.isViewEssentialField" /> <NcSwitch v-e="['a:fields:show-hide']" :checked="field.show" :disabled="field.isViewEssentialField" />
</div> </div>
@ -399,7 +397,7 @@ useMenuCloseOnEsc(open)
<div <div
v-if="gridDisplayValueField && filteredFieldList[0].title.toLowerCase().includes(filterQuery.toLowerCase())" v-if="gridDisplayValueField && filteredFieldList[0].title.toLowerCase().includes(filterQuery.toLowerCase())"
:key="`pv-${gridDisplayValueField.id}`" :key="`pv-${gridDisplayValueField.id}`"
class="pl-7.5 pr-2.1 py-2 flex flex-row items-center border-1 border-gray-200" class="pl-7.4 pr-2 py-2 flex flex-row items-center border-1 border-gray-200"
:class="{ :class="{
'rounded-t-lg': filteredFieldList.length > 1, 'rounded-t-lg': filteredFieldList.length > 1,
'rounded-lg': filteredFieldList.length === 1, 'rounded-lg': filteredFieldList.length === 1,
@ -407,17 +405,13 @@ useMenuCloseOnEsc(open)
:data-testid="`nc-fields-menu-${gridDisplayValueField.title}`" :data-testid="`nc-fields-menu-${gridDisplayValueField.title}`"
@click.stop @click.stop
> >
<div class="flex flex-row items-center justify-between w-full"> <component :is="getIcon(metaColumnById[filteredFieldList[0].fk_column_id as string])" />
<div class="flex items-center truncate"> <NcTooltip :disabled="filteredFieldList?.[0]?.title?.length < 30" class="px-1 flex-1 truncate">
<component :is="getIcon(metaColumnById[filteredFieldList[0].fk_column_id as string])" /> <template #title>{{ filteredFieldList[0].title }}</template>
<NcTooltip class="px-1.5 truncate"> <span>{{ filteredFieldList[0].title }}</span>
<template #title>{{ filteredFieldList[0].title }}</template> </NcTooltip>
<span>{{ filteredFieldList[0].title }}</span>
</NcTooltip> <NcSwitch v-e="['a:fields:show-hide']" :checked="true" :disabled="true" />
</div>
<NcSwitch v-e="['a:fields:show-hide']" :checked="true" :disabled="true" />
</div>
</div> </div>
</template> </template>
</Draggable> </Draggable>

Loading…
Cancel
Save