Compare commits

..
Author SHA1 Message Date
7d5e8be848 Issues/issue 1150 fix autogrow (#193)
* fix(c-input-text): set minimum height for input field (#1552)

* refactor(sponsors): removed sponsor banners (#1553)

* fix(issues): fix textarea always grows
check if the textarea overflows before resizing it

---------

Co-authored-by: Corentin Thomasset <corentin.thomasset74@gmail.com>
Co-authored-by: Maximilian Bienhüls <maximilian.bienhuels@triluxds.com>
2025-09-20 12:58:43 +02:00
10 changed files with 32 additions and 74 deletions

No files matched your search

-4
View File
@@ -6,10 +6,6 @@
Useful tools for developer and people working in IT. [Have a look !](https://it-tools.tech).
## Sponsors
[![Renderize banner](./.github/sponsor-banner.svg)](https://renderize.tech?utm_source=it-tools&utm_medium=readme)
## Functionalities and roadmap
Please check the [issues](https://github.com/CorentinTh/it-tools/issues) to see if some feature listed to be implemented.
+1 -19
View File
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { IconDragDrop, IconFileDescription, IconHeart } from '@tabler/icons-vue';
import { IconDragDrop, IconHeart } from '@tabler/icons-vue';
import { useHead } from '@vueuse/head';
import { computed } from 'vue';
import Draggable from 'vuedraggable';
@@ -43,24 +43,6 @@ function onUpdateFavoriteTools() {
{{ $t('home.follow.thankYou') }}
<n-icon :component="IconHeart" />
</ColoredCard>
<a href="https://renderize.tech?utm_source=it-tools&utm_medium=banner" target="_blank" rel="noopener" class="text-current decoration-none">
<c-card v-if="config.showSponsorBanner" class="cursor-pointer !border-2px !hover:border-primary">
<div class="flex items-center justify-between">
<n-icon :component="IconFileDescription" class="text-neutral-400 dark:text-neutral-600" size="40" />
<div class="rounded-full bg-#eeeeee px-10px py-2px text-xs text-black dark:bg-#333333 dark:text-white">
Sponsor
</div>
</div>
<div class="my-5px flex items-baseline gap-4 text-balance text-lg text-black dark:text-white">
Generate PDFs from HTML with Renderize API
</div>
<div class="text-neutral-500 dark:text-neutral-400">
Automate your document generation with our fast, developer-friendly API. Start with a free forever plan.
</div>
</c-card>
</a>
</div>
<transition name="height">
@@ -1,15 +0,0 @@
import { test, expect } from '@playwright/test';
test.describe('Tool - Dockerfile linter', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/dockerfile-linter');
});
test('Has correct title', async ({ page }) => {
await expect(page).toHaveTitle('Dockerfile linter - IT Tools');
});
test('', async ({ page }) => {
});
});
@@ -1,6 +0,0 @@
import { expect, describe, it } from 'vitest';
// import { } from './dockerfile-linter.service';
//
// describe('dockerfile-linter', () => {
//
// })
Whitespace-only changes.
@@ -1,12 +0,0 @@
<template>
<div>
Lorem ipsum
</div>
</template>
<script setup lang="ts">
</script>
<style lang="less" scoped>
</style>
-12
View File
@@ -1,12 +0,0 @@
import { ArrowsShuffle } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'Dockerfile Linter',
path: '/dockerfile-linter',
description: '',
keywords: ['dockerfile', 'docker', 'linter'],
component: () => import('./dockerfile-linter.vue'),
icon: ArrowsShuffle,
createdAt: new Date('2025-01-01'),
});
-2
View File
@@ -2,7 +2,6 @@ import { tool as base64FileConverter } from './base64-file-converter';
import { tool as base64StringConverter } from './base64-string-converter';
import { tool as basicAuthGenerator } from './basic-auth-generator';
import { tool as emailNormalizer } from './email-normalizer';
import { tool as dockerfileLinter } from './dockerfile-linter';
import { tool as asciiTextDrawer } from './ascii-text-drawer';
@@ -156,7 +155,6 @@ export const toolsByCategory: ToolCategory[] = [
sqlPrettify,
chmodCalculator,
dockerRunToDockerComposeConverter,
dockerfileLinter,
xmlFormatter,
yamlViewer,
emailNormalizer,
+30 -3
View File
@@ -91,14 +91,41 @@ watch(
{ immediate: true },
);
/**
* Checks if the given HTMLElement overflows
* copied from stackoverflow: https://stackoverflow.com/questions/143815/determine-if-an-html-elements-content-overflows
* @param el The HTMLElement to check
*/
function checkOverflow(el: HTMLElement) {
const curOverflow = el.style.overflow;
if (!curOverflow || curOverflow === 'visible') {
el.style.overflow = 'hidden';
}
const isOverflowing = el.clientWidth < el.scrollWidth || el.clientHeight < el.scrollHeight;
el.style.overflow = curOverflow;
return isOverflowing;
}
function resizeTextarea() {
if (!textareaRef.value || !inputWrapperRef.value) {
if (textareaRef.value === undefined) {
return; // cannot chnge textarea if element is not available
}
if (!multiline) {
return; // textarea wont be displayed if multiline === false
}
if (!checkOverflow(textareaRef.value)) {
return;
}
const scrollHeight = textareaRef.value.scrollHeight + 2;
const textAreaElement = textareaRef.value!;
inputWrapperRef.value.style.height = `${scrollHeight}px`;
const scrollHeight = textAreaElement.scrollHeight + 2;
textAreaElement.style.height = `${scrollHeight}px`;
}
const htmlInputType = computed(() => {
+1 -1
View File
@@ -10,7 +10,7 @@ import {
import { presetScrollbar } from 'unocss-preset-scrollbar';
export default defineConfig({
presets: [presetUno(), presetAttributify(), presetTypography(), presetScrollbar()],
presets: [presetUno(), presetAttributify({ ignoreAttributes: ['size'] }), presetTypography(), presetScrollbar()],
transformers: [transformerDirectives(), transformerVariantGroup()],
theme: {
colors: {