From 316da760c96a5ff490bcda294d19ad4f6983b9e8 Mon Sep 17 00:00:00 2001 From: Jeffrey <1115378579@qq.com> Date: Tue, 28 May 2024 10:34:51 +0800 Subject: [PATCH] feat(new tools): Text Case Converter --- components.d.ts | 8 ++ locales/en.yml | 3 + locales/zh.yml | 3 + src/tools/index.ts | 2 + src/tools/text-case-converter/index.ts | 13 +++ .../text-case-converter.vue | 88 +++++++++++++++++++ 6 files changed, 117 insertions(+) create mode 100644 src/tools/text-case-converter/index.ts create mode 100644 src/tools/text-case-converter/text-case-converter.vue diff --git a/components.d.ts b/components.d.ts index f2c3146f..489a3ef8 100644 --- a/components.d.ts +++ b/components.d.ts @@ -89,7 +89,9 @@ declare module '@vue/runtime-core' { HttpStatusCodes: typeof import('./src/tools/http-status-codes/http-status-codes.vue')['default'] IbanValidatorAndParser: typeof import('./src/tools/iban-validator-and-parser/iban-validator-and-parser.vue')['default'] 'IconMdi:brushVariant': typeof import('~icons/mdi/brush-variant')['default'] + 'IconMdi:contentCopy': typeof import('~icons/mdi/content-copy')['default'] 'IconMdi:kettleSteamOutline': typeof import('~icons/mdi/kettle-steam-outline')['default'] + IconMdiArrowDown: typeof import('~icons/mdi/arrow-down')['default'] IconMdiChevronDown: typeof import('~icons/mdi/chevron-down')['default'] IconMdiChevronRight: typeof import('~icons/mdi/chevron-right')['default'] IconMdiClose: typeof import('~icons/mdi/close')['default'] @@ -127,6 +129,7 @@ declare module '@vue/runtime-core' { MetaTagGenerator: typeof import('./src/tools/meta-tag-generator/meta-tag-generator.vue')['default'] MimeTypes: typeof import('./src/tools/mime-types/mime-types.vue')['default'] NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default'] + NButton: typeof import('naive-ui')['NButton'] NCode: typeof import('naive-ui')['NCode'] NCollapseTransition: typeof import('naive-ui')['NCollapseTransition'] NConfigProvider: typeof import('naive-ui')['NConfigProvider'] @@ -138,13 +141,17 @@ declare module '@vue/runtime-core' { NH1: typeof import('naive-ui')['NH1'] NH3: typeof import('naive-ui')['NH3'] NIcon: typeof import('naive-ui')['NIcon'] + NInput: typeof import('naive-ui')['NInput'] NInputNumber: typeof import('naive-ui')['NInputNumber'] NLabel: typeof import('naive-ui')['NLabel'] NLayout: typeof import('naive-ui')['NLayout'] NLayoutSider: typeof import('naive-ui')['NLayoutSider'] NMenu: typeof import('naive-ui')['NMenu'] NScrollbar: typeof import('naive-ui')['NScrollbar'] + NSlider: typeof import('naive-ui')['NSlider'] NSpin: typeof import('naive-ui')['NSpin'] + NStatistic: typeof import('naive-ui')['NStatistic'] + NSwitch: typeof import('naive-ui')['NSwitch'] NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default'] OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default'] PasswordStrengthAnalyser: typeof import('./src/tools/password-strength-analyser/password-strength-analyser.vue')['default'] @@ -167,6 +174,7 @@ declare module '@vue/runtime-core' { SvgPlaceholderGenerator: typeof import('./src/tools/svg-placeholder-generator/svg-placeholder-generator.vue')['default'] TemperatureConverter: typeof import('./src/tools/temperature-converter/temperature-converter.vue')['default'] TextareaCopyable: typeof import('./src/components/TextareaCopyable.vue')['default'] + TextCaseConverter: typeof import('./src/tools/text-case-converter/text-case-converter.vue')['default'] TextDiff: typeof import('./src/tools/text-diff/text-diff.vue')['default'] TextStatistics: typeof import('./src/tools/text-statistics/text-statistics.vue')['default'] TextToBinary: typeof import('./src/tools/text-to-binary/text-to-binary.vue')['default'] diff --git a/locales/en.yml b/locales/en.yml index d09d435a..6f9b001d 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -391,3 +391,6 @@ tools: text-to-binary: title: Text to ASCII binary description: Convert text to its ASCII binary representation and vice-versa. + text-case-converter: + title: Text Case Converter + description: Convert your text or string to uppercase, lowercase, title case & sentence case. diff --git a/locales/zh.yml b/locales/zh.yml index 160fe1fa..40eba503 100644 --- a/locales/zh.yml +++ b/locales/zh.yml @@ -387,3 +387,6 @@ tools: text-to-binary: title: 文本到 ASCII 二进制 description: 将文本转换为其 ASCII 二进制表示形式,反之亦然。 + text-case-converter: + title: 文本大小写转换器 + description: 将文本或字符串转换为大写、小写、标题大小写和句子大小写。 diff --git a/src/tools/index.ts b/src/tools/index.ts index aa861c93..8840b472 100644 --- a/src/tools/index.ts +++ b/src/tools/index.ts @@ -81,6 +81,7 @@ import { tool as uuidGenerator } from './uuid-generator'; import { tool as macAddressLookup } from './mac-address-lookup'; import { tool as xmlFormatter } from './xml-formatter'; import { tool as yamlViewer } from './yaml-viewer'; +import { tool as textCaseConverter } from './text-case-converter'; export const toolsByCategory: ToolCategory[] = [ { @@ -172,6 +173,7 @@ export const toolsByCategory: ToolCategory[] = [ textDiff, numeronymGenerator, asciiTextDrawer, + textCaseConverter, ], }, { diff --git a/src/tools/text-case-converter/index.ts b/src/tools/text-case-converter/index.ts new file mode 100644 index 00000000..3cdd1a11 --- /dev/null +++ b/src/tools/text-case-converter/index.ts @@ -0,0 +1,13 @@ +import { LetterCase } from '@vicons/tabler'; +import { defineTool } from '../tool'; +import { translate } from '@/plugins/i18n.plugin'; + +export const tool = defineTool({ + name: translate('tools.text-case-converter.title'), + path: '/text-case-converter', + description: translate('tools.text-case-converter.description'), + keywords: ['text', 'case', 'converter'], + component: () => import('./text-case-converter.vue'), + icon: LetterCase, + createdAt: new Date('2024-5-28'), +}); diff --git a/src/tools/text-case-converter/text-case-converter.vue b/src/tools/text-case-converter/text-case-converter.vue new file mode 100644 index 00000000..36107b42 --- /dev/null +++ b/src/tools/text-case-converter/text-case-converter.vue @@ -0,0 +1,88 @@ + + +