Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/FormatTransformer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const output = computed(() => transformer.value(input.value));
multiline
test-id="input"
:validation-rules="inputValidationRules"
monospace
/>

<div>
Expand Down
2 changes: 2 additions & 0 deletions src/tools/json-diff/json-diff.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const jsonValidationRules = [
multiline
test-id="leftJson"
raw-text
monospace
/>

<c-input-text
Expand All @@ -40,6 +41,7 @@ const jsonValidationRules = [
multiline
test-id="rightJson"
raw-text
monospace
/>

<DiffsViewer :left-json="leftJson" :right-json="rightJson" />
Expand Down
5 changes: 3 additions & 2 deletions src/tools/sql-prettify/sql-prettify.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,17 @@ const prettySQL = computed(() => formatSQL(rawSQL.value, config));
</div>

<n-form-item label="Your SQL query">
<n-input
<c-input-text
ref="inputElement"
v-model:value="rawSQL"
placeholder="Put your SQL query here..."
type="textarea"
rows="20"
multiline
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false"
monospace
/>
</n-form-item>
<n-form-item label="Prettify version of your query">
Expand Down
10 changes: 9 additions & 1 deletion src/ui/c-input-text/c-input-text.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const props = withDefaults(
rows?: number | string
autosize?: boolean
autofocus?: boolean
monospace?: boolean
}>(),
{
value: '',
Expand All @@ -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
Expand Down Expand Up @@ -157,6 +159,9 @@ defineExpose({
ref="textareaRef"
v-model="value"
class="input"
:class="{
'leading-5 !font-mono': monospace,
}"
:placeholder="placeholder"
:readonly="readonly"
:disabled="disabled"
Expand All @@ -175,6 +180,9 @@ defineExpose({
v-model="value"
:type="htmlInputType"
class="input"
:class="{
'leading-5 !font-mono': monospace,
}"
size="1"
:placeholder="placeholder"
:readonly="readonly"
Expand Down