From 43aae02016500963927664eee084c53b669dd2e1 Mon Sep 17 00:00:00 2001 From: mertmit Date: Fri, 17 Mar 2023 22:23:09 +0300 Subject: [PATCH] fix: add default value to row height injection Signed-off-by: mertmit --- packages/nc-gui/components/cell/ClampedText.vue | 2 +- packages/nc-gui/components/cell/Text.vue | 5 ++++- packages/nc-gui/components/cell/TextArea.vue | 5 ++++- packages/nc-gui/components/virtual-cell/QrCode.vue | 6 +++++- packages/nc-gui/components/virtual-cell/barcode/Barcode.vue | 5 ++++- 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/packages/nc-gui/components/cell/ClampedText.vue b/packages/nc-gui/components/cell/ClampedText.vue index e6b4fa3eb0..515a95bed3 100644 --- a/packages/nc-gui/components/cell/ClampedText.vue +++ b/packages/nc-gui/components/cell/ClampedText.vue @@ -31,7 +31,7 @@ onMounted(() => { :key="`clamp-${key}-${props.value?.toString().length || 0}`" class="w-full h-full break-word" :text="`${props.value || ' '}`" - :max-lines="props.lines" + :max-lines="props.lines || 1" /> diff --git a/packages/nc-gui/components/cell/Text.vue b/packages/nc-gui/components/cell/Text.vue index 1f744070f3..05fcbc4856 100644 --- a/packages/nc-gui/components/cell/Text.vue +++ b/packages/nc-gui/components/cell/Text.vue @@ -14,7 +14,10 @@ const { showNull } = useGlobal() const editEnabled = inject(EditModeInj) -const rowHeight = inject(RowHeightInj) +const rowHeight = inject( + RowHeightInj, + computed(() => undefined), +) const readonly = inject(ReadonlyInj, ref(false)) diff --git a/packages/nc-gui/components/cell/TextArea.vue b/packages/nc-gui/components/cell/TextArea.vue index 21ebfd8e0b..859b495bbd 100644 --- a/packages/nc-gui/components/cell/TextArea.vue +++ b/packages/nc-gui/components/cell/TextArea.vue @@ -10,7 +10,10 @@ const emits = defineEmits(['update:modelValue']) const editEnabled = inject(EditModeInj) -const rowHeight = inject(RowHeightInj) +const rowHeight = inject( + RowHeightInj, + computed(() => undefined), +) const { showNull } = useGlobal() diff --git a/packages/nc-gui/components/virtual-cell/QrCode.vue b/packages/nc-gui/components/virtual-cell/QrCode.vue index e4c59a21e4..9835d4174c 100644 --- a/packages/nc-gui/components/virtual-cell/QrCode.vue +++ b/packages/nc-gui/components/virtual-cell/QrCode.vue @@ -21,7 +21,11 @@ const qrCodeOptions: QRCode.QRCodeToDataURLOptions = { quality: 1, }, } -const rowHeight = inject(RowHeightInj) + +const rowHeight = inject( + RowHeightInj, + computed(() => undefined), +) const qrCode = useQRCode(qrValue, { ...qrCodeOptions, diff --git a/packages/nc-gui/components/virtual-cell/barcode/Barcode.vue b/packages/nc-gui/components/virtual-cell/barcode/Barcode.vue index 6aceb6cc90..8cf6de8b78 100644 --- a/packages/nc-gui/components/virtual-cell/barcode/Barcode.vue +++ b/packages/nc-gui/components/virtual-cell/barcode/Barcode.vue @@ -32,7 +32,10 @@ const showBarcode = computed(() => barcodeValue?.value.length > 0 && !tooManyCha const { showEditNonEditableFieldWarning, showClearNonEditableFieldWarning } = useShowNotEditableWarning() -const rowHeight = inject(RowHeightInj) +const rowHeight = inject( + RowHeightInj, + computed(() => undefined), +)