diff options
Diffstat (limited to 'src/components/FormatTransformer.vue')
-rw-r--r-- | src/components/FormatTransformer.vue | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/src/components/FormatTransformer.vue b/src/components/FormatTransformer.vue index 96f7798..cf62a9f 100644 --- a/src/components/FormatTransformer.vue +++ b/src/components/FormatTransformer.vue @@ -1,37 +1,17 @@ -<template> - <c-input-text - ref="inputElement" - v-model:value="input" - :placeholder="inputPlaceholder" - :label="inputLabel" - rows="20" - autosize - raw-text - multiline - test-id="input" - :validation-rules="inputValidationRules" - /> - - <div> - <div mb-5px>{{ outputLabel }}</div> - <textarea-copyable :value="output" :language="outputLanguage" :follow-height-of="inputElement?.inputWrapperRef" /> - </div> -</template> - <script setup lang="ts"> -import type { UseValidationRule } from '@/composable/validation'; import _ from 'lodash'; +import type { UseValidationRule } from '@/composable/validation'; import CInputText from '@/ui/c-input-text/c-input-text.vue'; const props = withDefaults( defineProps<{ - transformer?: (v: string) => string; - inputValidationRules?: UseValidationRule<string>[]; - inputLabel?: string; - inputPlaceholder?: string; - inputDefault?: string; - outputLabel?: string; - outputLanguage?: string; + transformer?: (v: string) => string + inputValidationRules?: UseValidationRule<string>[] + inputLabel?: string + inputPlaceholder?: string + inputDefault?: string + outputLabel?: string + outputLanguage?: string }>(), { transformer: _.identity, @@ -44,8 +24,8 @@ const props = withDefaults( }, ); -const { transformer, inputValidationRules, inputLabel, outputLabel, outputLanguage, inputPlaceholder, inputDefault } = - toRefs(props); +const { transformer, inputValidationRules, inputLabel, outputLabel, outputLanguage, inputPlaceholder, inputDefault } + = toRefs(props); const inputElement = ref<typeof CInputText>(); @@ -53,4 +33,24 @@ const input = ref(inputDefault.value); const output = computed(() => transformer.value(input.value)); </script> -<style scoped></style> +<template> + <CInputText + ref="inputElement" + v-model:value="input" + :placeholder="inputPlaceholder" + :label="inputLabel" + rows="20" + autosize + raw-text + multiline + test-id="input" + :validation-rules="inputValidationRules" + /> + + <div> + <div mb-5px> + {{ outputLabel }} + </div> + <textarea-copyable :value="output" :language="outputLanguage" :follow-height-of="inputElement?.inputWrapperRef" /> + </div> +</template> |