From a49a68215e1a413806c31ee387bc18b958156803 Mon Sep 17 00:00:00 2001 From: mertmit Date: Tue, 17 Jan 2023 02:19:38 +0300 Subject: [PATCH] feat: ClampedText for handling line-clamping Signed-off-by: mertmit --- .../nc-gui/components/cell/ClampedText.vue | 24 +++++++++++++ packages/nc-gui/components/cell/Text.vue | 2 +- packages/nc-gui/components/cell/TextArea.vue | 9 +---- .../nc-gui/components/smartsheet/Cell.vue | 22 +++++++++++- .../nc-gui/components/smartsheet/Grid.vue | 25 +++++++++++-- packages/nc-gui/package-lock.json | 35 ++++++++++++++++++- packages/nc-gui/package.json | 1 + packages/nc-gui/plugins/clamp.ts | 6 ++++ 8 files changed, 110 insertions(+), 14 deletions(-) create mode 100644 packages/nc-gui/components/cell/ClampedText.vue create mode 100644 packages/nc-gui/plugins/clamp.ts diff --git a/packages/nc-gui/components/cell/ClampedText.vue b/packages/nc-gui/components/cell/ClampedText.vue new file mode 100644 index 0000000000..5a74755ea3 --- /dev/null +++ b/packages/nc-gui/components/cell/ClampedText.vue @@ -0,0 +1,24 @@ + + + diff --git a/packages/nc-gui/components/cell/Text.vue b/packages/nc-gui/components/cell/Text.vue index ad85967e5e..47639dfc2a 100644 --- a/packages/nc-gui/components/cell/Text.vue +++ b/packages/nc-gui/components/cell/Text.vue @@ -38,5 +38,5 @@ const focus: VNodeRef = (el) => { @mousedown.stop /> - {{ vModel }} + diff --git a/packages/nc-gui/components/cell/TextArea.vue b/packages/nc-gui/components/cell/TextArea.vue index 021c67b676..449c78e2d8 100644 --- a/packages/nc-gui/components/cell/TextArea.vue +++ b/packages/nc-gui/components/cell/TextArea.vue @@ -53,14 +53,7 @@ const rowHeight = computed(() => { @mousedown.stop /> - + {{ vModel }} diff --git a/packages/nc-gui/components/smartsheet/Cell.vue b/packages/nc-gui/components/smartsheet/Cell.vue index 9061933bb0..f10ebd9a76 100644 --- a/packages/nc-gui/components/smartsheet/Cell.vue +++ b/packages/nc-gui/components/smartsheet/Cell.vue @@ -1,8 +1,9 @@