Browse Source

fix(nc-gui): oss shared form ui changes

pull/7729/head
Ramesh Mane 9 months ago
parent
commit
7d1cfcd5e6
  1. 8
      packages/nc-gui/components/smartsheet/Form.vue
  2. 4
      packages/nc-gui/lang/en.json
  3. 40
      packages/nc-gui/pages/index/[typeOrId]/form/[viewId]/index.vue
  4. 5
      packages/nc-gui/pages/index/[typeOrId]/form/[viewId]/index/index.vue
  5. 28
      packages/nc-gui/pages/index/[typeOrId]/form/[viewId]/index/survey.vue

8
packages/nc-gui/components/smartsheet/Form.vue

@ -1122,18 +1122,20 @@ useEventListener(
class="nc-form-field-layout !mt-2" class="nc-form-field-layout !mt-2"
@change="updateColMeta(element)" @change="updateColMeta(element)"
> >
<a-radio :value="false">Dropdown</a-radio> <a-radio :value="false">{{ $t('general.dropdown') }}</a-radio>
<a-radio :value="true">List</a-radio> <a-radio :value="true">{{ $t('general.list') }}</a-radio>
</a-radio-group> </a-radio-group>
</div> </div>
<!-- Todo: Show on conditions,... --> <!-- Todo: Show on conditions,... -->
<div class="flex items-start gap-3 px-3 py-2 border-1 border-gray-200 rounded-lg"> <!-- eslint-disable vue/no-constant-condition -->
<div v-if="false" class="flex items-start gap-3 px-3 py-2 border-1 border-gray-200 rounded-lg">
<a-switch v-e="['a:form-view:field:show-on-condition']" size="small" /> <a-switch v-e="['a:form-view:field:show-on-condition']" size="small" />
<div> <div>
<div class="font-medium text-gray-800">{{ $t('labels.showOnConditions') }}</div> <div class="font-medium text-gray-800">{{ $t('labels.showOnConditions') }}</div>
<div class="text-gray-500">{{ $t('labels.showFieldOnConditionsMet') }}</div> <div class="text-gray-500">{{ $t('labels.showFieldOnConditionsMet') }}</div>
</div> </div>
</div> </div>
<!-- Limit options --> <!-- Limit options -->
<div v-if="isSelectTypeCol(element.uidt)" class="px-3 py-2 border-1 border-gray-200 rounded-lg"> <div v-if="isSelectTypeCol(element.uidt)" class="px-3 py-2 border-1 border-gray-200 rounded-lg">
<div class="flex items-start gap-3"> <div class="flex items-start gap-3">

4
packages/nc-gui/lang/en.json

@ -195,7 +195,9 @@
"restore": "Restore", "restore": "Restore",
"replace": "Replace", "replace": "Replace",
"banner": "Banner", "banner": "Banner",
"logo": "Logo" "logo": "Logo",
"dropdown":"Dropdown",
"list":"List"
}, },
"objects": { "objects": {
"day": "Day", "day": "Day",

40
packages/nc-gui/pages/index/[typeOrId]/form/[viewId]/index.vue

@ -66,8 +66,16 @@ p {
} }
.nc-form-view { .nc-form-view {
.nc-data-cell {
@apply !border-none rounded-none;
&:focus-within {
@apply !border-none;
}
}
.nc-cell { .nc-cell {
@apply bg-white dark:bg-slate-500; @apply bg-white dark:bg-slate-500 appearance-none;
&.nc-cell-checkbox { &.nc-cell-checkbox {
@apply color-transition !border-0; @apply color-transition !border-0;
@ -89,7 +97,18 @@ p {
@apply bg-white dark:bg-slate-500; @apply bg-white dark:bg-slate-500;
&.nc-input { &.nc-input {
@apply w-full rounded p-2 min-h-[40px] flex items-center; @apply w-full;
&:not(.layout-list) {
@apply rounded-lg border-solid border-1 border-gray-200 focus-within:border-brand-500;
& > div {
@apply !bg-transparent;
}
}
&.layout-list {
@apply h-auto !pl-0 !py-1 !bg-transparent !dark:bg-none;
}
.duration-cell-wrapper { .duration-cell-wrapper {
@apply w-full; @apply w-full;
@ -105,8 +124,7 @@ p {
input, input,
textarea, textarea,
&.nc-virtual-cell, &.nc-virtual-cell {
> div {
@apply bg-white dark:(bg-slate-500 text-white); @apply bg-white dark:(bg-slate-500 text-white);
.ant-btn { .ant-btn {
@ -117,6 +135,18 @@ p {
@apply dark:(bg-slate-700 text-white); @apply dark:(bg-slate-700 text-white);
} }
} }
&:not(.layout-list) > div {
@apply bg-white dark:(bg-slate-500 text-white);
}
&.layout-list > div {
.ant-btn {
@apply dark:(bg-slate-300);
}
.chip {
@apply dark:(bg-slate-700 text-white);
}
}
&.nc-cell-longtext { &.nc-cell-longtext {
@apply p-0 h-auto; @apply p-0 h-auto;
@ -132,7 +162,7 @@ p {
} }
} }
&:not(.nc-cell-longtext) { &:not(.nc-cell-longtext) {
@apply px-2 py-2; @apply p-2;
} }
textarea { textarea {

5
packages/nc-gui/pages/index/[typeOrId]/form/[viewId]/index/index.vue

@ -176,7 +176,10 @@ const onDecode = async (scannedCodeValue: string) => {
v-model="formState[field.title]" v-model="formState[field.title]"
class="nc-input truncate" class="nc-input truncate"
:data-testid="`nc-form-input-cell-${field.label || field.title}`" :data-testid="`nc-form-input-cell-${field.label || field.title}`"
:class="`nc-form-input-${field.title?.replaceAll(' ', '')}`" :class="[
`nc-form-input-${field.title?.replaceAll(' ', '')}`,
{ 'layout-list': parseProp(field?.meta)?.isList },
]"
:column="field" :column="field"
edit-enabled edit-enabled
/> />

28
packages/nc-gui/pages/index/[typeOrId]/form/[viewId]/index/survey.vue

@ -292,6 +292,7 @@ onMounted(() => {
v-else v-else
v-model="formState[field.title]" v-model="formState[field.title]"
class="nc-input h-auto" class="nc-input h-auto"
:class="parseProp(field?.meta)?.isList ? 'layout-list' : ''"
:data-testid="`nc-survey-form__input-${field.title.replaceAll(' ', '')}`" :data-testid="`nc-survey-form__input-${field.title.replaceAll(' ', '')}`"
:column="field" :column="field"
edit-enabled edit-enabled
@ -481,33 +482,6 @@ onMounted(() => {
@apply flex items-center justify-center gap-2 text-left; @apply flex items-center justify-center gap-2 text-left;
} }
.nc-input {
@apply appearance-none w-full !bg-white !rounded-lg border-solid border-1 border-gray-200 focus-within:border-brand-500;
&.nc-cell-rating,
&.nc-cell-geodata {
@apply !py-1;
}
:deep(input) {
@apply !px-1;
}
&.nc-cell-longtext {
@apply p-0 h-auto overflow-hidden;
}
&:not(.nc-cell-longtext) {
@apply px-2 py-2;
:deep(textarea) {
@apply !p-2;
}
}
&.nc-cell-checkbox {
> * {
@apply justify-center flex items-center;
}
}
}
.nc-form-data-cell.nc-data-cell { .nc-form-data-cell.nc-data-cell {
@apply !border-none rounded-none; @apply !border-none rounded-none;

Loading…
Cancel
Save