Browse Source

fix(nc-gui): rich text switch input warnings

pull/7855/head
Ramesh Mane 8 months ago
parent
commit
33d8cba025
  1. 6
      packages/nc-gui/components/nc/Switch.vue
  2. 4
      packages/nc-gui/components/smartsheet/column/LongTextOptions.vue

6
packages/nc-gui/components/nc/Switch.vue

@ -1,5 +1,7 @@
<script lang="ts" setup>
const props = defineProps<{ checked: boolean; disabled?: boolean }>()
const props = withDefaults(defineProps<{ checked: boolean; disabled?: boolean; size?: 'default' | 'small' }>(), {
size: 'small',
})
const emit = defineEmits(['change', 'update:checked'])
@ -11,7 +13,7 @@ const onChange = (e: boolean) => {
</script>
<template>
<a-switch v-model:checked="checked" :disabled="props.disabled" class="nc-switch" size="small" @change="onChange"> </a-switch>
<a-switch v-model:checked="checked" :disabled="disabled" class="nc-switch" :size="size" @change="onChange"> </a-switch>
<span v-if="$slots.default" class="cursor-pointer pl-2" @click="checked = !checked">
<slot />
</span>

4
packages/nc-gui/components/smartsheet/column/LongTextOptions.vue

@ -12,7 +12,7 @@ const emit = defineEmits(['update:value'])
const vModel = useVModel(props, 'value', emit)
const richMode = computed({
get: () => vModel.value.meta?.richMode,
get: () => !!vModel.value.meta?.richMode,
set: (value) => {
if (!vModel.value.meta) vModel.value.meta = {}
@ -29,7 +29,7 @@ watch(richMode, () => {
<div class="flex flex-col mt-2 gap-2">
<a-form-item>
<div class="flex flex-row items-center">
<NcSwitch v-model:checked="richMode" :name="$t('labels.enableRichText')" size="small">
<NcSwitch v-model:checked="richMode">
<div class="text-xs">{{ $t('labels.enableRichText') }}</div>
</NcSwitch>
</div>

Loading…
Cancel
Save