aboutsummaryrefslogtreecommitdiff
path: root/src/ui/c-input-text/c-input-text.vue
diff options
context:
space:
mode:
authorGravatar Marvin <33938500+marvin-j97@users.noreply.github.com> 2023-06-23 16:51:52 +0200
committerGravatar GitHub <noreply@github.com> 2023-06-23 16:51:52 +0200
commitba4876d0d52c92580e6bac3fd2e22d90c0182824 (patch)
treeeb896b5c0f189f94f014b52eeddafeac540de4bc /src/ui/c-input-text/c-input-text.vue
parent363c2e47e617c3f0718a410c038909bc226cd6df (diff)
downloadit-tools-ba4876d0d52c92580e6bac3fd2e22d90c0182824.tar.gz
it-tools-ba4876d0d52c92580e6bac3fd2e22d90c0182824.tar.zst
it-tools-ba4876d0d52c92580e6bac3fd2e22d90c0182824.zip
refacor(transformers): use monospace font for JSON and SQL text areas (#476)
* feat(c-input): Add monospace prop * feat: use monospace input for json and sql inputs
Diffstat (limited to 'src/ui/c-input-text/c-input-text.vue')
-rw-r--r--src/ui/c-input-text/c-input-text.vue10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ui/c-input-text/c-input-text.vue b/src/ui/c-input-text/c-input-text.vue
index b89d1e4..0f96b2a 100644
--- a/src/ui/c-input-text/c-input-text.vue
+++ b/src/ui/c-input-text/c-input-text.vue
@@ -30,6 +30,7 @@ const props = withDefaults(
rows?: number | string
autosize?: boolean
autofocus?: boolean
+ monospace?: boolean
}>(),
{
value: '',
@@ -56,13 +57,14 @@ const props = withDefaults(
rows: 3,
autosize: false,
autofocus: false,
+ monospace: false,
},
);
const emit = defineEmits(['update:value']);
const value = useVModel(props, 'value', emit);
const showPassword = ref(false);
-const { id, placeholder, label, validationRules, labelPosition, labelWidth, labelAlign, autosize, readonly, disabled, clearable, type, multiline, rows, rawText, autofocus } = toRefs(props);
+const { id, placeholder, label, validationRules, labelPosition, labelWidth, labelAlign, autosize, readonly, disabled, clearable, type, multiline, rows, rawText, autofocus, monospace } = toRefs(props);
const validation
= props.validation
@@ -157,6 +159,9 @@ defineExpose({
ref="textareaRef"
v-model="value"
class="input"
+ :class="{
+ 'leading-5 !font-mono': monospace,
+ }"
:placeholder="placeholder"
:readonly="readonly"
:disabled="disabled"
@@ -175,6 +180,9 @@ defineExpose({
v-model="value"
:type="htmlInputType"
class="input"
+ :class="{
+ 'leading-5 !font-mono': monospace,
+ }"
size="1"
:placeholder="placeholder"
:readonly="readonly"