Browse Source

fix(nc-gui): toolbar menu dropdown outer padding issue

pull/8188/head
Ramesh Mane 8 months ago
parent
commit
0ac80c9420
  1. 24
      packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue
  2. 2
      packages/nc-gui/components/smartsheet/toolbar/FieldListWithSearch.vue
  3. 21
      packages/nc-gui/components/smartsheet/toolbar/GroupByMenu.vue
  4. 20
      packages/nc-gui/components/smartsheet/toolbar/SortListMenu.vue

24
packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue

@ -337,15 +337,16 @@ function isDateType(uidt: UITypes) {
<div <div
class="menu-filter-dropdown" class="menu-filter-dropdown"
:class="{ :class="{
'max-h-[max(80vh,500px)] min-w-112 py-6 pl-6': !nested, 'max-h-[max(80vh,500px)] min-w-112 py-2 pl-4': !nested,
'w-full ': nested, 'w-full ': nested,
'py-4': !filters.length,
}" }"
> >
<div <div
v-if="filters && filters.length" v-if="filters && filters.length"
ref="wrapperDomRef" ref="wrapperDomRef"
class="flex flex-col gap-y-3 nc-filter-grid pb-2 w-full" class="flex flex-col gap-y-3 nc-filter-grid w-full"
:class="{ 'max-h-420px nc-scrollbar-md pr-3.5 nc-filter-top-wrapper': !nested }" :class="{ 'max-h-420px nc-scrollbar-thin nc-filter-top-wrapper pr-4 my-2 py-1': !nested }"
@click.stop @click.stop
> >
<template v-for="(filter, i) in filters" :key="i"> <template v-for="(filter, i) in filters" :key="i">
@ -544,7 +545,14 @@ function isDateType(uidt: UITypes) {
</div> </div>
<template v-if="isEeUI && !isPublic"> <template v-if="isEeUI && !isPublic">
<div v-if="filtersCount < getPlanLimit(PlanLimitTypes.FILTER_LIMIT)" ref="addFiltersRowDomRef" class="flex gap-2"> <div
v-if="filtersCount < getPlanLimit(PlanLimitTypes.FILTER_LIMIT)"
ref="addFiltersRowDomRef"
class="flex gap-2"
:class="{
'mt-1 mb-2': filters.length,
}"
>
<NcButton size="small" type="text" class="!text-brand-500" @click.stop="addFilter()"> <NcButton size="small" type="text" class="!text-brand-500" @click.stop="addFilter()">
<div class="flex items-center gap-1"> <div class="flex items-center gap-1">
<component :is="iconMap.plus" /> <component :is="iconMap.plus" />
@ -563,7 +571,13 @@ function isDateType(uidt: UITypes) {
</div> </div>
</template> </template>
<template v-else> <template v-else>
<div ref="addFiltersRowDomRef" class="flex gap-2"> <div
ref="addFiltersRowDomRef"
class="flex gap-2"
:class="{
'mt-1 mb-2': filters.length,
}"
>
<NcButton size="small" type="text" class="!text-brand-500" @click.stop="addFilter()"> <NcButton size="small" type="text" class="!text-brand-500" @click.stop="addFilter()">
<div class="flex items-center gap-1"> <div class="flex items-center gap-1">
<component :is="iconMap.plus" /> <component :is="iconMap.plus" />

2
packages/nc-gui/components/smartsheet/toolbar/FieldListWithSearch.vue

@ -133,7 +133,7 @@ watch(
alt="No search results found" alt="No search results found"
/> />
{{ $t('title.noResultsMatchedYourSearch') }} {{ options.length ? $t('title.noResultsMatchedYourSearch') : 'The list is empty' }}
</div> </div>
<div <div

21
packages/nc-gui/components/smartsheet/toolbar/GroupByMenu.vue

@ -251,19 +251,14 @@ watch(meta, async () => {
/> />
<div <div
v-else v-else
:class="{ ' min-w-[400px]': _groupBy.length }" class="flex flex-col bg-white overflow-auto nc-group-by-list menu-filter-dropdown max-h-[max(80vh,500px)] min-w-102 pt-2 pb-2 pl-4"
class="flex flex-col bg-white overflow-auto nc-group-by-list menu-filter-dropdown max-h-[max(80vh,500px)] py-6 pl-6"
data-testid="nc-group-by-menu" data-testid="nc-group-by-menu"
> >
<div <div class="group-by-grid max-h-100 nc-scrollbar-thing pr-4 py-2" @click.stop>
class="group-by-grid pb-1 max-h-100 nc-scrollbar-md pr-5"
:class="{ 'mb-2': availableColumns.length && fieldsToGroupBy.length > _groupBy.length && _groupBy.length < 3 }"
@click.stop
>
<template v-for="[i, group] of Object.entries(_groupBy)" :key="`grouped-by-${group.fk_column_id}`"> <template v-for="[i, group] of Object.entries(_groupBy)" :key="`grouped-by-${group.fk_column_id}`">
<LazySmartsheetToolbarFieldListAutoCompleteDropdown <LazySmartsheetToolbarFieldListAutoCompleteDropdown
v-model="group.fk_column_id" v-model="group.fk_column_id"
class="caption nc-sort-field-select" class="caption nc-sort-field-select w-44 flex flex-grow"
:columns="fieldsToGroupBy" :columns="fieldsToGroupBy"
:allow-empty="true" :allow-empty="true"
@change="saveGroupBy" @change="saveGroupBy"
@ -296,10 +291,10 @@ watch(meta, async () => {
</a-select-option> </a-select-option>
</NcSelect> </NcSelect>
<a-tooltip placement="right" title="Remove"> <a-tooltip placement="right" title="Remove" class="flex-none min-w-40">
<NcButton <NcButton
v-e="['c:group-by:remove']" v-e="['c:group-by:remove']"
class="nc-group-by-item-remove-btn" class="nc-group-by-item-remove-btn min-w-40"
size="small" size="small"
type="text" type="text"
@click.stop="removeFieldFromGroupBy(i)" @click.stop="removeFieldFromGroupBy(i)"
@ -317,7 +312,7 @@ watch(meta, async () => {
> >
<NcButton <NcButton
v-e="['c:group-by:add']" v-e="['c:group-by:add']"
class="nc-add-group-by-btn !text-brand-500" class="nc-add-group-by-btn !text-brand-500 mt-1 mb-2"
style="width: fit-content" style="width: fit-content"
size="small" size="small"
type="text" type="text"
@ -346,7 +341,7 @@ watch(meta, async () => {
<style scoped> <style scoped>
.group-by-grid { .group-by-grid {
display: grid; display: grid;
grid-template-columns: auto 150px 22px; grid-template-columns: auto 150px auto;
@apply gap-[12px]; @apply gap-x-2 gap-y-3;
} }
</style> </style>

20
packages/nc-gui/components/smartsheet/toolbar/SortListMenu.vue

@ -139,13 +139,8 @@ onMounted(() => {
</div> </div>
<template #overlay> <template #overlay>
<SmartsheetToolbarCreateSort v-if="!sorts.length" :is-parent-open="open" @created="addSort" /> <SmartsheetToolbarCreateSort v-if="!sorts.length" :is-parent-open="open" @created="addSort" />
<div <div v-else class="pt-2 pb-2 pl-4 nc-filter-list max-h-[max(80vh,30rem)] min-w-102" data-testid="nc-sorts-menu">
v-else <div class="sort-grid max-h-120 nc-scrollbar-thin pr-4 my-2 py-1" @click.stop>
:class="{ 'min-w-102': sorts.length }"
class="py-6 pl-6 nc-filter-list max-h-[max(80vh,30rem)]"
data-testid="nc-sorts-menu"
>
<div class="sort-grid max-h-120 nc-scrollbar-md" :class="{ 'pr-3.5': sorts?.length }" @click.stop>
<template v-for="(sort, i) of sorts" :key="i"> <template v-for="(sort, i) of sorts" :key="i">
<SmartsheetToolbarFieldListAutoCompleteDropdown <SmartsheetToolbarFieldListAutoCompleteDropdown
v-model="sort.fk_column_id" v-model="sort.fk_column_id"
@ -198,14 +193,13 @@ onMounted(() => {
v-if="availableColumns.length" v-if="availableColumns.length"
v-model:visible="showCreateSort" v-model:visible="showCreateSort"
:trigger="['click']" :trigger="['click']"
class="mt-3"
overlay-class-name="nc-toolbar-dropdown" overlay-class-name="nc-toolbar-dropdown"
> >
<template v-if="isEeUI && !isPublic"> <template v-if="isEeUI && !isPublic">
<NcButton <NcButton
v-if="sorts.length < getPlanLimit(PlanLimitTypes.SORT_LIMIT)" v-if="sorts.length < getPlanLimit(PlanLimitTypes.SORT_LIMIT)"
v-e="['c:sort:add']" v-e="['c:sort:add']"
class="!text-brand-500" class="!text-brand-500 mt-1 mb-2"
type="text" type="text"
size="small" size="small"
@click.stop="showCreateSort = true" @click.stop="showCreateSort = true"
@ -219,7 +213,13 @@ onMounted(() => {
<span v-else></span> <span v-else></span>
</template> </template>
<template v-else> <template v-else>
<NcButton v-e="['c:sort:add']" class="!text-brand-500" type="text" size="small" @click.stop="showCreateSort = true"> <NcButton
v-e="['c:sort:add']"
class="!text-brand-500 mt-1 mb-2"
type="text"
size="small"
@click.stop="showCreateSort = true"
>
<div class="flex gap-1 items-center"> <div class="flex gap-1 items-center">
<component :is="iconMap.plus" /> <component :is="iconMap.plus" />
<!-- Add Sort Option --> <!-- Add Sort Option -->

Loading…
Cancel
Save