Browse Source

fix : fixed ui in editOrAdd column options

pull/7181/head
musharaf-nocodb 12 months ago
parent
commit
1cc6c67cd9
  1. 3
      packages/nc-gui/assets/style.scss
  2. 8
      packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue
  3. 2
      packages/nc-gui/components/nc/Select.vue
  4. 12
      packages/nc-gui/components/smartsheet/column/CheckboxOptions.vue
  5. 20
      packages/nc-gui/components/smartsheet/column/CurrencyOptions.vue
  6. 10
      packages/nc-gui/components/smartsheet/column/DateOptions.vue
  7. 16
      packages/nc-gui/components/smartsheet/column/DateTimeOptions.vue
  8. 10
      packages/nc-gui/components/smartsheet/column/DecimalOptions.vue
  9. 12
      packages/nc-gui/components/smartsheet/column/DurationOptions.vue
  10. 10
      packages/nc-gui/components/smartsheet/column/EditOrAdd.vue
  11. 35
      packages/nc-gui/components/smartsheet/column/LookupOptions.vue
  12. 17
      packages/nc-gui/components/smartsheet/column/QrCodeOptions.vue
  13. 19
      packages/nc-gui/components/smartsheet/column/RatingOptions.vue
  14. 44
      packages/nc-gui/components/smartsheet/column/RollupOptions.vue
  15. 2
      packages/nc-gui/components/smartsheet/expanded-form/index.vue
  16. 72
      packages/nc-gui/components/smartsheet/header/Menu.vue
  17. 2
      packages/nc-gui/components/smartsheet/toolbar/SearchData.vue

3
packages/nc-gui/assets/style.scss

@ -36,6 +36,9 @@ body {
overflow-y: visible !important; overflow-y: visible !important;
} }
.rc-virtual-list-holder-inner{
@apply !px-1.5
}
.ant-layout-header { .ant-layout-header {
height: var(--topbar-height) !important; height: var(--topbar-height) !important;
} }

8
packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue

@ -451,7 +451,7 @@ const toggleModal = (val: boolean) => {
<a-select <a-select
v-model:value="formState.dataSource.client" v-model:value="formState.dataSource.client"
class="nc-extdb-db-type" class="nc-extdb-db-type"
dropdown-class-name="nc-dropdown-ext-db-type !px-1.5" dropdown-class-name="nc-dropdown-ext-db-type"
@change="onClientChange" @change="onClientChange"
> >
<a-select-option v-for="client in clientTypes" :key="client.value" :value="client.value"> <a-select-option v-for="client in clientTypes" :key="client.value" :value="client.value">
@ -540,7 +540,7 @@ const toggleModal = (val: boolean) => {
<a-form-item label="SSL mode"> <a-form-item label="SSL mode">
<a-select <a-select
v-model:value="formState.sslUse" v-model:value="formState.sslUse"
dropdown-class-name="nc-dropdown-ssl-mode !px-1.5" dropdown-class-name="nc-dropdown-ssl-mode"
@select="onSSLModeChange" @select="onSSLModeChange"
> >
<a-select-option v-for="opt in Object.values(SSLUsage)" :key="opt" :value="opt"> <a-select-option v-for="opt in Object.values(SSLUsage)" :key="opt" :value="opt">
@ -635,7 +635,7 @@ const toggleModal = (val: boolean) => {
<a-form-item :label="$t('labels.inflection.tableName')"> <a-form-item :label="$t('labels.inflection.tableName')">
<a-select <a-select
v-model:value="formState.inflection.inflectionTable" v-model:value="formState.inflection.inflectionTable"
dropdown-class-name="nc-dropdown-inflection-table-name !px-1.5" dropdown-class-name="nc-dropdown-inflection-table-name"
> >
<a-select-option v-for="tp in inflectionTypes" :key="tp" :value="tp"> <a-select-option v-for="tp in inflectionTypes" :key="tp" :value="tp">
<div class="flex items-center gap-2 justify-between"> <div class="flex items-center gap-2 justify-between">
@ -654,7 +654,7 @@ const toggleModal = (val: boolean) => {
<a-form-item :label="$t('labels.inflection.columnName')"> <a-form-item :label="$t('labels.inflection.columnName')">
<a-select <a-select
v-model:value="formState.inflection.inflectionColumn" v-model:value="formState.inflection.inflectionColumn"
dropdown-class-name="nc-dropdown-inflection-column-name !px-1.5" dropdown-class-name="nc-dropdown-inflection-column-name"
> >
<a-select-option v-for="tp in inflectionTypes" :key="tp" :value="tp" <a-select-option v-for="tp in inflectionTypes" :key="tp" :value="tp"
><div class="flex items-center gap-2 justify-between"> ><div class="flex items-center gap-2 justify-between">

2
packages/nc-gui/components/nc/Select.vue

@ -100,7 +100,7 @@ const onChange = (value: string) => {
} }
.nc-select-dropdown { .nc-select-dropdown {
@apply !rounded-xl p-1.5; @apply !rounded-xl;
.rc-virtual-list-holder { .rc-virtual-list-holder {
overflow-y: scroll; overflow-y: scroll;

12
packages/nc-gui/components/smartsheet/column/CheckboxOptions.vue

@ -80,7 +80,8 @@ watch(
<a-form-item label="Icon"> <a-form-item label="Icon">
<a-select v-model:value="vModel.meta.iconIdx" class="w-52" dropdown-class-name="nc-dropdown-checkbox-icon"> <a-select v-model:value="vModel.meta.iconIdx" class="w-52" dropdown-class-name="nc-dropdown-checkbox-icon">
<a-select-option v-for="(icon, i) of iconList" :key="i" :value="i"> <a-select-option v-for="(icon, i) of iconList" :key="i" :value="i">
<div class="flex items-center"> <div class="flex gap-2 w-full truncate items-center">
<div class="flex-1 truncate">
<component <component
:is="getMdiIcon(icon.checked)" :is="getMdiIcon(icon.checked)"
class="mx-1" class="mx-1"
@ -88,7 +89,6 @@ watch(
color: vModel.meta.color, color: vModel.meta.color,
}" }"
/> />
<component <component
:is="getMdiIcon(icon.unchecked)" :is="getMdiIcon(icon.unchecked)"
:style="{ :style="{
@ -96,6 +96,14 @@ watch(
}" }"
/> />
</div> </div>
<component
:is="iconMap.check"
v-if="vModel.meta.iconIdx === i"
id="nc-selected-item-icon"
class="text-primary w-4 h-4"
/>
</div>
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>

20
packages/nc-gui/components/smartsheet/column/CurrencyOptions.vue

@ -89,7 +89,19 @@ currencyLocales().then((locales) => {
dropdown-class-name="nc-dropdown-currency-cell-locale" dropdown-class-name="nc-dropdown-currency-cell-locale"
> >
<a-select-option v-for="(currencyLocale, i) of currencyLocaleList" :key="i" :value="currencyLocale.value"> <a-select-option v-for="(currencyLocale, i) of currencyLocaleList" :key="i" :value="currencyLocale.value">
<div class="flex gap-2 w-full truncate items-center">
<NcTooltip show-on-truncate-only class="flex-1 truncate">
<template #title>{{ currencyLocale.text }}</template>
{{ currencyLocale.text }} {{ currencyLocale.text }}
</NcTooltip>
<component
:is="iconMap.check"
v-if="vModel.meta.currency_locale === currencyLocale.value"
id="nc-selected-item-icon"
class="text-primary w-4 h-4"
/>
</div>
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
@ -106,7 +118,15 @@ currencyLocales().then((locales) => {
dropdown-class-name="nc-dropdown-currency-cell-code" dropdown-class-name="nc-dropdown-currency-cell-code"
> >
<a-select-option v-for="(currencyCode, i) of currencyList" :key="i" :value="currencyCode"> <a-select-option v-for="(currencyCode, i) of currencyList" :key="i" :value="currencyCode">
<div class="flex gap-2 w-full justify-between items-center">
{{ currencyCode }} {{ currencyCode }}
<component
:is="iconMap.check"
v-if="vModel.meta.currency_code === currencyCode"
id="nc-selected-item-icon"
class="text-primary w-4 h-4"
/>
</div>
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>

10
packages/nc-gui/components/smartsheet/column/DateOptions.vue

@ -19,10 +19,14 @@ if (!vModel.value.meta?.date_format) {
<a-form-item :label="$t('labels.dateFormat')"> <a-form-item :label="$t('labels.dateFormat')">
<a-select v-model:value="vModel.meta.date_format" dropdown-class-name="nc-dropdown-date-format"> <a-select v-model:value="vModel.meta.date_format" dropdown-class-name="nc-dropdown-date-format">
<a-select-option v-for="(format, i) of dateFormats" :key="i" :value="format"> <a-select-option v-for="(format, i) of dateFormats" :key="i" :value="format">
<div class="flex flex-row items-center"> <div class="flex gap-2 w-full justify-between items-center">
<div class="text-xs">
{{ format }} {{ format }}
</div> <component
:is="iconMap.check"
v-if="vModel.meta.date_format === format"
id="nc-selected-item-icon"
class="text-primary w-4 h-4"
/>
</div> </div>
</a-select-option> </a-select-option>
</a-select> </a-select>

16
packages/nc-gui/components/smartsheet/column/DateTimeOptions.vue

@ -24,14 +24,30 @@ if (!vModel.value.meta?.time_format) {
<a-form-item :label="$t('labels.dateFormat')"> <a-form-item :label="$t('labels.dateFormat')">
<a-select v-model:value="vModel.meta.date_format" class="nc-date-select" dropdown-class-name="nc-dropdown-date-format"> <a-select v-model:value="vModel.meta.date_format" class="nc-date-select" dropdown-class-name="nc-dropdown-date-format">
<a-select-option v-for="(format, i) of dateFormats" :key="i" :value="format"> <a-select-option v-for="(format, i) of dateFormats" :key="i" :value="format">
<div class="flex gap-2 w-full justify-between items-center">
{{ format }} {{ format }}
<component
:is="iconMap.check"
v-if="vModel.meta.date_format === format"
id="nc-selected-item-icon"
class="text-primary w-4 h-4"
/>
</div>
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item :label="$t('labels.timeFormat')"> <a-form-item :label="$t('labels.timeFormat')">
<a-select v-model:value="vModel.meta.time_format" class="nc-time-select" dropdown-class-name="nc-dropdown-time-format"> <a-select v-model:value="vModel.meta.time_format" class="nc-time-select" dropdown-class-name="nc-dropdown-time-format">
<a-select-option v-for="(format, i) of timeFormats" :key="i" :value="format"> <a-select-option v-for="(format, i) of timeFormats" :key="i" :value="format">
<div class="flex gap-2 w-full justify-between items-center">
{{ format }} {{ format }}
<component
:is="iconMap.check"
v-if="vModel.meta.time_format === format"
id="nc-selected-item-icon"
class="text-primary w-4 h-4"
/>
</div>
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>

10
packages/nc-gui/components/smartsheet/column/DecimalOptions.vue

@ -40,10 +40,14 @@ onMounted(() => {
dropdown-class-name="nc-dropdown-decimal-format" dropdown-class-name="nc-dropdown-decimal-format"
> >
<a-select-option v-for="(format, i) of precisionFormats" :key="i" :value="format"> <a-select-option v-for="(format, i) of precisionFormats" :key="i" :value="format">
<div class="flex flex-row items-center"> <div class="flex gap-2 w-full justify-between items-center">
<div class="text-xs">
{{ (precisionFormatsDisplay as any)[format] }} {{ (precisionFormatsDisplay as any)[format] }}
</div> <component
:is="iconMap.check"
v-if="vModel.meta.precision === format"
id="nc-selected-item-icon"
class="text-primary w-4 h-4"
/>
</div> </div>
</a-select-option> </a-select-option>
</a-select> </a-select>

12
packages/nc-gui/components/smartsheet/column/DurationOptions.vue

@ -33,7 +33,19 @@ vModel.value.meta = {
<a-form-item :label="$t('labels.durationFormat')"> <a-form-item :label="$t('labels.durationFormat')">
<a-select v-model:value="vModel.meta.duration" class="w-52" dropdown-class-name="nc-dropdown-duration-option"> <a-select v-model:value="vModel.meta.duration" class="w-52" dropdown-class-name="nc-dropdown-duration-option">
<a-select-option v-for="(duration, i) of durationOptionList" :key="i" :value="duration.id"> <a-select-option v-for="(duration, i) of durationOptionList" :key="i" :value="duration.id">
<div class="flex gap-2 w-full truncate items-center">
<NcTooltip show-on-truncate-only class="flex-1 truncate">
<template #title> {{ duration.title }}</template>
{{ duration.title }} {{ duration.title }}
</NcTooltip>
<component
:is="iconMap.check"
v-if="vModel.meta.duration === duration.id"
id="nc-selected-item-icon"
class="text-primary w-4 h-4"
/>
</div>
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>

10
packages/nc-gui/components/smartsheet/column/EditOrAdd.vue

@ -279,10 +279,16 @@ if (props.fromTableExplorer) {
<GeneralIcon icon="arrowDown" class="text-gray-700" /> <GeneralIcon icon="arrowDown" class="text-gray-700" />
</template> </template>
<a-select-option v-for="opt of uiTypesOptions" :key="opt.name" :value="opt.name" v-bind="validateInfos.uidt"> <a-select-option v-for="opt of uiTypesOptions" :key="opt.name" :value="opt.name" v-bind="validateInfos.uidt">
<div class="flex gap-1 items-center"> <div class="flex gap-2 items-center">
<component :is="opt.icon" class="text-gray-700 mx-1" /> <component :is="opt.icon" class="text-gray-700 mx-1" />
{{ opt.name }} <div class="flex-1">{{ opt.name }}</div>
<span v-if="opt.deprecated" class="!text-xs !text-gray-300">({{ $t('general.deprecated') }})</span> <span v-if="opt.deprecated" class="!text-xs !text-gray-300">({{ $t('general.deprecated') }})</span>
<component
:is="iconMap.check"
v-if="formState.uidt === opt.name"
id="nc-selected-item-icon"
class="text-primary w-4 h-4"
/>
</div> </div>
</a-select-option> </a-select-option>
</a-select> </a-select>

35
packages/nc-gui/components/smartsheet/column/LookupOptions.vue

@ -87,11 +87,23 @@ const cellIcon = (column: ColumnType) =>
@change="onRelationColChange" @change="onRelationColChange"
> >
<a-select-option v-for="(table, i) of refTables" :key="i" :value="table.col.fk_column_id"> <a-select-option v-for="(table, i) of refTables" :key="i" :value="table.col.fk_column_id">
<div class="flex flex-row h-full pb-0.5 items-center max-w-full"> <div class="flex gap-2 w-full justify-between truncate items-center">
<div class="font-semibold text-xs flex-shrink flex-grow-0 truncate">{{ table.column.title }}</div> <NcTooltip class="font-semibold truncate min-w-1/2" show-on-truncate-only>
<div class="flex-grow"></div> <template #title>{{ table.column.title }}</template>
<div class="text-[0.65rem] text-gray-600 nc-relation-details"> {{ table.column.title }}</NcTooltip
<span class="uppercase">{{ table.col.type }}</span> {{ table.title || table.table_name }} >
<div class="inline-flex items-center truncate gap-2">
<div class="text-[0.65rem] flex-1 truncate text-gray-600 nc-relation-details">
<span class="uppercase">{{ table.col.type }}</span>
<span class="truncate">{{ table.title || table.table_name }}</span>
</div>
<component
:is="iconMap.check"
v-if="vModel.fk_relation_column_id === table.col.fk_column_id"
id="nc-selected-item-icon"
class="text-primary w-4 h-4"
/>
</div> </div>
</div> </div>
</a-select-option> </a-select-option>
@ -106,9 +118,18 @@ const cellIcon = (column: ColumnType) =>
@change="onDataTypeChange" @change="onDataTypeChange"
> >
<a-select-option v-for="(column, index) of columns" :key="index" :value="column.id"> <a-select-option v-for="(column, index) of columns" :key="index" :value="column.id">
<div class="flex items-center -ml-1 font-semibold text-xs"> <div class="flex gap-2 truncate items-center">
<div class="flex items-center flex-1 truncate font-semibold">
<component :is="cellIcon(column)" :column-meta="column" /> <component :is="cellIcon(column)" :column-meta="column" />
{{ column.title }} <div class="truncate flex-1">{{ column.title }}</div>
</div>
<component
:is="iconMap.check"
v-if="vModel.fk_lookup_column_id === column.id"
id="nc-selected-item-icon"
class="text-primary w-4 h-4"
/>
</div> </div>
</a-select-option> </a-select-option>
</a-select> </a-select>

17
packages/nc-gui/components/smartsheet/column/QrCodeOptions.vue

@ -53,10 +53,25 @@ setAdditionalValidations({
> >
<a-select <a-select
v-model:value="vModel.fk_qr_value_column_id" v-model:value="vModel.fk_qr_value_column_id"
:options="columnsAllowedAsQrValue"
:placeholder="$t('placeholder.selectAColumnForTheQRCodeValue')" :placeholder="$t('placeholder.selectAColumnForTheQRCodeValue')"
@click.stop @click.stop
>
<a-select-option v-for="opt of columnsAllowedAsQrValue" :key="opt" :value="opt.value">
<div class="flex gap-2 w-full truncate items-center">
<NcTooltip show-on-truncate-only class="flex-1 truncate">
<template #title>{{ opt.label }}</template>
{{ opt.label }}
</NcTooltip>
<component
:is="iconMap.check"
v-if="vModel.fk_qr_value_column_id === opt.value"
id="nc-selected-item-icon"
class="text-primary w-4 h-4"
/> />
</div>
</a-select-option>
</a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>

19
packages/nc-gui/components/smartsheet/column/RatingOptions.vue

@ -74,7 +74,8 @@ watch(
<a-form-item :label="$t('labels.icon')"> <a-form-item :label="$t('labels.icon')">
<a-select v-model:value="vModel.meta.iconIdx" class="w-52" dropdown-class-name="nc-dropdown-rating-icon"> <a-select v-model:value="vModel.meta.iconIdx" class="w-52" dropdown-class-name="nc-dropdown-rating-icon">
<a-select-option v-for="(icon, i) of iconList" :key="i" :value="i"> <a-select-option v-for="(icon, i) of iconList" :key="i" :value="i">
<div class="flex items-center"> <div class="flex gap-2 w-full truncate items-center">
<div class="flex-1">
<component <component
:is="getMdiIcon(icon.full)" :is="getMdiIcon(icon.full)"
class="mx-1" class="mx-1"
@ -90,6 +91,14 @@ watch(
}" }"
/> />
</div> </div>
<component
:is="iconMap.check"
v-if="vModel.meta.iconIdx === i"
id="nc-selected-item-icon"
class="text-primary w-4 h-4"
/>
</div>
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
@ -98,7 +107,15 @@ watch(
<a-form-item :label="$t('labels.max')"> <a-form-item :label="$t('labels.max')">
<a-select v-model:value="vModel.meta.max" class="w-52" dropdown-class-name="nc-dropdown-rating-color"> <a-select v-model:value="vModel.meta.max" class="w-52" dropdown-class-name="nc-dropdown-rating-color">
<a-select-option v-for="(v, i) in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]" :key="i" :value="v"> <a-select-option v-for="(v, i) in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]" :key="i" :value="v">
<div class="flex gap-2 w-full justify-between items-center">
{{ v }} {{ v }}
<component
:is="iconMap.check"
v-if="vModel.meta.max === v"
id="nc-selected-item-icon"
class="text-primary w-4 h-4"
/>
</div>
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>

44
packages/nc-gui/components/smartsheet/column/RollupOptions.vue

@ -106,11 +106,23 @@ const cellIcon = (column: ColumnType) =>
@change="onRelationColChange" @change="onRelationColChange"
> >
<a-select-option v-for="(table, i) of refTables" :key="i" :value="table.col.fk_column_id"> <a-select-option v-for="(table, i) of refTables" :key="i" :value="table.col.fk_column_id">
<div class="flex flex-row h-full pb-0.5 items-center max-w-full"> <div class="flex gap-2 w-full justify-between truncate items-center">
<div class="font-semibold text-xs flex-shrink flex-grow-0 truncate">{{ table.column.title }}</div> <NcTooltip class="font-semibold truncate min-w-1/2" show-on-truncate-only>
<div class="flex-grow"></div> <template #title>{{ table.column.title }}</template>
<div class="text-[0.65rem] text-gray-600 nc-relation-details"> {{ table.column.title }}</NcTooltip
<span class="uppercase">{{ table.col.type }}</span> {{ table.title || table.table_name }} >
<div class="inline-flex items-center truncate gap-2">
<div class="text-[0.65rem] flex-1 truncate text-gray-600 nc-relation-details">
<span class="uppercase">{{ table.col.type }}</span>
<span class="truncate">{{ table.title || table.table_name }}</span>
</div>
<component
:is="iconMap.check"
v-if="vModel.fk_relation_column_id === table.col.fk_column_id"
id="nc-selected-item-icon"
class="text-primary w-4 h-4"
/>
</div> </div>
</div> </div>
</a-select-option> </a-select-option>
@ -125,10 +137,17 @@ const cellIcon = (column: ColumnType) =>
@change="onDataTypeChange" @change="onDataTypeChange"
> >
<a-select-option v-for="(column, index) of columns" :key="index" :value="column.id"> <a-select-option v-for="(column, index) of columns" :key="index" :value="column.id">
<div class="flex items-center -ml-1 font-semibold text-xs"> <div class="flex gap-2 truncate items-center">
<div class="flex items-center flex-1 truncate font-semibold">
<component :is="cellIcon(column)" :column-meta="column" /> <component :is="cellIcon(column)" :column-meta="column" />
<div class="truncate flex-1">{{ column.title }}</div>
{{ column.title }} </div>
<component
:is="iconMap.check"
v-if="vModel.fk_rollup_column_id === column.id"
id="nc-selected-item-icon"
class="text-primary w-4 h-4"
/>
</div> </div>
</a-select-option> </a-select-option>
</a-select> </a-select>
@ -139,10 +158,19 @@ const cellIcon = (column: ColumnType) =>
<a-select <a-select
v-model:value="vModel.rollup_function" v-model:value="vModel.rollup_function"
dropdown-class-name="nc-dropdown-rollup-function" dropdown-class-name="nc-dropdown-rollup-function"
class="!mt-0.5"
@change="onDataTypeChange" @change="onDataTypeChange"
> >
<a-select-option v-for="(func, index) of aggrFunctionsList" :key="index" :value="func.value"> <a-select-option v-for="(func, index) of aggrFunctionsList" :key="index" :value="func.value">
<div class="flex gap-2 justify-between items-center">
{{ func.text }} {{ func.text }}
<component
:is="iconMap.check"
v-if="vModel.rollup_function === func.value"
id="nc-selected-item-icon"
class="text-primary w-4 h-4"
/>
</div>
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>

2
packages/nc-gui/components/smartsheet/expanded-form/index.vue

@ -585,6 +585,7 @@ export default {
</template> </template>
<template v-else> <template v-else>
<div class="flex flex-row w-full"> <div class="flex flex-row w-full">
<NcButton <NcButton
v-if="props.showNextPrevIcons && !isFirstRow" v-if="props.showNextPrevIcons && !isFirstRow"
v-e="['c:row-expand:prev']" v-e="['c:row-expand:prev']"
@ -663,6 +664,7 @@ export default {
'!bg-gray-50 !px-0 !select-text': isReadOnlyVirtualCell(col), '!bg-gray-50 !px-0 !select-text': isReadOnlyVirtualCell(col),
}" }"
> >
<LazySmartsheetVirtualCell <LazySmartsheetVirtualCell
v-if="isVirtualCol(col)" v-if="isVirtualCol(col)"
v-model="_row.row[col.title]" v-model="_row.row[col.title]"

72
packages/nc-gui/components/smartsheet/header/Menu.vue

@ -284,47 +284,47 @@ const onInsertAfter = () => {
v-model:visible="isOpen" v-model:visible="isOpen"
:trigger="['click']" :trigger="['click']"
placement="bottomRight" placement="bottomRight"
overlay-class-name="nc-dropdown-column-operations" overlay-class-name="nc-dropdown-column-operations "
@click.stop="isOpen = !isOpen" @click.stop="isOpen = !isOpen"
> >
<div> <div>
<GeneralIcon icon="arrowDown" class="text-grey h-full text-grey nc-ui-dt-dropdown cursor-pointer outline-0 mr-2" /> <GeneralIcon icon="arrowDown" class="text-grey h-full text-grey nc-ui-dt-dropdown cursor-pointer outline-0 mr-2" />
</div> </div>
<template #overlay> <template #overlay>
<a-menu class="shadow bg-white border-1 border-gray-200 nc-column-options"> <NcMenu class="shadow bg-white border-1 flex flex-col gap-1 border-gray-200 nc-column-options">
<a-menu-item @click="onEditPress"> <NcMenuItem @click="onEditPress">
<div class="nc-column-edit nc-header-menu-item"> <div class="nc-column-edit nc-header-menu-item">
<component :is="iconMap.edit" class="text-gray-700 mx-0.65 my-0.75" /> <component :is="iconMap.edit" class="text-gray-700" />
<!-- Edit --> <!-- Edit -->
{{ $t('general.edit') }} {{ $t('general.edit') }}
</div> </div>
</a-menu-item> </NcMenuItem>
<a-divider v-if="!column?.pv" class="!my-0" /> <a-divider v-if="!column?.pv" class="!my-0" />
<a-menu-item v-if="!column?.pv" @click="hideField"> <NcMenuItem v-if="!column?.pv" @click="hideField">
<div v-e="['a:field:hide']" class="nc-column-insert-before nc-header-menu-item my-0.5"> <div v-e="['a:field:hide']" class="nc-column-insert-before nc-header-menu-item">
<component :is="iconMap.eye" class="text-gray-700 mx-0.75 !w-3.75 !h-3.75 ml-0.75 mr-0.5" /> <component :is="iconMap.eye" class="text-gray-700 !w-3.75 !h-3.75" />
<!-- Hide Field --> <!-- Hide Field -->
{{ $t('general.hideField') }} {{ $t('general.hideField') }}
</div> </div>
</a-menu-item> </NcMenuItem>
<a-menu-item v-if="(!virtual || column?.uidt === UITypes.Formula) && !column?.pv" @click="setAsDisplayValue"> <NcMenuItem v-if="(!virtual || column?.uidt === UITypes.Formula) && !column?.pv" @click="setAsDisplayValue">
<div class="nc-column-set-primary nc-header-menu-item item my-0.5"> <div class="nc-column-set-primary nc-header-menu-item item">
<GeneralIcon icon="star" class="text-gray-700 !w-4.25 !h-4.25 ml-0.5 mr-0.25 -mt-0.5" /> <GeneralIcon icon="star" class="text-gray-700 !w-4.25 !h-4.25" />
<!-- todo : tooltip --> <!-- todo : tooltip -->
<!-- Set as Display value --> <!-- Set as Display value -->
{{ $t('activity.setDisplay') }} {{ $t('activity.setDisplay') }}
</div> </div>
</a-menu-item> </NcMenuItem>
<a-divider class="!my-0" /> <a-divider class="!my-0" />
<template v-if="!isLinksOrLTAR(column) || column.colOptions.type !== RelationTypes.BELONGS_TO"> <template v-if="!isLinksOrLTAR(column) || column.colOptions.type !== RelationTypes.BELONGS_TO">
<a-menu-item @click="sortByColumn('asc')"> <NcMenuItem @click="sortByColumn('asc')">
<div v-e="['a:field:sort', { dir: 'asc' }]" class="nc-column-insert-after nc-header-menu-item"> <div v-e="['a:field:sort', { dir: 'asc' }]" class="nc-column-insert-after nc-header-menu-item">
<component <component
:is="iconMap.sortDesc" :is="iconMap.sortDesc"
class="text-gray-700 !rotate-180 !w-4.25 !h-4.25 ml-0.5 mr-0.25" class="text-gray-700 !rotate-180 !w-4.25 !h-4.25"
:style="{ :style="{
transform: 'rotate(180deg)', transform: 'rotate(180deg)',
}" }"
@ -333,49 +333,49 @@ const onInsertAfter = () => {
<!-- Sort Ascending --> <!-- Sort Ascending -->
{{ $t('general.sortAsc') }} {{ $t('general.sortAsc') }}
</div> </div>
</a-menu-item> </NcMenuItem>
<a-menu-item @click="sortByColumn('desc')"> <NcMenuItem @click="sortByColumn('desc')">
<div v-e="['a:field:sort', { dir: 'desc' }]" class="nc-column-insert-before nc-header-menu-item"> <div v-e="['a:field:sort', { dir: 'desc' }]" class="nc-column-insert-before nc-header-menu-item">
<component :is="iconMap.sortDesc" class="text-gray-700 !w-4.25 !h-4.25 ml-0.5 mr-0.25" /> <component :is="iconMap.sortDesc" class="text-gray-700 !w-4.25 !h-4.25 ml-0.5 mr-0.25" />
<!-- Sort Descending --> <!-- Sort Descending -->
{{ $t('general.sortDesc') }} {{ $t('general.sortDesc') }}
</div> </div>
</a-menu-item> </NcMenuItem>
</template> </template>
<a-divider class="!my-0" /> <a-divider v-if="!column?.pk" class="!my-0" />
<a-menu-item v-if="!column?.pk" @click="openDuplicateDlg"> <NcMenuItem v-if="!column?.pk" @click="openDuplicateDlg">
<div v-e="['a:field:duplicate']" class="nc-column-duplicate nc-header-menu-item my-0.5"> <div v-e="['a:field:duplicate']" class="nc-column-duplicate nc-header-menu-item">
<component :is="iconMap.duplicate" class="text-gray-700 mx-0.75" /> <component :is="iconMap.duplicate" class="text-gray-700" />
<!-- Duplicate --> <!-- Duplicate -->
{{ t('general.duplicate') }} {{ t('general.duplicate') }}
</div> </div>
</a-menu-item> </NcMenuItem>
<a-menu-item @click="onInsertAfter"> <NcMenuItem @click="onInsertAfter">
<div v-e="['a:field:insert:after']" class="nc-column-insert-after nc-header-menu-item"> <div v-e="['a:field:insert:after']" class="nc-column-insert-after nc-header-menu-item">
<component :is="iconMap.colInsertAfter" class="text-gray-700 !w-4.5 !h-4.5 ml-0.75" /> <component :is="iconMap.colInsertAfter" class="text-gray-700 !w-4.5 !h-4.5" />
<!-- Insert After --> <!-- Insert After -->
{{ t('general.insertAfter') }} {{ t('general.insertAfter') }}
</div> </div>
</a-menu-item> </NcMenuItem>
<a-menu-item v-if="!column?.pv" @click="onInsertBefore"> <NcMenuItem v-if="!column?.pv" @click="onInsertBefore">
<div v-e="['a:field:insert:before']" class="nc-column-insert-before nc-header-menu-item"> <div v-e="['a:field:insert:before']" class="nc-column-insert-before nc-header-menu-item">
<component :is="iconMap.colInsertBefore" class="text-gray-600 !w-4.5 !h-4.5 mr-1.5 -ml-0.75" /> <component :is="iconMap.colInsertBefore" class="text-gray-600 !w-4.5 !h-4.5" />
<!-- Insert Before --> <!-- Insert Before -->
{{ t('general.insertBefore') }} {{ t('general.insertBefore') }}
</div> </div>
</a-menu-item> </NcMenuItem>
<a-divider class="!my-0" /> <a-divider v-if="!column?.pv" class="!my-0" />
<a-menu-item v-if="!column?.pv" class="!hover:bg-red-50" @click="handleDelete"> <NcMenuItem v-if="!column?.pv" class="!hover:bg-red-50" @click="handleDelete">
<div class="nc-column-delete nc-header-menu-item my-0.75 text-red-600"> <div class="nc-column-delete nc-header-menu-item text-red-600">
<component :is="iconMap.delete" class="ml-0.75 mr-1" /> <component :is="iconMap.delete" />
<!-- Delete --> <!-- Delete -->
{{ $t('general.delete') }} {{ $t('general.delete') }}
</div> </div>
</a-menu-item> </NcMenuItem>
</a-menu> </NcMenu>
</template> </template>
</a-dropdown> </a-dropdown>
<SmartsheetHeaderDeleteColumnModal v-model:visible="showDeleteColumnModal" /> <SmartsheetHeaderDeleteColumnModal v-model:visible="showDeleteColumnModal" />
@ -390,7 +390,7 @@ const onInsertAfter = () => {
<style scoped> <style scoped>
.nc-header-menu-item { .nc-header-menu-item {
@apply text-dropdown flex items-center px-1 py-2 gap-1; @apply text-dropdown flex items-center gap-2;
} }
.nc-column-options { .nc-column-options {

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

@ -111,7 +111,7 @@ watch(columns, () => {
class="py-1 !absolute top-0 left-0 w-full h-full z-10 text-xs opacity-0" class="py-1 !absolute top-0 left-0 w-full h-full z-10 text-xs opacity-0"
@change="onPressEnter" @change="onPressEnter"
> >
<a-select-option v-for="op of columns" :key="op.value" v-e="['c:search:field:select']" :value="op.value" class="mx-1.5"> <a-select-option v-for="op of columns" :key="op.value" v-e="['c:search:field:select']" :value="op.value">
<div class="text-[0.75rem] flex items-center gap-2"> <div class="text-[0.75rem] flex items-center gap-2">
<SmartsheetHeaderIcon class="text-sm" :column="op.column" /> <SmartsheetHeaderIcon class="text-sm" :column="op.column" />
<NcTooltip class="truncate flex-1" placement="top" show-on-truncate-only> <NcTooltip class="truncate flex-1" placement="top" show-on-truncate-only>

Loading…
Cancel
Save